Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

contracts: Add solidity API reference #187

Merged
merged 1 commit into from
Sep 25, 2023
Merged

Conversation

matevz
Copy link
Member

@matevz matevz commented Sep 15, 2023

Adds Solidity API reference using forge doc --build to generate the markdowns and final HTMLs.

Depends on #186.

Preview

@CedarMist CedarMist added p:2 Priority: nice to have dependencies Pull requests that update a dependency file contracts Pull requests that update sapphire-contracts labels Sep 17, 2023
@CedarMist
Copy link
Member

To reduce the size of the documentation many of the 'internal' items can be safely made 'private' without changing the consumable API.

I tried the multi-page files setting, but everything was titled 'Solidity API' and I'm unable to group it into modules and the title is hard-coded in their template. We could make our own modified template groups things into modules.

I found another documentation generator called Dodoc which has a better structure, e.g.: https://library.primitive.xyz/technical/smart-contracts/autogenerated-docs/manager/base/CashManager

I suggest removing tests from the docs:

diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts
index 6bc37c2..94bb7c3 100644
--- a/contracts/hardhat.config.ts
+++ b/contracts/hardhat.config.ts
@@ -105,6 +105,14 @@ const config: HardhatUserConfig = {
   },
   docgen: {
     pages: 'single',
+    exclude: [
+      'tests/SigningTests.sol',
+      'tests/SubcallTests.sol',
+      'tests/SignedQueriesTests.sol',
+      'tests/EIP155Tests.sol',
+      'tests/HashTests.sol',
+      'OPL.sol'
+    ]
   },
 };

@matevz matevz changed the title contracts: Add solidity-docgen contracts: Add solidity API reference Sep 21, 2023
@matevz matevz force-pushed the matevz/feature/solidity-docgen branch 15 times, most recently from d23eb8a to 40afd0b Compare September 21, 2023 15:52
@matevz matevz changed the base branch from main to matevz/feature/typedoc September 21, 2023 15:52
@matevz matevz force-pushed the matevz/feature/solidity-docgen branch 4 times, most recently from c1d7cdb to 9cd36be Compare September 22, 2023 12:49
@matevz
Copy link
Member Author

matevz commented Sep 22, 2023

To reduce the size of the documentation many of the 'internal' items can be safely made 'private' without changing the consumable API.

I tried the multi-page files setting, but everything was titled 'Solidity API' and I'm unable to group it into modules and the title is hard-coded in their template. We could make our own modified template groups things into modules.

I found another documentation generator called Dodoc which has a better structure, e.g.: https://library.primitive.xyz/technical/smart-contracts/autogenerated-docs/manager/base/CashManager

I suggest removing tests from the docs:

diff --git a/contracts/hardhat.config.ts b/contracts/hardhat.config.ts
index 6bc37c2..94bb7c3 100644
--- a/contracts/hardhat.config.ts
+++ b/contracts/hardhat.config.ts
@@ -105,6 +105,14 @@ const config: HardhatUserConfig = {
   },
   docgen: {
     pages: 'single',
+    exclude: [
+      'tests/SigningTests.sol',
+      'tests/SubcallTests.sol',
+      'tests/SignedQueriesTests.sol',
+      'tests/EIP155Tests.sol',
+      'tests/HashTests.sol',
+      'OPL.sol'
+    ]
   },
 };

Is there a reason to ignore OPL.sol?

@matevz matevz changed the base branch from matevz/feature/typedoc to main September 22, 2023 12:53
@matevz matevz force-pushed the matevz/feature/solidity-docgen branch 2 times, most recently from a4ad732 to a6ac267 Compare September 22, 2023 12:59
@matevz matevz force-pushed the matevz/feature/solidity-docgen branch 5 times, most recently from fa0d3c6 to dc6685f Compare September 22, 2023 15:03
@nhynes
Copy link
Contributor

nhynes commented Sep 22, 2023

@matevz matevz force-pushed the matevz/feature/solidity-docgen branch 2 times, most recently from 26d18d2 to 6c1d4cd Compare September 25, 2023 09:45
@matevz matevz force-pushed the matevz/feature/solidity-docgen branch from 6c1d4cd to 2204d5e Compare September 25, 2023 09:46
@matevz matevz merged commit bc27209 into main Sep 25, 2023
16 checks passed
@matevz matevz deleted the matevz/feature/solidity-docgen branch September 25, 2023 09:51
github-actions bot added a commit that referenced this pull request Sep 25, 2023
…atevz/feature/solidity-docgen

contracts: Add solidity API reference bc27209
github-actions bot added a commit that referenced this pull request Sep 25, 2023
…tevz/feature/solidity-docgen

contracts: Add solidity API reference bc27209
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contracts Pull requests that update sapphire-contracts dependencies Pull requests that update a dependency file p:2 Priority: nice to have
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants