Documentation data action
RFC-5100 · Implemented interface
Action identifier: evin/docs@v1.
The action discovers Markdown and reStructuredText, compiles each source into Evin's structured document model, validates formal references and links, and writes a data package for framework integrations. It does not render HTML or provide a web server. The generated manifest is the source of truth for page routes, locales, versions, and fallback pages.
Configure the action
Unknown fields are rejected.
tasks:
docs-data:
stage: Docs
steps:
- uses: evin/docs@v1
with:
source_dir: docs
out: dist/docs-data
strict_filenames: true
i18n:
default_locale: en
locales: [en, pt-BR]
versions:
- id: v0.2
source_dir: docs/versions/v0.2
- id: canary
source_dir: docs/canary
latest_version: canary
Each version source directory contains documentation files directly when
localization is disabled. With i18n, it contains one directory per locale,
such as docs/canary/en/ and docs/canary/pt-BR/. Without versions, the
action uses source_dir as one version named latest.
| Field | Type | Default | Meaning |
|---|---|---|---|
source_dir | path | docs | Source directory, relative to the workspace root unless absolute. |
out | path | dist/docs-data | Generated data package directory. |
include | string list | empty | Optional source selectors. Empty discovers files recursively. |
exclude | string list | empty | Glob patterns matched against paths relative to each source directory. |
asset_dir | relative path | assets | Source directory for referenced local media. Referenced images are copied into the data package and mapped in assets.json. |
extract_frontmatter | boolean | true | Extract YAML metadata from Markdown pages. reStructuredText metadata is always read. |
strict_filenames | boolean | false | Enforce ordered, route-safe source filenames. |
reference_prefix | string | REF | Prefix for formal reference IDs; normalized to uppercase ASCII letters and digits. |
validate_links | boolean | true | Check internal routes and anchors. |
i18n | object | unset | Locale inventory and default-locale fallback behavior. |
versions | object list | empty | Versions to compile; each item has id and optional source_dir. |
latest_version | string | latest when no versions are listed | Version whose routes omit a version prefix. Required when versions is set. |
Relative source and output paths resolve from the workspace root. Locale values must be valid, unique language tags. Version IDs must be unique path-safe identifiers. All configured versions are compiled in one invocation so the manifest can describe the full route set.
Generated package
The output directory contains a versioned manifest, one JSON file per page variant, and one binary search index per version/locale pair:
dist/docs-data/
├── manifest.json
├── assets.json
├── search/
│ └── <version>/<locale>.bin
└── pages/
├── page-<stable-id>.json
└── page-<stable-id>.json
manifest.json uses the evin.docs.manifest/v1 schema. It records the latest
version, default locale, available versions and locales, route records, page
data paths, fallback status, and counterpart IDs for equivalent pages across
versions and locales. Each page file uses evin.docs.page/v1 and contains the
stable page ID, version, requested and content locales, source path, route,
source navigation order, metadata, headings, references, and the serialized
Evin document AST. The
AST is the content contract; consumers render it as they choose. No HTML,
styles, browser scripts, or site shell are generated.
The manifest's search_indexes list identifies each generated search artifact
by version, locale, relative path, byte length, and SHA-256 digest. Each .bin
file uses the EVIS format with a versioned header, a shared string table,
page and heading records, a sorted term dictionary, and delta-encoded postings.
The action indexes titles, keywords, headings, routes, formal reference IDs,
and extracted page text, and stores a short result snippet. Frameworks can
search content and link directly to a matching heading without parsing page
ASTs in the browser.
Routes are computed by Evin and published in the manifest:
| Page variant | Route |
|---|---|
| Latest version, default locale | /guide |
| Latest version, other locale | /pt-BR/guide |
| Older version, default locale | /v0.2/guide |
| Older version, other locale | /v0.2/pt-BR/guide |
The root index page maps to / after applying any version and locale
prefixes. Ordered filename prefixes and formal reference suffixes do not
appear in routes. Route collisions are errors.
When a translated page is missing, the manifest keeps its localized route and
points it to the default-locale page data with is_fallback: true and the
actual content_locale. Evin reports missing pages through diagnostics;
consumers decide how to present that state. Counterpart mappings let a
consumer's locale or version switcher stay on the corresponding page when it
exists.
assets.json maps each page ID and original local media URL to its generated
package path. Referenced images are copied into version/locale-scoped asset
directories so similarly named files in different versions do not collide.
The page AST retains the original source URL; consumers use the asset map to
resolve it for bundling or display.
Framework integration
The manifest is framework-neutral. The everyinit runtime decodes and searches
the binary index; everyinit/vite exposes loadSearchIndex(version, locale)
and the shared searchDocs(index, query) function through
virtual:evin/search. Index files are loaded lazily so the browser fetches only
the selected version and locale. The Vite integration also exposes page data,
watches source files, and reruns the Evin CLI when inputs change.
Framework-specific adapters map route records into native routing APIs. The
action itself has no Vite, React, HTML, CSS, or browser runtime dependency.
Dry runs and outputs
The action reports manifest_path and page_count after a successful build.
Under --dry-run, it performs discovery, parsing, route construction,
validation, and serialization in a temporary directory, then removes it
without changing the configured output directory.
Use this action in CI to validate documentation and produce the data package consumed by a site application. Framework rendering and deployment remain in that application and its delivery workflow.
action.evin/docs@v1 Parse documentation sources into framework-neutral page data, routes, binary search indexes, and validation diagnostics.
The action compiles documentation into structured data for frontend integrations
and validates content, routes, and links. Configure it with a with: mapping.