Overview
The document generation tool creates structured documents from built-in templates with variable substitution. Templates include report, readme, changelog, meeting_notes, and custom freeform. Supports markdown and HTML output formats.Tool
document_gen
Generate a document from a template with variable substitution.Built-in template name. Options:
report, readme, changelog, meeting_notes, custom.Key-value pairs for template variable substitution. Variables are inserted using
{key} placeholders.Output format:
markdown (default) or html.Optional file path to save the document. If omitted, returns document content.
Built-in Templates
report
Professional report template with executive summary, details, and conclusions. Required variables:title: Report titleauthor: Report authorsummary: Executive summarydetails: Main content/findingsconclusions: Final conclusions or recommendations
date: Report date (auto-generated if omitted)
readme
Project README template with installation, usage, and license sections. Required variables:project_name: Project namedescription: Project descriptioninstall_command: Installation command (e.g.,pip install myproject)usage: Usage instructions or exampleslicense: License type
changelog
Changelog entry template following Keep a Changelog format. Required variables:version: Version number (e.g.,1.2.0)added: New features (markdown list)changed: Changes to existing features (markdown list)fixed: Bug fixes (markdown list)
date: Release date (auto-generated if omitted)
meeting_notes
Meeting notes template with attendees, agenda, discussion, and action items. Required variables:title: Meeting titleattendees: List of attendeesagenda: Meeting agendadiscussion: Discussion summaryaction_items: Action items with owners
date: Meeting date (auto-generated if omitted)
custom
Freeform template with a singlecontent variable.
Required variables:
content: Document content
Variable Substitution
Variables are substituted using{key} placeholders:
date: Current date inYYYY-MM-DDformat (if not provided)
Output Formats
markdown (default)
Returns the document as markdown text. Example:html
Converts markdown to HTML with minimal styling. Includes:- Responsive layout (max-width 800px, centered)
- Syntax highlighting for code blocks
- Basic typography styles
- Headings (
#,##,###) - Bold (
**text**) - Italic (
*text*) - Inline code (
`code`) - Code blocks (
```) - Lists (
-or*)
Return Values
With output_file:Use Cases
- Project documentation: Generate README files for new projects
- Release management: Create changelog entries for version releases
- Reporting: Generate consistent report formats
- Meeting documentation: Standardize meeting notes across teams
- Documentation export: Convert markdown docs to HTML for web publishing
Best Practices
- Use markdown formatting in variables for rich content (lists, bold, code)
- Provide all required variables to avoid placeholder gaps
- Choose HTML output for web publishing or email
- Store templates in version control when extending with custom templates
- Auto-generate dates by omitting the
datevariable
Implementation
Defined ingrip/tools/document_gen.py at document_gen.py:123. Uses:
- String-based template storage with
{key}placeholders - Simple variable substitution with
str.replace() - Minimal markdown-to-HTML conversion (no external dependencies)
- Auto-generated dates with
datetime.now(UTC) - Parent directory creation for output files