Skip to content

francescobianco/math

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

77 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Math Wiki

A static math wiki: a single-page app (index.html) you can publish on GitHub Pages. Every document is a Markdown file under library/, so the repository is both the application and the content store.

Documents have four standard types and appear in the tree on the left:

  • 📃 page — the home page is always present and is the landing document.
  • 📕 book
  • 📄 paper
  • 📝 notes

The central sheet is laid out like an A4 page, as a PDF-style preview. Math is rendered with KaTeX and Markdown is handled by marked (both via CDN).

Saving (via the GitHub API)

There is no write backend. Pressing Save commits the matching .md file straight to GitHub through the Contents API: one click for both new and existing documents (for updates the file's current sha is fetched first).

This needs a token: a fine-grained Personal Access Token with Contents: Read and write on this repository. The first time you save you are asked for it via a prompt; it is stored only in the browser's sessionStorage (cleared when the tab closes) and never committed. Use the 🔑 button at the bottom of the sidebar to set, replace, or remove it.

The target repo is configured at the top of the script in index.html (const GITHUB = …); if the site runs on <user>.github.io/<repo>/ it is detected automatically.

When a .md file is committed, a GitHub Action (.github/workflows/manifest.yml) rebuilds index.json (the tree) at the project root and commits it back, so the site stays up to date with no manual step.

Local development

The local server only serves files (read-only): it needs Python 3, no dependencies. Saving still goes through GitHub, exactly like online.

make start          # serves on http://127.0.0.1:5040
make start PORT=9000
make build          # rebuild index.json from the .md files in library/ (the Action does this too)
make help

Publishing on GitHub Pages

Enable Pages for the repo (branch main, root folder). The .nojekyll file disables Jekyll, so the .md files under library/ are served as raw files.

About

A static math wiki

Topics

Resources

License

Stars

1 star

Watchers

0 watching

Forks

Contributors