From 958093be1f190a30d95d8b85360d1fe74172bfc5 Mon Sep 17 00:00:00 2001 From: Benjamin DENEUX Date: Tue, 18 Oct 2022 15:53:37 +0200 Subject: [PATCH] feat(docs): mulitple schema generation --- Makefile.toml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile.toml b/Makefile.toml index c85bdab1..aa92eb39 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -98,6 +98,7 @@ cosmwasm-check ./target/wasm32-unknown-unknown/release/*.wasm dependencies = ["schema"] script = ''' DOCS_FOLDER=docs +SCHEMA_FOLDER=schema echo "🔎 Checking jsonschema2md installed..." if ! command -v jsonschema2md &> /dev/null then @@ -107,9 +108,15 @@ then exit fi +mkdir -p $SCHEMA_FOLDER +find contracts -type f -name '*.json' \ + -exec sh -c 'cp "$@" "$0"' $SCHEMA_FOLDER/ {} + + 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" + +rm -rf $SCHEMA_FOLDER ''' [config]