Automated Documentation Project Generator - Create beautiful MkDocs documentation projects with ease
Project description
DocuFlow
Automated Documentation Project Generator - Create beautiful MkDocs documentation projects with PDF export and version management
DocuFlow is a powerful CLI tool that automates the creation of professional documentation projects using MkDocs and the Material theme. It handles everything from project setup to Git repository creation, CI/CD configuration, PDF generation, and versioned documentation deployment.
โจ Features
Core Features
- ๐ Quick Project Setup - Generate complete documentation projects in seconds
- ๐จ Beautiful Templates - Pre-configured MkDocs Material themes
- ๐ง Git Integration - Automatic GitHub/GitLab repository creation
- ๐ฆ CI/CD Ready - GitHub Actions and GitLab CI configurations included
- ๐ฏ Multiple Templates - Choose from basic or full-featured setups
- ๐ Secure Authentication - Token management with keyring integration
- ๐ฑ Rich CLI - Beautiful terminal interface with progress indicators
PDF Generation
- ๐ PDF Export - Generate professional PDFs from your markdown documentation
- ๐ Version History - Automatically include git tag history in PDFs
- ๐ Table of Contents - Clickable TOC with customizable depth
- ๐ผ๏ธ Image Embedding - Base64 image encoding for standalone PDFs
- ๐ Mermaid Diagrams - Optional diagram rendering to images
- ๐ฆ Multi-Section PDFs - Generate different PDFs from different doc sections
- ๐ Release Packages - Create ZIP files with PDFs and additional files
Version Management
- ๐ท๏ธ Versioned Docs - Full integration with mike for versioned documentation
- ๐ Git Tag Sync - Automatic alignment between git tags and documentation versions
- ๐ Version Aliases - Support for "latest", "stable", and custom aliases
- ๐ Version Selector - Automatic version picker in your documentation site
- ๐ Automated Deployment - CI/CD workflows handle versioned deployments automatically
๐ Quick Start
Installation
# Install with pip
pip install mkdocs-flow
# Or with Poetry
poetry add mkdocs-flow
# Install with PDF generation support
pip install "mkdocs-flow[diagrams]" # Includes Mermaid diagram rendering
System Requirements for PDF Generation:
Ubuntu/Debian:
sudo apt-get install -y libpango-1.0-0 libpangocairo-1.0-0 libgdk-pixbuf2.0-0 libffi-dev libcairo2
macOS:
brew install cairo pango gdk-pixbuf libffi
Basic Usage
# Initialize a new documentation project
docuflow init my-awesome-docs
# Navigate to your project
cd my-awesome-docs
# Serve documentation locally
docuflow serve
# Build documentation
docuflow build
# Create a versioned release
docuflow version-create --version 1.0 --alias latest
# Generate PDFs
docuflow generate-pdf
# Deploy to GitHub/GitLab Pages (with versioning)
git push origin main
git tag 1.0.0
git push origin 1.0.0 # Triggers automatic versioned deployment
๐ Documentation
Commands
docuflow init [PROJECT_NAME]
Initialize a new documentation project with interactive setup.
Options:
--name TEXT- Project name--description TEXT- Project description--author TEXT- Author name--email TEXT- Author email--git-provider [github|gitlab]- Git provider--private- Create private repository--template [basic|full]- Project template--no-remote- Skip remote repository creation--config-file PATH- Configuration file
Example:
docuflow init my-project \
--description "My awesome project documentation" \
--author "John Doe" \
--email "john@example.com" \
--template full \
--private
docuflow serve [PROJECT_PATH]
Serve documentation locally for development.
Example:
docuflow serve ./my-project
docuflow build [PROJECT_PATH]
Build documentation site.
Options:
--clean- Clean build directory before building
Example:
docuflow build --clean
docuflow deploy [PROJECT_PATH]
Deploy documentation to GitHub/GitLab Pages.
Options:
--force- Force deployment without confirmation
Example:
docuflow deploy --force
docuflow config
Manage DocuFlow configuration and authentication tokens.
docuflow templates
List available project templates.
docuflow version-create
Create a new documentation version with mike and git tag.
Options:
--version, -v TEXT- Version number (e.g., 1.0, 1.0.0)--title TEXT- Version title--alias, -a TEXT- Version aliases (can be used multiple times)--no-tag- Do not create git tag--message, -m TEXT- Git tag message
Example:
# Create version 1.0 with "latest" alias
docuflow version-create --version 1.0 --alias latest
# Create version with custom title and multiple aliases
docuflow version-create \
--version 2.0 \
--title "Version 2.0 - Major Release" \
--alias latest \
--alias stable
# Interactive mode
docuflow version-create
docuflow version-list
List all versions and check alignment between git tags and mike versions.
Example:
docuflow version-list
Shows a table with:
- โ Aligned versions (both git tag and mike version exist)
- โ Git-only tags (no corresponding mike version)
- โ Mike-only versions (no corresponding git tag)
docuflow generate-pdf
Generate PDF documentation from markdown files.
Arguments:
SECTIONS- Section names to generate (optional, defaults to all)
Options:
--tag, -t TEXT- Git tag/version to use--output-dir PATH- Output directory (default: pdfs)
Examples:
# Generate all configured PDFs
docuflow generate-pdf
# Generate specific sections
docuflow generate-pdf user-guide api-reference
# Generate for a specific version
docuflow generate-pdf --tag 1.0.0
# Custom output directory
docuflow generate-pdf --output-dir releases/v1.0
Generated projects also include a standalone generate_pdf.py script:
# In your project directory
poetry run python generate_pdf.py --tag 1.0
Templates
Basic Template
- Minimal setup with essential pages and plugins
- Plugins: search, awesome-pages, mermaid2
- Perfect for simple documentation needs
Full Template
- Comprehensive structure with all features enabled
- Plugins: search, awesome-pages, mermaid2, git-revision-date-localized, minify
- Advanced features and optimizations included
Configuration
DocuFlow stores configuration in ~/.docuflow/config.yml. You can customize:
- Default git provider (GitHub/GitLab)
- Default theme and template
- Repository visibility preferences
- Plugin configurations
Authentication
DocuFlow supports secure token storage using keyring:
# Configure tokens interactively
docuflow config
# Or set environment variables
export GITHUB_TOKEN="your_github_token"
export GITLAB_TOKEN="your_gitlab_token"
PDF Configuration
Generated projects include a pdf_config.yml file for customizing PDF generation:
# PDF Export Configuration
sections:
- name: user-guide
title: "User Guide"
output: "user-guide.pdf"
docs_dir: "docs/sections/user-guide"
- name: api-reference
title: "API Reference"
output: "api-reference.pdf"
docs_dir: "docs/sections/api-reference"
- name: full-documentation
title: "Complete Documentation"
output: "documentation.pdf"
docs_dir: "docs"
# Version history settings
include_version_history: true
# Table of contents settings
include_toc: true
toc_depth: 3
# Image handling
embed_images: true
# Mermaid diagram rendering (requires playwright)
render_mermaid: false
# Release packaging
create_release_zip: false
release_includes:
- "*.g4"
- "*.ebnf"
Version Management with Mike
Generated projects automatically include mike configuration in mkdocs.yml:
extra:
version:
provider: mike
The GitHub Actions workflow is pre-configured to:
- Deploy versioned documentation on tag pushes
- Update the "latest" alias automatically
- Maintain version history with a version selector
Workflow:
- Develop documentation on the
mainbranch - Create a version:
docuflow version-create --version 1.0 --alias latest - Push changes and tags:
git push && git push --tags - GitHub Actions automatically deploys the versioned documentation
- Users can select versions from the documentation site
๐ ๏ธ Development
Setup Development Environment
# Clone the repository
git clone https://github.com/yourusername/docuflow.git
cd docuflow
# Install dependencies
poetry install
# Install pre-commit hooks
pre-commit install
# Run tests
poetry run pytest
# Run linting
poetry run black src tests
poetry run isort src tests
poetry run flake8 src tests
poetry run mypy src
Project Structure
docuflow/
โโโ src/docuflow/ # Source code
โ โโโ __init__.py
โ โโโ cli.py # CLI interface
โ โโโ config.py # Configuration management
โ โโโ git_manager.py # Git operations
โ โโโ models.py # Data models (including PDF config)
โ โโโ project_manager.py # Project orchestration
โ โโโ template.py # Template generation
โ โโโ export_utils.py # Git tag & file utilities
โ โโโ pdf_generator.py # PDF generation engine
โ โโโ version_manager.py # Version management (mike)
โ โโโ mermaid_renderer.py # Mermaid diagram rendering
โ โโโ templates/ # Project templates
โ โโโ export_utils.py.template
โ โโโ generate_pdf.py.template
โ โโโ mermaid_renderer.py.template
โโโ tests/ # Test suite
โ โโโ test_cli.py
โ โโโ test_export_utils.py
โ โโโ test_pdf_generator.py
โ โโโ test_version_manager.py
โ โโโ ...
โโโ docs/ # Documentation
โโโ pyproject.toml # Poetry configuration
โโโ README.md
โโโ IMPLEMENTATION_SUMMARY.md # Implementation details
Generated Project Structure:
When you create a project with DocuFlow, it includes:
my-project/
โโโ docs/ # Documentation source
โโโ mkdocs.yml # MkDocs config (with mike)
โโโ pyproject.toml # Dependencies (includes mike)
โโโ pdf_config.yml # PDF generation config
โโโ export_utils.py # Export utilities
โโโ generate_pdf.py # PDF generation script
โโโ mermaid_renderer.py # Mermaid support
โโโ .github/workflows/
โ โโโ deploy-docs.yml # CI/CD with mike deployment
โโโ scripts/
โโโ build.sh
โโโ serve.sh
Testing
# Run all tests
poetry run pytest
# Run with coverage
poetry run pytest --cov=src/docuflow
# Run specific test file
poetry run pytest tests/test_cli.py
๐ค Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Workflow
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes
- Add tests for your changes
- Run the test suite (
poetry run pytest) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
๐ License
This project is licensed under the MIT License - see the LICENSE file for details.
๐ Acknowledgments
Core Technologies
- MkDocs - The documentation generator
- Material for MkDocs - The beautiful theme
- Click - The CLI framework
- Rich - Beautiful terminal output
PDF & Versioning
- WeasyPrint - PDF generation from HTML/CSS
- Mike - MkDocs version management
- Pillow - Image processing
- Playwright - Mermaid diagram rendering
Development Tools
๐ Support
- ๐ง Email: antonio.olleros@meaningfuldata.eu
- ๐ Issues: GitHub Issues
- ๐ฌ Discussions: GitHub Discussions
๐ What's New
Version 0.2.0 - PDF & Versioning Support
DocuFlow now includes comprehensive PDF generation and version management capabilities!
New Features:
- โ Generate professional PDFs from markdown with version history
- โ Full mike integration for versioned documentation
- โ Automatic git tag and version alignment
- โ Mermaid diagram rendering in PDFs
- โ Multi-section PDF export
- โ Release packaging with ZIP files
New Commands:
docuflow version-create- Create versioned releasesdocuflow version-list- Check version alignmentdocuflow generate-pdf- Generate PDFs
See IMPLEMENTATION_SUMMARY.md for complete implementation details and the PDF_VERSIONING_MIGRATION_GUIDE.md for the original feature specifications.
Made with โค๏ธ for the open source community
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocs_flow-0.1.0.tar.gz.
File metadata
- Download URL: mkdocs_flow-0.1.0.tar.gz
- Upload date:
- Size: 35.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0814be71bc86534bccb6943474439b8b632d93ccac817e96ecd3ea69a49de75
|
|
| MD5 |
c3a435e6ad71599f365f14915767e03c
|
|
| BLAKE2b-256 |
8e6bff928d88878a66316a1107fb9b360db8bd89cb7a1e9f6dacca2765f449d9
|
File details
Details for the file mkdocs_flow-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_flow-0.1.0-py3-none-any.whl
- Upload date:
- Size: 37.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.12.3 Linux/6.6.87.2-microsoft-standard-WSL2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
61d245077ac505edb193747850823971ba26bbe9ec05cab7f33709364a133bad
|
|
| MD5 |
02f08f667ba95597e995540449bc6bbe
|
|
| BLAKE2b-256 |
ac10a1efb262c8dd9bf68373ba5ec1df60d0600650096681d0016b4ae9a10402
|