smartcontractkit / chainlink-local

The Chainlink CCIP Local Simulator, visit documentation by clicking the link below:
https://docs.chain.link/chainlink-local
MIT License
44 stars 14 forks source link

Automated API Reference Generation and Index File Creation #14

Closed aelmanaa closed 1 month ago

aelmanaa commented 2 months ago

This PR introduces a fully automated process for generating API reference documentation for both JavaScript and Solidity files, with a focus on compatibility with MDX formatting. The key changes include:

  1. Compilation of Hardhat and Forge Projects:

    • Ensures both Hardhat and Forge projects are compiled before generating documentation.
  2. API Documentation Generation:

    • Uses Hardhat's solidity-docgen to generate Markdown (.mdx) documentation files for the Solidity contracts.
    • Uses jsdoc-to-markdown to generate Markdown (.mdx) documentation files for the JavaScript files.
  3. Automated Index File Creation:

    • Introduces a TypeScript script (generate-index-files.ts) that creates index.mdx files with appropriate headers and bullet points for each directory and its contents.
  4. Prettier Formatting:

    • Ensures all generated documentation files are formatted consistently using Prettier.