MkDocs plugin for rendering Excel files as HTML tables
Project description
mkdocs-excel-plugin
A MkDocs plugin that renders Excel files as beautiful HTML tables with complete style preservation.
✨ Features
- 🎨 Complete Style Preservation: Maintains Excel's background colors, fonts, borders, and alignment
- 📊 Merged Cell Support: Perfect handling of colspan and rowspan
- 🔄 Multi-sheet Processing: Render single sheets or all sheets at once
- ⚡ Smart Caching: Built-in caching for improved performance
- 🎯 Size Control: Configurable row/column limits for large files
- 🌓 Theme Compatibility: Works seamlessly with Material and other MkDocs themes
- 🛡️ Error Handling: Friendly error messages for missing files or sheets
🚀 Installation
pip install mkdocs-excel-plugin
📖 Quick Start
- Add the plugin to your
mkdocs.yml:
plugins:
- excel
- Use Excel macros in your markdown:
<!-- Render a single sheet -->
{{ render_excel_sheet('data.xlsx', 'Sheet1') }}
<!-- Render all sheets -->
{{ render_excel_all_sheets('data.xlsx') }}
<!-- List available sheets -->
{{ list_excel_sheets('data.xlsx') }}
⚙️ Configuration
plugins:
- excel:
cache_enabled: true # Enable smart caching
max_file_size_mb: 5 # Maximum file size
default_max_rows: 1000 # Default row limit
default_max_cols: 50 # Default column limit
theme: "material" # Theme compatibility
📝 Usage Examples
Basic Usage
{{ render_excel_sheet('sales.xlsx', 'Q1 Data') }}
Advanced Usage
<!-- Limit table size -->
{{ render_excel_sheet('large.xlsx', 'Data', max_rows=100, max_cols=20) }}
<!-- Selective rendering -->
{{ render_excel_all_sheets('report.xlsx', include_sheets=['Summary', 'Details']) }}
<!-- Exclude specific sheets -->
{{ render_excel_all_sheets('report.xlsx', exclude_sheets=['Raw Data']) }}
🎯 Supported Features
- ✅ Background colors and gradients
- ✅ Font colors, bold, italic, sizes
- ✅ Text alignment (horizontal/vertical)
- ✅ Border styles and colors
- ✅ Merged cells with proper span
- ✅ Excel theme colors
- ✅ Multiple worksheets
- ✅ Relative file paths
- ✅ Performance warnings
- ✅ Comprehensive error handling
🤝 Contributing
Contributions are welcome! Please read our Contributing Guidelines for details on how to submit pull requests, report issues, and contribute to the project.
📄 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙋♂️ Support
If you encounter any issues or have questions, please file an issue on GitHub.
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_excel_plugin-1.0.0.tar.gz.
File metadata
- Download URL: mkdocs_excel_plugin-1.0.0.tar.gz
- Upload date:
- Size: 22.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
548fd81d77b15c0611836968152670edc134724239214f6ba3b67b695a581367
|
|
| MD5 |
425c2cae1523549de504d446c7513cf9
|
|
| BLAKE2b-256 |
56bcd7332a8613556f318b4585d922bd25902321decf04265fae14e853fae222
|
File details
Details for the file mkdocs_excel_plugin-1.0.0-py3-none-any.whl.
File metadata
- Download URL: mkdocs_excel_plugin-1.0.0-py3-none-any.whl
- Upload date:
- Size: 13.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fa42126a542b1f8b927b2db40ff049c1ff018c21a3a972d051a0f1390982bb89
|
|
| MD5 |
9737408b1adbca482d034c6c49df5713
|
|
| BLAKE2b-256 |
e9045d8184388d870481832b1d8199808d7d4b18ba265e3907ba9320ae24f917
|