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.6.tar.gz (231.6 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.6-py3-none-any.whl (233.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cppmanlite-0.1.6.tar.gz
  • Upload date:
  • Size: 231.6 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.6.tar.gz
Algorithm Hash digest
SHA256 2d597e86737f0613ecd611495d2c085ea0ac62c5c0dad93cef2728377e89202b
MD5 2e8eda333bbe26a75296cc841ce01c9c
BLAKE2b-256 2cddaed3e637dd9c0dc4ca44953fe1f4fcf7e2785383a12ba2ab7c6e1c8e605d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cppmanlite-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 233.4 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 05a4d20e6abd8505bb915aec3269f992fba550943b910ad1937f85bdcc2415bb
MD5 fad080a1c86bacf3c0ad35fb7a956d14
BLAKE2b-256 925005bf239d10ced2087217ed0d7996a123c3fce8c1b7018d1454fac179e199

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