{"id":21221768,"url":"https://github.com/primitivefinance/primitive-dodoc","last_synced_at":"2025-04-06T20:13:09.870Z","repository":{"id":40279588,"uuid":"420186825","full_name":"primitivefinance/primitive-dodoc","owner":"primitivefinance","description":"☄️ Zero-config Hardhat plugin to generate documentation for all your Solidity contracts.","archived":false,"fork":false,"pushed_at":"2023-08-16T15:14:23.000Z","size":207,"stargazers_count":134,"open_issues_count":12,"forks_count":16,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-03-30T19:07:47.959Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primitivefinance.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-10-22T17:28:42.000Z","updated_at":"2025-03-09T14:01:25.000Z","dependencies_parsed_at":"2024-06-18T13:50:37.172Z","dependency_job_id":"cbc9ad08-11db-464a-a4fd-84e369b684ee","html_url":"https://github.com/primitivefinance/primitive-dodoc","commit_stats":{"total_commits":57,"total_committers":4,"mean_commits":14.25,"dds":"0.10526315789473684","last_synced_commit":"0db153e7d3159dcb3b7fd870b2dca78f6375f456"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fprimitive-dodoc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fprimitive-dodoc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fprimitive-dodoc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fprimitive-dodoc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primitivefinance","download_url":"https://codeload.github.com/primitivefinance/primitive-dodoc/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247543593,"owners_count":20955865,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-20T22:33:20.139Z","updated_at":"2025-04-06T20:13:09.842Z","avatar_url":"https://github.com/primitivefinance.png","language":"TypeScript","funding_links":[],"categories":["TypeScript"],"sub_categories":[],"readme":"# Dodoc\n\n![version](https://img.shields.io/npm/v/@primitivefi/hardhat-dodoc) ![npm](https://img.shields.io/npm/dt/@primitivefi/hardhat-dodoc) ![license](https://img.shields.io/npm/l/@primitivefi/hardhat-dodoc)\n\nZero-config Hardhat plugin to generate documentation for all your Solidity contracts.\n\n- 🤪 Zero-configuration required\n- ✅ Compatible with latest Solidity versions (\u003e= 0.8.0)\n- 🔍 Supports events, errors and external / public functions\n- 📖 Default output to Markdown\n- 🔧 Extendable using custom templates\n\nWant to see a live example? Check out [Primitive documentation](https://docs.primitive.finance/)!\n\n## 📦 Installation\n\nFirst thing to do is to install the plugin in your Hardhat project:\n\n```bash\n# Using yarn\nyarn add @primitivefi/hardhat-dodoc\n\n# Or using npm\nnpm i @primitivefi/hardhat-dodoc\n```\n\nNext step is simply to include the plugin into your `hardhat.config.js` or `hardhat.config.ts` file:\n\n```typescript\n// Using JavaScript\nrequire('@primitivefi/hardhat-dodoc');\n\n// Using ES6 or TypeScript\nimport '@primitivefi/hardhat-dodoc';\n```\n\nAnd you're done! Documentation will be automatically generated on the next compilation and saved into the `docs` folder at the root of your project.\n\n## 📝 Usage\n\nThe only requirement to use Dodoc is to comment your Solidity contracts using [NatSpec](https://docs.soliditylang.org/en/v0.8.9/natspec-format.html) format. For example, given the following function:\n\n```solidity\n/// @notice Does another thing when the function is called.\n/// @dev More info about doing another thing when the function is called.\n/// @param num A random number\n/// @return A random variable\nfunction anotherThing(uint256 num) external pure returns (uint256);\n```\n\nDodoc will take care of everything and will generate the following output:\n\n\u003e ## Methods\n\u003e\n\u003e ### anotherThing\n\u003e\n\u003e ```solidity\n\u003e function anotherThing(uint256 num) external pure returns (uint256)\n\u003e ```\n\u003e\n\u003e Does another thing when the function is called.\n\u003e\n\u003e *More info about doing another thing when the function is called.*\n\u003e\n\u003e #### Parameters\n\u003e\n\u003e | Name | Type | Description |\n\u003e |---|---|---|\n\u003e | num | uint256 | A random number |\n\u003e\n\u003e #### Returns\n\u003e\n\u003e | Name | Type | Description |\n\u003e |---|---|---|\n\u003e | _0 | uint256 | A random variable |\n\nDodoc is compatible with all the NatSpec tags (except custom ones for now), and can generate documentation for events, custom errors and external / public functions.\n\nBy default Dodoc generates new documentation after each compilation, but you can also trigger the task with the following command:\n\n```bash\n# Using yarn\nyarn hardhat dodoc\n\n# Or using npx\nnpx hardhat dodoc\n```\n\n## 🔧 Config\n\nDodoc comes with a default configuration but you can still tweak some parameters. To do it, change your Hardhat config file like this:\n\n```typescript\nimport { HardhatUserConfig } from 'hardhat/config';\nimport '@nomiclabs/hardhat-waffle';\nimport '@nomiclabs/hardhat-ethers';\nimport '@primitivefi/hardhat-dodoc';\n\nconst config: HardhatUserConfig = {\n  // Your Hardhat config...\n  dodoc: {\n    runOnCompile: true,\n    debugMode: true,\n    // More options...\n  },\n};\n\nexport default config;\n```\n\nHere are all the configuration parameters that are currently available, but as said above, all of them are entirely optional:\n\n| Parameter           | Description                                                                                                                                                | Default value     |\n|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------|\n| `runOnCompile`      | True if the plugin should generate the documentation on every compilation                                                                                  | `true`            |\n| `include`           | List of all the contract / interface / library / folder names to include in the documentation generation. An empty array will generate documentation for everything | `[]`              |\n| `exclude`           | List of all the contract / interface / library / folder names to exclude from the documentation generation                                                          | `[]`              |\n| `outputDir`         | Output directory of the documentation                                                                                                                      | `docs`            |\n| `templatePath`      | Path to the documentation template                                                                                                                         | `./template.sqrl` |\n| `debugMode`          | Test mode generating additional JSON files used for debugging                                                                                              | `false`           |\n| `keepFileStructure` | True if you want to preserve your contracts file structure in the output directory                                                                                                 | `true`            |\n| `freshOutput` | True if you want to clean the output directory before generating new documentation | `true` |\n\n## 💅 Customize\n\nDodoc integrates a super cool template engine called [SquirrellyJS](https://github.com/squirrellyjs/squirrelly), allowing anyone to create new output formats easily.\n\nYou can checkout the [default Markdown template](https://) to get some inspiration, as well as [SquirrellyJS documentation](https://squirrelly.js.org/docs) to learn more about it. Feel free to be creative, any kind of output such as Markdown, MDX, HTML or even JSON is supported!\n\nOnce you're satisfied, simply refer to your template using the `templatePath` parameter in your configuration and Dodoc will use it to output the documentation!\n\n## ⛑ Help\n\nFeel free to open an issue if you need help or if you encounter a problem! Here are some already known problems though:\n- Due to the technical limitations of the Solidity compiler, the documentation of `private` and `internal` functions is not rendered. Hence, the documentation of libraries might be close to empty!\n- Functions that are not commented at all might not be rendered.\n- State variables overriding functions defined by an interface might \"erase\" the name of the parameters. A current workaround is to name the function parameters using the `_0`, `_1`, ... format.\n- Special functions such as `constructor`, `fallback` and `receive` might not be rendered.\n- Custom NatSpec tags `@custom:...` are not rendered (yet).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fprimitive-dodoc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimitivefinance%2Fprimitive-dodoc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fprimitive-dodoc/lists"}