Calls reformat.py
and convert_swagger.py
to populate the "reference-docs" structure. Requires two arguments be passed referencing the source code of go-algorand and indexer respectively:
./reformat-all-commands.sh $GO_ALGORAND_SRC $INDEXER_SRC
Reformats markdown generated by the go spf13/cobra library to work with mkdocs.
Given the goal
in the path, regenerate the docs from this directory by running:
rm -rf ../docs/Reference-Docs/goal
mkdir ../docs/Reference-Docs/goal
goal generate-docs ../docs/Reference-Docs/goal
./reformat.py -path ../docs/Reference-Docs/goal -cmd goal
Given a swagger specfile, generates a markdown file.
Currently uses swagger2markup
, with some post processing to make
the markdown more pleasant with our mkdocs theme.
./convert_swagger.py -specfile ~/algorand/indexer/api/indexer.oas2.json -target ../docs/reference/rest-apis/indexer.md
./convert_swagger.py -specfile ~/go/src/github.com/algorand/go-algorand/daemon/kmd/api/swagger.json -target ../docs/reference/rest-apis/kmd.md
./convert_swagger.py -specfile ~/go/src/github.com/algorand/go-algorand/daemon/algod/api/algod.oas2.json -target ../docs/reference/rest-apis/algod.md
Used to extract node config options from the go-algorand source. Markdown is written to stdout, warnings are written to stderr. To update the template, edit template.tmpl and rebuild the tool.
Build tool:
go build .
Run:
./config_json_gen -path ~/algorand/go-algorand/ > config.md