Skip to content

Replace PDFs with markdown-rendered pages#184

Draft
ScriptRaccoon wants to merge 15 commits into
mainfrom
upgrade-content-pages
Draft

Replace PDFs with markdown-rendered pages#184
ScriptRaccoon wants to merge 15 commits into
mainfrom
upgrade-content-pages

Conversation

@ScriptRaccoon
Copy link
Copy Markdown
Owner

@ScriptRaccoon ScriptRaccoon commented May 15, 2026

Long proofs were previously provided as PDFs, along with their source files, and treated as static assets. In this PR, TeX files are replaced with Markdown files. PDF files are removed and replaced with Markdown-rendered content pages available under /content/[id].

The set-theoretic foundations page (which was already rendered from Markdown) is now also integrated into this system, and its route has been changed from /foundations to /content/foundations.

Advantages

Advantages of Markdown-rendered content pages over PDF files:

  • unified content format, reducing the number of ways content can be added
  • consistent styling and navigation with the rest of CatDat
  • ability to link to other pages within CatDat
  • support for dark mode
  • fully responsive layout (PDFs are difficult to read on mobile devices)
  • support for defined macros
  • no binary files (PDFs) in version control
  • no need to manually build and sync PDFs
  • improved accessibility (screen reader compatibility, text selection, copy paste)

Screenshots

Dark Mode + Mobile

screenshot

Light Mode + Desktop

screenshot

Plan

I plan to also replace lemmas with that system.

@ScriptRaccoon ScriptRaccoon force-pushed the upgrade-content-pages branch from ef3625c to bf39d24 Compare May 15, 2026 22:04
@ScriptRaccoon
Copy link
Copy Markdown
Owner Author

ScriptRaccoon commented May 15, 2026

@varkor Can you maybe help me with a commutative diagram here? I am currently migrating the tex files to markdown files. This went smooth so far, but the diagram on https://catdat.app/pdf/walking_parallel_pair_sifted_colimit.pdf is a bit challenging.

I found that I can create a svg by using the tool pdf2svg (which I could install via homebrew on macOS, even though it is not maintained anymore). (I also tried dvisvgm but that did not work properly.) Then I can include it in the markdown file as an image like so.

![diagram for equations above](/img/diagram-sifted-colimit.svg)

This looks nice so far. And it is fully responsive.

Bildschirmfoto 2026-05-16 um 01 14 26

But only in light mode. To support dark mode, I tried to use CSS variables in the SVG file, but they seem to be scoped to the SVG. Also when I add global styles in the page, they don't seem to get to the SVG. So I can either support light mode or dark mode. See the last two commits for details (bf39d24 and 91dfe67), and in particular the raw file static/img/diagram-sifted-colimit.svg (where I add some styles after the conversion).

Of course I looked at solutions online. But I cannot use a media query alone since the theme can be changed by the user. I tried fill="currentColor" but that does not work.

EDIT. ok when I inline the svg file directly into the markdown file, it works with currentColor. But this is an awful lot of code where it should not be.

@ScriptRaccoon ScriptRaccoon changed the title Upgrade content pages Convert pdf files to content pages May 15, 2026
@ScriptRaccoon ScriptRaccoon changed the title Convert pdf files to content pages Convert pdf files to markdown-rendered pages May 15, 2026
@ScriptRaccoon ScriptRaccoon changed the title Convert pdf files to markdown-rendered pages Replace pdf files with markdown-rendered pages May 15, 2026
@ScriptRaccoon ScriptRaccoon changed the title Replace pdf files with markdown-rendered pages Replace PDFs with markdown-rendered pages May 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant