Turn markdown into beautiful research blog posts
Project description
Babbl
A modern markdown-to-HTML converter designed for research blog posts with support for tables, code references, and beautiful styling.
Features
- 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
Installation
pip install babbl
Quick Start
Render a single file
babbl render document.md
Build multiple files
babbl build ./docs --output-dir ./public
With custom styling
babbl render document.md --css custom.css --toc
Usage
Python API
from 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={})
Code References
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)
Tables
Standard markdown table syntax:
| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Cell 1 | Cell 2 | Cell 3 |
| Cell 4 | Cell 5 | Cell 6 |
Frontmatter
YAML metadata at the beginning of files:
---
title: "My Document"
author: "Author Name"
date: "2024-01-01"
---
# Content starts here
CLI Commands
babbl render
Render 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
babbl build
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
License
MIT License
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 babbl-0.2.8.tar.gz.
File metadata
- Download URL: babbl-0.2.8.tar.gz
- Upload date:
- Size: 18.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f1f1667f4c15427bfb637fa1ed993bb519c8ad447a6b71bf56e8700793afcc5
|
|
| MD5 |
f0393d587c2e762574828b4eb39c0284
|
|
| BLAKE2b-256 |
d4cfbeeaba6f6f40d6a1c900697ff381b488a4536b03ee6269fafa9a2f0824fe
|
File details
Details for the file babbl-0.2.8-py3-none-any.whl.
File metadata
- Download URL: babbl-0.2.8-py3-none-any.whl
- Upload date:
- Size: 19.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a028f39e5c1e4aa0b9334109806adb151616ac01cfc1d0caf08ad51e3b8b0e9d
|
|
| MD5 |
1c7396b82a26069f44981184ed81b9b8
|
|
| BLAKE2b-256 |
dc08d22ded236348109011c7ea4064f16dd0a789d46925852b3613b548404269
|