Rhai Script Documentation Tool

The Rhai Script Documentation Tool, rhai-doc, takes a source directory and scans for Rhai script files (recursively), building a web-based documentation site for all functions defined. Documentation is taken from MarkDown doc-comments on the functions.

Author: @semirix

Repo: On GitHub

Binary: rhai-doc

Flags and Options

Flag/OptionParameterDescription
-h, --helpprint help
-V, --versionprint version
-D, --dest<directory>set destination path for documentation output (default ./dist)
-d, --dir<directory>set source path for Rhai script files (default .)
-p, --pages<directory>set source path for additional MarkDown files to include in documentation (default ./pages)

rhai.toml

The file rhai.toml contains configuration options for rhai-doc and must be placed in the source directory.

Example:

name = "My Rhai Project"                # project name
colour = [246, 119, 2]                  # theme color
index = "home.md"                       # this file becomes 'index.html`
root = "https://example.com/docs/"      # root URL for generated site
icon = "logo.svg"                       # project icon
extension = "rhai"                      # script extension

[[links]]                               # external link for 'Blog'
name = "Blog"
link = "https://example.com/blog"

[[links]]                               # external link for 'Tools'
name = "Tools"
link = "https://example.com/tools"

Options for rhai.toml:

OptionValueDescription
namestringname of project – used as titles on documentation pages
colourRGB value stringtheme color for generated documentation
indexfile namemain MarkDown file – becomes index.html
rootURL stringroot URL generated as part of documentation
iconfile pathproject icon
extensionextension stringscript file extension (default rhai)
[[links]]tableexternal links
links.namestring• title of external link
links.linkURL string• URL of external link