schemadoc

command module
v0.6.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 3 Imported by: 0

README

schemadoc

build codecov

Generate markdown documents from JSON schema files ✨.

Installation

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
    

Usage

# 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.

Customizing

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.

Development

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

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
cmd

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL