Overview
This release enhances the Gutarik documentation generator with structured HTTP route parsing, improved class rendering, and safer AST-based decorator analysis.
The generator now produces cleaner, more readable Markdown output for modern Python web frameworks.
What's New
Structured HTTP Route Extraction
-
AST-based parsing of HTTP decorators (e.g.,
@get,@post, etc.). -
Extracts:
- HTTP method
- Route path
- Summary
- Description
- Tags
- Status code (defaults to
200if not provided)
-
Ignores heavy nested arguments like
responses,examples, anddependenciesto keep documentation clean. -
Renders route metadata in a structured Markdown format instead of raw decorator strings.
Example output:
#### Route:
- Decorator: @post
- Path: `/logout`
- Summary: Logout user
- Description: Endpoint for user logout.
- Tags: Authentication
- Status Code: 200
Improved Class Rendering
-
Extracts and renders the top section of a class:
- Class decorators
- Signature
- Annotated attributes
-
Stops before the first method definition.
-
Displays the extracted fragment inside a dedicated Python code block.
-
Preserves formatting using AST line boundaries (no fragile string slicing).
Decorator Handling Refactor
- Replaced string-based decorator parsing with AST-based analysis.
- Removed truncation logic that caused decorator output to be cut off.
- Eliminated regex-dependent formatting issues.
- Ensures stable behavior for multi-line decorators.
Markdown Formatting Improvements
- Better separation of routes, arguments, and code blocks.
- Improved escaping logic.
- Cleaner layout for class and method sections.
Technical Improvements
- Safer AST traversal with proper scope handling.
- Fixed
UnboundLocalErrorrelated to decorator metadata extraction. - Improved internal data structure for storing route metadata.
- Cleaner separation between extraction and rendering stages.
Installation
poetry add gutarikUsage
Generate documentation:
poetry run gutarikPush to GitHub Wiki:
poetry run gutarik --pushNotes
- Focus remains on Python projects with Google-style docstrings.
- Route parsing is optimized for modern decorator-based frameworks.
- Complex decorator arguments are intentionally omitted from rendered route metadata for clarity.