Menu

Documentation System

Relevant source files

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.

Architecture Overview

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

YAML to Markdown Generation

The core documentation generation is handled by the docgen-md.own script, which processes structured YAML module definitions and produces VuePress-compatible Markdown files.

Module Processing Workflow

YAML Processing and Markdown Generation Sources: docs/src/docgen-md.own67-82 docs/src/docgen-md.own55-60

Content Generation Functions

FunctionPurposeFile Location
writeHeader()Generates module title and metadatadocs/src/docgen-md.own85-95
writeConstants()Processes module constants with type informationdocs/src/docgen-md.own97-124
writeFunctions()Generates function documentation with examplesdocs/src/docgen-md.own126-141
writeTypes()Documents custom types and their methodsdocs/src/docgen-md.own143-155
writeScope()Adds platform scope indicatorsdocs/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

VuePress Configuration and Theming

The documentation site uses VuePress 2.0 with a customized default theme and specialized plugins for enhanced functionality.

Site Configuration Structure

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

Localization Configuration

The system supports English and Russian through VuePress's built-in localization features:

Sources: docs/docs/.vuepress/config.js16-27

Custom Documentation Components

The documentation system includes specialized Vue components that enhance the presentation of version and platform-specific information.

Version and Scope Indicators

ComponentPurposeUsage 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 badges
  • Dark mode support through CSS custom properties

Sources: docs/docs/.vuepress/components/Since.vue21-31 docs/docs/.vuepress/styles/palette.scss7-8

Build and Development Workflow

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

Package Dependencies

The documentation system relies on specific VuePress packages and plugins:

PackageVersionPurpose
vuepress2.0.0-rc.0Core static site generator
@vuepress/plugin-prismjs2.0.0-rc.0Syntax highlighting for OwnLang
@vuepress/plugin-search2.0.0-rc.0Client-side search functionality
@vuepress/plugin-register-components2.0.0-rc.0Custom component registration

Sources: docs/package.json17-26 docs/pnpm-lock.yaml10-34

Version History Management

The documentation system maintains comprehensive version history through structured changelog files that track feature evolution, bug fixes, and module updates across releases.

Changelog Structure

The changelog system uses a standardized format with sections for different types of changes:

  • Breaking changes - Compatibility-affecting modifications
  • Changes - New features and enhancements
  • Fixes - Bug corrections and stability improvements
  • Modules - Module-specific updates and additions

Example changelog entry structure:

Sources: docs/docs/en/changelog.md6-21 docs/docs/ru/changelog.md6-21

Version Tracking Integration

The documentation system integrates version information from multiple sources:

  1. Core Version Constants - Defined in Java source code for runtime access
  2. Changelog Documentation - Human-readable release notes
  3. Component Version Tags - <Since> components for feature introduction tracking

The 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