Skip to content

michael-lutz/babbl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Babbl

A modern markdown-to-HTML converter designed for research blog posts with support for tables, code references, and beautiful styling.

Babbl

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors