Skip to main content

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 /cppmanlite route

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 reader
  • app.js — lunr.js search + on-demand page fetching
  • style.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

  1. 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).

  2. Search: lunr.js builds a client-side full-text search index from the JSON. Results show title, URL path, and a content snippet.

  3. 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).

  4. 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


Download files

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

Source Distribution

cppmanlite-0.1.1.tar.gz (230.9 kB view details)

Uploaded Source

Built Distribution

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

cppmanlite-0.1.1-py3-none-any.whl (232.7 kB view details)

Uploaded Python 3

File details

Details for the file cppmanlite-0.1.1.tar.gz.

File metadata

  • Download URL: cppmanlite-0.1.1.tar.gz
  • Upload date:
  • Size: 230.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cppmanlite-0.1.1.tar.gz
Algorithm Hash digest
SHA256 cd81c71b5792cf82e363fd885030c8fcd705296a937a57100bae76859b96812c
MD5 035edf02cd69f46b46dbb2044b66db26
BLAKE2b-256 f8f08ea03c25ecf06e6323e56028744a47424e7c8b95153e8b75bfa3f02c4f1b

See more details on using hashes here.

File details

Details for the file cppmanlite-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cppmanlite-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 232.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.15

File hashes

Hashes for cppmanlite-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4e0156912e81a2df9f8cf46140d2d801e42bc0d958cdc241d1b6f103e0a11365
MD5 3820c7ea24eacc0e50c1d80068e49605
BLAKE2b-256 8a3cc91407adfe242bb3f70abd77bb01c7152b9ae4ddc4da3ed1cf6b3da27b87

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