A modern markdown-to-HTML converter designed for research blog posts with support for tables, code references, and beautiful styling.
- Clean HTML Output: Semantic HTML with responsive CSS styling
- Table Support: Full markdown table rendering with clean styling
- Code References: Include code snippets from files using simple syntax
- Syntax Highlighting: Pygments integration for code blocks
- Table of Contents: Auto-generated TOC for document navigation
- Frontmatter Support: YAML metadata in markdown files
- Extensible: Built with Marko parser for easy customization
pip install babblbabbl render document.mdbabbl build ./docs --output-dir ./publicbabbl render document.md --css custom.css --tocfrom babbl import BabblParser, HTMLRenderer
parser = BabblParser()
renderer = HTMLRenderer()
with open("document.md", "r") as f:
content = f.read()
document = parser.parse(content)
html = renderer.html(document, metadata={})Reference code from files using simple syntax:
#function_name
[Description](path/to/file.py#function_name)
[Line 15](path/to/file.py#L15)
[Lines 10-20](path/to/file.py#L10-L20)Standard markdown table syntax:
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |YAML metadata at the beginning of files:
---
title: "My Document"
author: "Author Name"
date: "2024-01-01"
---
# Content starts hereRender a single markdown file to HTML.
Options:
--output, -o: Output file path--css: Custom CSS file--toc: Generate table of contents--base-path: Base path for code references
Build multiple markdown files in a directory.
Options:
--output-dir, -o: Output directory--pattern: File pattern (default:*.md)--recursive, -r: Process subdirectories--css: Custom CSS file--toc: Generate table of contents--base-path: Base path for code references
MIT License
