Create automated API documentation extraction tool #97

Closed
opened 2025-07-05 19:08:52 +00:00 by john · 1 comment
Owner

Build a tool to extract Python API documentation from C++ source code and generate formatted API reference documentation.
Affects: Documentation infrastructure
Depends on: Create inline C++ documentation system

Build a tool to extract Python API documentation from C++ source code and generate formatted API reference documentation. Affects: Documentation infrastructure Depends on: Create inline C++ documentation system
john added the
Documentation
Major Feature
Demo Target
labels 2025-07-05 19:08:52 +00:00
john added the
Refactoring & Cleanup
system:python-binding
workflow:blocked
labels 2025-10-26 00:44:42 +00:00
john added the
priority:tier1-active
system:documentation
workflow:needs-documentation
labels 2025-10-26 00:49:14 +00:00
Author
Owner

Implementation Complete

The automated API documentation extraction tool is now fully operational.

What Was Delivered

Enhanced Documentation Extraction:

  • tools/generate_dynamic_docs.py enhanced with link transformation support
  • Supports multiple output formats: HTML, Markdown, Python docstrings
  • Link transformation converts MCRF_LINK references based on output format:
    • HTML: <a href="guide.html">Tutorial</a>
    • Web: <a href="https://docs.mcrogueface.com/guide">Tutorial</a>
    • Markdown: [Tutorial](docs/guide.md)
    • Python: See also: Tutorial (docs/guide.md)

Documentation Pipeline:

  1. C++ source with MCRF_* macros → compile
  2. Introspection via Python's dir(), getattr(), __doc__
  3. Transformation: MCRF_LINK patterns detected and converted
  4. Output: docs/api_reference_dynamic.html and docs/API_REFERENCE_DYNAMIC.md

HTML Escaping:

  • Properly escapes user-provided descriptions to prevent HTML injection
  • Link HTML preserved while escaping surrounding text

Verification:

  • Vector class: Complete documentation with 0 "..." placeholders
  • All UI classes: Enhanced property documentation visible
  • Generated docs successfully include transformed links

Dependencies Resolved

Issue #92 (inline C++ documentation system) - COMPLETED

  • The macro system provides the structured documentation that this tool extracts

Integration with Existing Tools

  • Works alongside tools/generate_stubs.py (type stub generation)
  • Replaces 5 obsolete documentation scripts that were deleted
  • Single command regenerates all documentation: ./build/mcrogueface --headless --exec tools/generate_dynamic_docs.py

Future Enhancements

Optional (not required for completion):

  • PDF generation from source (parse C++ directly without compiling)
  • Man page generation with proper formatting
  • Link validation CI (ensure MCRF_LINK targets exist)
  • Auto-generate "Related Methods" sections from link analysis

The core functionality is complete and proven working across Vector, Drawable, and all UI classes.

## Implementation Complete ✅ The automated API documentation extraction tool is now fully operational. ### What Was Delivered **Enhanced Documentation Extraction:** - `tools/generate_dynamic_docs.py` enhanced with link transformation support - Supports multiple output formats: HTML, Markdown, Python docstrings - Link transformation converts MCRF_LINK references based on output format: - HTML: `<a href="guide.html">Tutorial</a>` - Web: `<a href="https://docs.mcrogueface.com/guide">Tutorial</a>` - Markdown: `[Tutorial](docs/guide.md)` - Python: `See also: Tutorial (docs/guide.md)` **Documentation Pipeline:** 1. C++ source with MCRF_* macros → compile 2. Introspection via Python's `dir()`, `getattr()`, `__doc__` 3. Transformation: MCRF_LINK patterns detected and converted 4. Output: `docs/api_reference_dynamic.html` and `docs/API_REFERENCE_DYNAMIC.md` **HTML Escaping:** - Properly escapes user-provided descriptions to prevent HTML injection - Link HTML preserved while escaping surrounding text **Verification:** - Vector class: Complete documentation with 0 "..." placeholders - All UI classes: Enhanced property documentation visible - Generated docs successfully include transformed links ### Dependencies Resolved ✅ Issue #92 (inline C++ documentation system) - **COMPLETED** - The macro system provides the structured documentation that this tool extracts ### Integration with Existing Tools - Works alongside `tools/generate_stubs.py` (type stub generation) - Replaces 5 obsolete documentation scripts that were deleted - Single command regenerates all documentation: `./build/mcrogueface --headless --exec tools/generate_dynamic_docs.py` ### Future Enhancements **Optional (not required for completion):** - PDF generation from source (parse C++ directly without compiling) - Man page generation with proper formatting - Link validation CI (ensure MCRF_LINK targets exist) - Auto-generate "Related Methods" sections from link analysis The core functionality is complete and proven working across Vector, Drawable, and all UI classes.
john closed this issue 2025-10-30 19:46:03 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: john/McRogueFace#97
No description provided.