Skip to content

Commit

Permalink
feat(docs): generate documentation with jsonschema2md
Browse files Browse the repository at this point in the history
  • Loading branch information
bdeneux committed Oct 19, 2022
1 parent 5a6a54f commit 5b165e3
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions Makefile.toml
Original file line number Diff line number Diff line change
Expand Up @@ -94,5 +94,23 @@ script = '''
cosmwasm-check ./target/wasm32-unknown-unknown/release/*.wasm
'''

[tasks.generate_docs]
dependencies = ["schema"]
script = '''
DOCS_FOLDER=docs
echo "🔎 Checking jsonschema2md installed..."
if ! command -v jsonschema2md &> /dev/null
then
echo "\n❌ jsonschema2md could not be found"
echo " Consider installing jsonschema2md to generate documentation.\n"
echo "> \`npm install -g @adobe/jsonschema2md\`\n\n"
exit
fi
echo "📚 Generating documentation..."
jsonschema2md -d schema -o $DOCS_FOLDER --schema-extension json --schema-out $DOCS_FOLDER/schema
echo "📖 Documentation has been successfully generated and available at $(pwd)/$DOCS_FOLDER/README.md"
'''

[config]
default_to_workspace = false

0 comments on commit 5b165e3

Please sign in to comment.