The Documentation System provides automated generation and management of OwnLang's technical documentation. It transforms structured YAML module definitions into a multilingual VuePress static site with interactive components, search functionality, and versioned content tracking.
For information about the build system that compiles the documentation, see Build and Distribution. For details about the module definitions that drive documentation generation, see Module System.
The documentation system operates as a multi-stage pipeline that converts structured module definitions into a deployable static site.
Documentation Generation Pipeline Sources: docs/src/docgen-md.own1-200 docs/package.json6-9 docs/docs/.vuepress/config.js14-63
The core documentation generation is handled by the docgen-md.own
script, which processes structured YAML module definitions and produces VuePress-compatible Markdown files.
YAML Processing and Markdown Generation Sources: docs/src/docgen-md.own67-82 docs/src/docgen-md.own55-60
Function | Purpose | File Location |
---|---|---|
writeHeader() | Generates module title and metadata | docs/src/docgen-md.own85-95 |
writeConstants() | Processes module constants with type information | docs/src/docgen-md.own97-124 |
writeFunctions() | Generates function documentation with examples | docs/src/docgen-md.own126-141 |
writeTypes() | Documents custom types and their methods | docs/src/docgen-md.own143-155 |
writeScope() | Adds platform scope indicators | docs/src/docgen-md.own157-161 |
The generation process supports multilingual content through the getValue()
function which handles language-specific keys in YAML definitions.
Sources: docs/src/docgen-md.own188-191
The documentation site uses VuePress 2.0 with a customized default theme and specialized plugins for enhanced functionality.
VuePress Architecture and Component Integration Sources: docs/docs/.vuepress/config.js1-63 docs/docs/.vuepress/components/Since.vue1-32 docs/docs/.vuepress/components/Scope.vue1-30
The system supports English and Russian through VuePress's built-in localization features:
Sources: docs/docs/.vuepress/config.js16-27
The documentation system includes specialized Vue components that enhance the presentation of version and platform-specific information.
Component | Purpose | Usage Example |
---|---|---|
<Since> | Displays version introduction information | <Since text="Since" version="2.1.0" /> |
<Scope> | Shows platform availability (desktop/android) | <Scope scope="desktop" /> |
The Since
component uses custom CSS variables for consistent theming:
--usc-since: var(--c-badge-warning)
for version badgesSources: docs/docs/.vuepress/components/Since.vue21-31 docs/docs/.vuepress/styles/palette.scss7-8
The documentation build process integrates with the project's overall build system through standardized npm scripts and dependency management.
Build Process Sequence Sources: docs/package.json7-8 docs/src/docgen-md.own55-82
The documentation system relies on specific VuePress packages and plugins:
Package | Version | Purpose |
---|---|---|
vuepress | 2.0.0-rc.0 | Core static site generator |
@vuepress/plugin-prismjs | 2.0.0-rc.0 | Syntax highlighting for OwnLang |
@vuepress/plugin-search | 2.0.0-rc.0 | Client-side search functionality |
@vuepress/plugin-register-components | 2.0.0-rc.0 | Custom component registration |
Sources: docs/package.json17-26 docs/pnpm-lock.yaml10-34
The documentation system maintains comprehensive version history through structured changelog files that track feature evolution, bug fixes, and module updates across releases.
The changelog system uses a standardized format with sections for different types of changes:
Example changelog entry structure:
Sources: docs/docs/en/changelog.md6-21 docs/docs/ru/changelog.md6-21
The documentation system integrates version information from multiple sources:
<Since>
components for feature introduction trackingThe version information flows from ownlang-core/src/main/java/com/annimon/ownlang/Version.java4-10 into documentation components and build metadata.
Sources: ownlang-core/src/main/java/com/annimon/ownlang/Version.java1-11 docs/src/docgen-md.own170-176
Refresh this wiki