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.0.tar.gz (229.3 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.0-py3-none-any.whl (231.0 kB view details)

Uploaded Python 3

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

Hashes for cppmanlite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 9f5bf84296407aecee637772a0de24388be64636dc5b09affa2b160d9aea5042
MD5 4e1b5274b4b8da2d8ee4eaf563cd5ee6
BLAKE2b-256 334e7bd66749c27a76435e6461367f713c7311955ebaa887344efe6d586307b4

See more details on using hashes here.

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

Hashes for cppmanlite-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 18bb3c4a51daf74ae23d1954b33c846a8efe9281e330ea9377aaedcefc0717eb
MD5 3b5326ed8e3a1b6d2b891e73747c2999
BLAKE2b-256 8a1f8aac38ce64fce08eb1a02376c4700a71fc664d678e56060a3a3e15371588

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