Skip to content

feat(docs): D-19 Add Contract Documentation Generator#442

Open
damiedee96 wants to merge 1 commit into
Nanle-code:masterfrom
damiedee96:feat/D-19-contract-doc-generator
Open

feat(docs): D-19 Add Contract Documentation Generator#442
damiedee96 wants to merge 1 commit into
Nanle-code:masterfrom
damiedee96:feat/D-19-contract-doc-generator

Conversation

@damiedee96

Copy link
Copy Markdown

Closes #356
Implements the full contract documentation generator pipeline as described in issue #356 (D-19).

New modules:

  • src/utils/doc_extractor.rs - Extracts doc comments (///, //!) and
    code examples from .rs source files
  • src/utils/doc_templates.rs - Template system (HtmlFull, HtmlCard,
    MarkdownFull, MarkdownSummary, Custom)
    with {{placeholder}} rendering
  • src/utils/doc_html.rs - HTML site generator; produces per-contract
    pages and a searchable portal index
  • src/utils/doc_api_ref.rs - Machine-readable API reference builder;
    emits JSON + GitHub-flavoured Markdown
  • src/utils/doc_publisher.rs - Publish pipeline supporting Local, GitHub
    Pages, and custom HTTP targets with a
    persistent publish log

Updated:

  • src/utils/mod.rs - Registers the five new utility modules
  • src/commands/docs.rs - Expands 'starforge docs' with new subcommands:
    extract, html, api-ref, publish

New CLI subcommands:
starforge docs extract Extract doc comments from source
starforge docs html Generate HTML documentation site
starforge docs api-ref Generate JSON + Markdown API ref
starforge docs publish Full build + publish pipeline

Existing subcommands retained:
generate, show, list, search, versions, export

All new modules include unit tests.

Closes #356

Description

Brief description of what this PR does and why.

Closes #(issue number)

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Changes Made

  • Change 1
  • Change 2
  • Change 3

Testing

How has this been tested?

Describe the tests you ran and how to reproduce them.

  • Unit tests added/updated
  • Integration tests added/updated
  • Manual testing performed

Test Coverage

Describe what scenarios have been tested:

  • Happy path:
  • Edge cases:
  • Error handling:

Code Quality Checklist

  • My code follows the style guidelines of this project (cargo fmt)
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings (cargo clippy -- -D warnings)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • The CI checks pass (format, clippy, tests)

Breaking Changes

  • This PR introduces breaking changes

If checked, describe the breaking changes and migration path:

Documentation

  • README.md updated
  • DEVELOPER_GUIDE.md updated (if applicable)
  • API_REFERENCE.md updated (if applicable)
  • No documentation changes needed

Screenshots (if applicable)

Add screenshots or GIFs for UI changes.

Additional Context

Add any other context about the PR here.


Note: Make sure all tests pass locally before submitting:

cargo test
cargo fmt --all
cargo clippy -- -D warnings

Implements the full contract documentation generator pipeline as
described in issue Nanle-code#356 (D-19).

New modules:
- src/utils/doc_extractor.rs   - Extracts doc comments (///, //!) and
                                  code examples from .rs source files
- src/utils/doc_templates.rs   - Template system (HtmlFull, HtmlCard,
                                  MarkdownFull, MarkdownSummary, Custom)
                                  with {{placeholder}} rendering
- src/utils/doc_html.rs        - HTML site generator; produces per-contract
                                  pages and a searchable portal index
- src/utils/doc_api_ref.rs     - Machine-readable API reference builder;
                                  emits JSON + GitHub-flavoured Markdown
- src/utils/doc_publisher.rs   - Publish pipeline supporting Local, GitHub
                                  Pages, and custom HTTP targets with a
                                  persistent publish log

Updated:
- src/utils/mod.rs             - Registers the five new utility modules
- src/commands/docs.rs         - Expands 'starforge docs' with new subcommands:
                                  extract, html, api-ref, publish

New CLI subcommands:
  starforge docs extract <path>         Extract doc comments from source
  starforge docs html <contract>        Generate HTML documentation site
  starforge docs api-ref <contract>     Generate JSON + Markdown API ref
  starforge docs publish <contract>     Full build + publish pipeline

Existing subcommands retained:
  generate, show, list, search, versions, export

All new modules include unit tests.

Closes Nanle-code#356
@drips-wave

drips-wave Bot commented Jun 30, 2026

Copy link
Copy Markdown

@damiedee96 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

D-19: Add Contract Documentation Generator

1 participant