o
odin.langpkg.dev
packages / library / RuneDocs

RuneDocs

95cef15library

No description provided.

MIT · updated 4 weeks ago

RuneDocs

RuneDocs is a small static documentation generator written in Odin. It scans a project for Markdown files and source comments, converts the documentation it finds into HTML, and writes a browsable static site to build/.

The generated site includes:

  • An index.html landing page.
  • One HTML page for each Markdown document in docs/.
  • One HTML page for each source file with extractable comments in src/ and examples/.

How It Works

For Markdown files, the page title is taken from the first # Heading. If no top-level heading exists, RuneDocs uses the filename stem as the title.

For source files, RuneDocs extracts contiguous line-comment blocks. Supported comment prefixes are:

  • ///
  • //!
  • //

Supported source file extensions are:

  • .odin
  • .c
  • .h
  • .cpp
  • .hpp
  • .rs
  • .go
  • .js
  • .ts
  • .py

The Markdown renderer is minimal.

It supports:

  • #, ##, and ### headings.
  • Paragraphs.
  • Fenced code blocks using triple backticks.
  • HTML escaping for generated content.

It does not currently implement the full Markdown specification, lists, tables, links, emphasis, images, or syntax highlighting. This will be coming in future versions.

Build

Requirements

  • Odin compiler installed and available on your PATH.

Check your Odin installation with:

odin version

Build RuneDocs

From the repository root:

odin build src -out:RuneDocs

This creates the RuneDocs executable in the project root.

Generate Documentation

Run either command from the repository root:

./RuneDocs

or:

./RuneDocs build

Both commands generate the static site in build/.

After generation, open build/index.html in a browser or serve the build/ directory with any static file server.

Serve Documentation Locally

RuneDocs includes a simple local HTTP server:

./RuneDocs serve

By default this rebuilds the docs and serves build/ at:

http://127.0.0.1:8080

You can pass a custom port:

./RuneDocs serve 3000

Usage

Usage:
    RuneDocs build
    RuneDocs serve [PORT]

Adding Documentation

Create Markdown files under docs/:

docs/getting-started.md

or add documentation comments to supported source files:

/// Builds the static documentation site.
/// This scans Markdown files and source comments.
build_docs :: proc() -> os.Error {
    // ...
}

Then rebuild:

./RuneDocs build

Generated pages will appear under build/ using their project relative paths.