Lightweight serverless C++ documentation lookup — pure Python, no C deps
Project description
cppmanlite
Lightweight serverless C++ documentation lookup — a pure Python package and static site powered by cppreference.com.
Features
- Pure Python — no C dependencies, works in CPython, Pyodide, Jupyter
- Static site — served from GitHub Pages or any static host
- Client-side search — lunr.js fuzzy search over a ~1MB index
- On-demand page loading — fetches from cppreference.com or local bundle
- Auto-updating — GitHub Action refreshes the index monthly
- Kubernetes-ready — Helm chart included for
/cppmanliteroute
Python package
pip install cppmanlite
import cppmanlite
# Search for C++ documentation
cppmanlite.search("vector")
# [{'title': 'std::vector', 'url': 'cpp/container/vector.html', ...}, ...]
# Display a page (renders HTML in Jupyter, plain text in terminal)
cppmanlite.man("std::vector")
# Alias
cppmanlite.help("sort")
Works in Pyodide (Python in the browser) — no compiled dependencies required.
Static site
The site/ directory contains a standalone search UI:
index.html— search box + results + page readerapp.js— lunr.js search + on-demand page fetchingstyle.css— dark/light theme
Deployed to GitHub Pages at: https://dive4dec.github.io/cppmanlite/
Docker / Kubernetes
docker build -t cppmanlite:v1 .
Multi-stage build: downloads the cppreference HTML archive, strips boilerplate, builds a search index, and serves everything via nginx.
helm install cppmanlite ./chart -n cppmanlite
Serves at https://socratic.cs.cityu.edu.hk/cppmanlite/
How it works
-
Index building (
scripts/build_index.py): Downloads the cppreference HTML book archive, extracts page titles + snippets, fixes relative URLs, and writes a compact JSON index (~1.2MB for 6,000+ pages). -
Search: lunr.js builds a client-side full-text search index from the JSON. Results show title, URL path, and a content snippet.
-
Page reading: When a user clicks a result, the reader fetches the page — either from a local
docs/bundle (Docker/K8s deployment) or directly from cppreference.com (GitHub Pages). -
Auto-update: A GitHub Action runs monthly, downloads the latest cppreference archive, rebuilds the index, and deploys to GitHub Pages.
Data source
Documentation from cppreference.com, licensed under CC-BY-SA 3.0 / GFDL. The HTML book archive is published by PeterFeicht/cppreference-doc.
License
MIT — see 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 cppmanlite-0.1.0.tar.gz.
File metadata
- Download URL: cppmanlite-0.1.0.tar.gz
- Upload date:
- Size: 229.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9f5bf84296407aecee637772a0de24388be64636dc5b09affa2b160d9aea5042
|
|
| MD5 |
4e1b5274b4b8da2d8ee4eaf563cd5ee6
|
|
| BLAKE2b-256 |
334e7bd66749c27a76435e6461367f713c7311955ebaa887344efe6d586307b4
|
File details
Details for the file cppmanlite-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cppmanlite-0.1.0-py3-none-any.whl
- Upload date:
- Size: 231.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
18bb3c4a51daf74ae23d1954b33c846a8efe9281e330ea9377aaedcefc0717eb
|
|
| MD5 |
3b5326ed8e3a1b6d2b891e73747c2999
|
|
| BLAKE2b-256 |
8a1f8aac38ce64fce08eb1a02376c4700a71fc664d678e56060a3a3e15371588
|