Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

babbl-0.2.9.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

babbl-0.2.9-py3-none-any.whl (19.0 kB view details)

Uploaded Python 3

File details

Details for the file babbl-0.2.9.tar.gz.

File metadata

  • Download URL: babbl-0.2.9.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for babbl-0.2.9.tar.gz
Algorithm Hash digest
SHA256 5dad680b0248301822635dfc6cbdd6c88f7a9091e3daa09927d13854634dedd4
MD5 444bd455eee04d53d0366986cd630fac
BLAKE2b-256 ff71680afe3565833eaa9cd86550f053b78427090831c59713a3d86fede9769f

See more details on using hashes here.

File details

Details for the file babbl-0.2.9-py3-none-any.whl.

File metadata

  • Download URL: babbl-0.2.9-py3-none-any.whl
  • Upload date:
  • Size: 19.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for babbl-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 4a80b54d9751a7ad666c4a568f201d2efb20d35ba9037d54f8c97f7bb5c00f6f
MD5 98c7445233637a19ab8f34261c8ede10
BLAKE2b-256 6f8de1fb5288c647c16c872dafcc68ba86ac67e767d3b5c8723ada4eb42ad427

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page