mirror of
https://github.com/PacFactory/Docs-Exporter-Astro.git
synced 2025-12-20 02:31:04 -05:00
v1.0.0
Astro Documentation PDF Generator
A Python script to generate a PDF from Astro's documentation. Forked from Docs-Exporter and modified to work with Astro's documentation format.
Overview
This script:
- Clones the Astro documentation repository
- Processes Markdown/MDX files
- Generates a PDF with:
- Cover page
- Table of contents
- Formatted content
- Headers and footers
- Code syntax highlighting
- Proper page breaks
Requirements
System Requirements
- Python 3.7+
- Git installed and accessible from command line
- Internet connection for cloning repositories
Python Dependencies
pip install gitpython markdown packaging playwright pyyaml tqdm
playwright install chromium
Usage
- Clone this repository:
git clone https://github.com/PacFactory/Docs-Exporter-Astro
cd Docs-Exporter-Astro
- Install dependencies:
pip install -r requirements.txt
playwright install chromium
- Run the script:
python astro_docs_to_pdf.py
The script will:
- Create a default styles.css if none exists
- Clone the Astro documentation
- Process all documentation files
- Generate a PDF with table of contents
Output
The script generates:
- A PDF file named
Astro_Documentation_YYYY-MM-DD.pdf - Default styling for documentation content
- Hierarchical table of contents
- Page numbers and generation date
Features
- Automatic table of contents generation
- Code block syntax highlighting
- Image processing
- Proper handling of Astro's MDX format
- Frontmatter parsing
- Clean page breaks
- Responsive design
- Error handling and reporting
Modifications from Original
This fork includes several modifications from the original Docs-Exporter:
- Updated to use Playwright instead of wkhtmltopdf
- Added support for Astro's specific MDX format
- Enhanced frontmatter parsing
- Improved error handling
- Automatic CSS generation
- Better image handling
Credits
- Original project: Docs-Exporter by Riyooo
- Modified for Astro documentation format
License
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
Languages
Python
100%