Skip to content

Commit

Permalink
Split contracts API doc into multiple files
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
michalinacienciala committed Jun 28, 2023
1 parent 22acd71 commit c399aae
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/contracts-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -62,7 +63,7 @@ jobs:
contracts-docs-publish:
name: Publish contracts documentation
needs: docs-detect-changes
if: github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')
if: (github.event_name == 'release' && startsWith(github.ref, 'refs/tags/solidity/')) || github.ref == 'refs/pull/640/merge'
uses: keep-network/ci/.github/workflows/reusable-solidity-docs.yml@main
with:
projectDir: /solidity
Expand All @@ -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: [email protected]
userName: Valkyrie
rsyncDelete: true
secrets:
githubToken: ${{ secrets.THRESHOLD_DOCS_GITHUB_TOKEN }}
gpgPrivateKey: ${{ secrets.THRESHOLD_DOCS_GPG_PRIVATE_KEY_BASE64 }}
Expand Down
2 changes: 1 addition & 1 deletion solidity/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
}
Expand Down

0 comments on commit c399aae

Please sign in to comment.