#teal #lua #documentation #tealr #online-docs

app tealr_doc_gen

A cli tool to create online documentation for apis made with tealr

4 releases (2 breaking)

0.3.0-alpha2 Jan 8, 2023
0.3.0-alpha1 Sep 15, 2022
0.2.0 Jul 24, 2022
0.1.0 Feb 20, 2022

#1092 in Command line utilities


1.5K SLoC

Rust 1.5K SLoC // 0.0% comments Lua 384 SLoC // 0.0% comments


This tool is meant to be used together with tealr and is used to generate online documentation for lua/teal apis created with tealr

Rendered Example



  • full markdown support
  • code highlighting in code examples
  • multiple theme support
  • snippets marked as teal_lua get compiled to lua and both versions get embedded.
  • When compiling teal_lua snippets, any errors get logged.

How to get the json

The json file needed to generate the documentation can easily be gotten using

use tealr::{

fn main() {
    let types = TypeWalker::new()
    let json = serde_json::to_string_pretty(&types).unwrap();
    println!("{}",json); //save to a file


To install, simply run

cargo install tealr_doc_gen

Cargo will do the rest.

After it is installed, generating the online documentation is done by running

tealr_doc_gen --json path/to/json/file --name yourApiName


Required arguments

  • --json /path/to/json/generated/by/tealr
  • --name nameOfTheLibrary

Optional arguments

  • --build_folder What folder to store the generated html pages at (defaults to ./pages)
  • --root set if / will not be the root of the server


~141K SLoC