The site standard
A Lean companion has three front doors: the README (what it is, its status, how to reproduce it), the
site (the same, laid out for a reader: the results, the verification page, how to cite it) and
llms.txt (the entry point for an agent). Proposal 0012 gives the site
one standard that lean-pkg can check, keep current and create. It ships in three phases:
lean-pkg site check(this release): an offline check of the site, of any kind, opted in or not.lean-pkg site render: the generated pages and the generated blocks inside hand-written pages (counts, versions, commits,llms.txt), the noindex block and the fence converter.lean-pkg site init, and thesiteitem ofpublish.
Until phase 2, the checks that only a render can satisfy are warnings: the hand-written counts, the opt-in key, and a hand-written page under a generated name.
Site kinds
site check reads the site directory DIR (default docs, relative to the repository root) and decides
its kind:
| Kind | Detected by | Where the head (noindex, MathJax) is | Navigation |
|---|---|---|---|
static |
DIR/.nojekyll |
each served .html file |
the landing page’s links |
mkdocs |
mkdocs.yml at the repository root whose docs_dir is DIR (MkDocs’ default is docs) |
the theme’s custom_dir templates, or extra_javascript |
nav in mkdocs.yml (no nav: every page) |
jekyll |
anything else GitHub Pages builds from DIR (_config.yml, or an index page) |
DIR/_layouts/*.html and DIR/_includes/*.html |
the landing page, the layouts and includes |
A static site serves its files exactly as committed, so _config.yml there does nothing and Markdown pages
are served as text. A Jekyll site with theme: null and a layout of its own puts its head in that layout:
a theme’s head include (_includes/head-custom.html) is never read there.
A site opts in with one key its host ignores: lean_pkg_site: 1 in DIR/_config.yml (jekyll), under
extra: in mkdocs.yml (mkdocs), or in DIR/lean-pkg-site.yaml (static). In phase 1 the key changes
nothing but the warning; site render will act only on an opted-in site.
What site check checks
lean-pkg site check my-proof # with the registry record
lean-pkg site check --no-registry # in the checkout, no registry (the CI form)
lean-pkg site check my-proof --dir site # a site directory other than docs
Problems (exit 1):
- current: a generated page (
verification.md,coverage.mdcarryingpage’sGenerated bynote) differs from whatlean-pkg page NAME --site DIRwrites now. Needs the registry record. - links: the landing page (and, for Jekyll, the layouts and includes; for MkDocs,
nav) does not link to a generated page. A link may be relative, absolute or built by Liquid (/lean-pkg/verification.html). - Markdown inside HTML blocks: the rule of
page --check --site: a<details>or<div>withoutmarkdown="1"around a table or a fence is published as literal text. Not on a static site, which serves Markdown as text anyway. - mathematics: pages with mathematics (a
latexfence,$$,\() and no MathJax in the head; for MkDocs alsopymdownx.arithmatexmissing. On a static site a page without MathJax is a warning. - noindex:
<meta name="robots" content="noindex">missing from the head while the package is private (on a static site, from any served page), or still there once it is public. Needs the record. - served copies of build inputs: a published file named like a build input (
claims.yaml,coverage.yaml,*.lean,lakefile.*,lake-manifest.json,lean-toolchain,lean-pkg-binding.yaml,formalization.yaml) whose path matches a tracked file outsideDIR(docs/source/claims.yamlandclaims.yaml). Such a copy goes stale and is not what the receipts bind: link the file at a commit (https://github.com/OWNER/REPO/blob/COMMIT/claims.yaml) instead. A Lean example kept only in the site is not a copy. - landing page:
DIR/index.htmlbesideDIR/index.mdon a Jekyll site: GitHub Pages serves the HTML one.
Warnings (exit 0):
- not opted in: the key above is missing.
- counts: a count (
47 verified scopes,30 of 30 numbered results), a lean-pkg or API version (lean-pkg 0.27.0,Source API 0.11.0) or a commit (commit 9cafe12) written by hand in a page, inREADME.mdoutside thepageblock, inllms.txtor in theCITATION.cffabstract. These drift when the evidence changes; phase 2 writes them in generated blocks. Code fences and generated blocks are not read, and<!-- lean-pkg:site:exempt SOURCE -->covers its own line and the next, for a count lean-pkg cannot derive (one taken from a coverage map outside the repository, say). - a hand-written page under a generated name:
site renderwill not overwrite it; rename it or replace it with the generated page. - served files that are neither pages nor assets, and, on a static site, the reminder that
.nojekyllpublishes every committed file ofDIR,_-prefixed andexcluded ones included. - what was not checked without the record (
--no-registry, or noNAME).
--json prints the whole result. Its keys: ok, name, dir, kind, opt_in, registry,
generated[], stale[], links (missing[]), html_blocks[], counts[], exemptions[], math
(pages_with_math, mathjax, problems[]), noindex (expected, present, files[]), served
(files, build_input_copies[], unclassified[]), shadowing_index_html, binding, snapshot,
problems[] and warnings[]. binding and snapshot are null until phase 2.
Writing for both GitHub and the site
- Put a paper’s formula in a
latexcode fence, aslean-pkg pagedoes: github.com shows the TeX source, and the site’s MathJax renders it (phase 2 ships the converter that turns the fence into a display formula). - Inline mathematics in prose renders only on the site; on github.com it stays as TeX. Keep it short.
- Never put a table or a fence inside
<details>withoutmarkdown="1".
The noindex while private
A private package’s site should not be indexed. On a project site (OWNER.github.io/REPO) the only lever
is the meta tag in each page’s head: robots.txt takes effect only at the root of a user or organization
site. The tag does not cover plain-text files the site serves (llms.txt), and it is advisory: it keeps
well-behaved crawlers out, it does not restrict who can open the site. Remove it when the package is
promoted.