From 8682e648454d7f1605c90d109c07cbece0fb30ec Mon Sep 17 00:00:00 2001 From: Michalina Date: Wed, 28 Jun 2023 16:11:20 +0200 Subject: [PATCH] Split contracts API doc into multiple files Having all the contracts documented in one common file turned out to be hard to render by the GitBook. We're switching to documenting each contract file in a separate Markdown file. As the generated files will be much smaller now and GitBook has its own file `ON THIS PAGE` section, we don't need to generate Table of Contents. The one thing that we also change as part of this PR is `rsyncDelete` setting - we'll have it set to `true`, in order to delete documentation of contracts which get removed from the repo. As we're not working directly on a `main` branch, this isn't dangerous (we'll see all the delitions in the PR diff). --- .github/workflows/contracts-docs.yml | 3 +++ solidity/hardhat.config.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/contracts-docs.yml b/.github/workflows/contracts-docs.yml index 162e54cc9..6a713b8dd 100644 --- a/.github/workflows/contracts-docs.yml +++ b/.github/workflows/contracts-docs.yml @@ -50,6 +50,7 @@ jobs: # newline and does this in a loop. preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol publish: false + addTOC: false commentPR: true exportAsGHArtifacts: true @@ -74,12 +75,14 @@ jobs: # newline and does this in a loop. preProcessingCommand: sed -i ':a;N;$!ba;s_///\n//\n_///\n_g' ./contracts/bridge/BitcoinTx.sol publish: true + addTOC: false verifyCommits: true destinationRepo: threshold-network/threshold destinationFolder: ./docs/app-development/tbtc-v2/tbtc-v2-api destinationBaseBranch: main userEmail: 38324465+thesis-valkyrie@users.noreply.github.com userName: Valkyrie + rsyncDelete: true secrets: githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }} gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }} diff --git a/solidity/hardhat.config.ts b/solidity/hardhat.config.ts index 09206d9bc..1cb7b16a1 100644 --- a/solidity/hardhat.config.ts +++ b/solidity/hardhat.config.ts @@ -261,7 +261,7 @@ const config: HardhatUserConfig = { docgen: { outputDir: "generated-docs", templates: "docgen-templates", - pages: "single", // `single`, `items` or `files` + pages: "files", // `single`, `items` or `files` exclude: ["./test"], }, }