Skip to content

Publish each paper's links as Literature Links annotations - #78

Open
Deicyde wants to merge 2 commits into
wcook04:mainfrom
Deicyde:literature-links
Open

Deicyde wants to merge 2 commits into
wcook04:mainfrom
Deicyde:literature-links

Conversation

@Deicyde

@Deicyde Deicyde commented Nov 25, 2026 •

Copy link
Copy Markdown

This publishes each paper's links in Literature Links, a JSON format for linking passages of mathematical documents to Lean declarations. links.json stays as it is. A short adapter, tools/literature_links.py, turns it into Literature Links when the site is built, and the workflow then runs the Literature Links checker on the result.

What changes

  • paper.py build writes web/public/papers/<slug>/literature-links.jsonl, so the site publishes it beside paper.pdf or source.md.
  • There is one annotation per passage. The passage is the subject, and its Lean declarations are the object.
    • A PDF passage is a quote on its page, in paper.pdf.
    • A Markdown passage is a generic end in source.md. Its location keeps the heading, block and quotation, under a profile that points at "Markdown papers" in docs/paper-folder.md.
    • The subject end carries the file's sha256, the passage's role, and its title (or its claim's title) if it has one.
    • Each Lean end gives the declaration and its module. Passage lines go on the first declaration only, which is how paper.py checks them.
    • The Lean project and its commit come from [lean] source. When the project is at the root of the repository, uri is the repository URL; when it is in a folder (Euler, Navier–Stokes, BSmtLib), uri is the folder's address. Contextual Embeddings keeps its Zenodo DOI and has no commit.
    • A passage with no Lean gets "object": [].
    • A paper without a [lean] source gets no file. The field is optional, and test_markdown's papers leave it out.
  • pages.yml installs the checker at v1.0.2, pinned by commit, and runs literature-links scan on these files after the build.
  • docs/paper-folder.md gets a short section, and tests/test_literature_links.py tests the mapping.

What it leaves out

  • No relation. Passage comparisons (same, stronger, weaker, different) could become exactMatch, broadMatch, narrowMatch or relatedMatch, but 34 pages hold their comparisons back, so this PR doesn't publish them.
  • Claims, topics, plain titles and notes stay in links.json only.

Two things to know

  • A PDF quote that runs over a page break now stops the build, because a Literature Links quote stays on one page. No passage does this today.
  • The files add about 39 MB to the published site, mostly the Navier–Stokes library pages' quotes.

Testing

  • I ran the adapter on all 52 papers. It wrote 45,013 annotations, and literature-links scan reported 0 problems. An annotation I broke on purpose made the scan fail.
  • Of the 405 PDF quotes, 382 appear exactly once in Poppler's plain text of their page. The other 23 depend on the reader's normalization, such as curly quotes, minus signs and formulas. The Literature Links spec leaves those differences to the application.
  • I ran python3 -m unittest discover -s tests. The new tests pass. The other failures were the same on main, because this machine has no web/node_modules.
  • The whole workflow passed on my fork, which runs the same pages.yml on this branch (run). Its Literature Links step reported 45013 annotations from 52 files; 0 problems.

🤖 Generated with Claude Code

paper.py build now writes literature-links.jsonl beside each paper's data,
one annotation per passage in links.json: the passage is the subject (a
quote on its PDF page, or a generic end holding the Markdown heading, block
and quotation) and its Lean declarations are the object, in the project and
commit that [lean] source names. The workflow checks the files with the
Literature Links checker at v1.0.2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
[lean] source is optional, and test_markdown's papers leave it out, so
the build skips the file for such a paper instead of stopping.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant