Generate markdown documents from JSON schema files ✨.
Choose one of the following:
-
Download and manually install the latest release
-
Install with Homebrew 🍺
brew install twelvelabs/tap/schemadoc
-
Install from source
go install github.com/twelvelabs/schemadoc@latest
# Renders `./my.schema.json` to `./out/SchemaTitle.md`.
schemadoc gen --in ./my.schema.json
# Renders all json schema files in `./schemas` to `./docs`.
schemadoc gen --in ./schemas --out ./docs
To see schemadoc in action, check out Generator.md which is rendered from stamp.schema.json at build time.
Schemadoc ships with a built in template for rendering markdown. To customize (or render something other than markdown) you can supply your own Go text/template file:
schemadoc gen --in ./schemas --out ./dest --template path/to/my-xml-template.tpl --outfile "{{ .EntityName }}.xml"
Each top-level JSON schema in ./schemas
will be parsed into a
Schema struct and passed into
my-xml-template.tpl
.
The rendered files will be written to ./dest/$SchemaName.xml
.
git clone git@github.com:twelvelabs/schemadoc.git
cd schemadoc
# Ensures all required dependencies are installed
# and bootstraps the project for local development.
make setup
make build
make test
make install
# Show help.
make