Skip to content

Add side-by-side layout: TeX content left, Lean declarations right#90

Open
faabian wants to merge 2 commits intoPatrickMassot:masterfrom
faabian:side-by-side-layout
Open

Add side-by-side layout: TeX content left, Lean declarations right#90
faabian wants to merge 2 commits intoPatrickMassot:masterfrom
faabian:side-by-side-layout

Conversation

@faabian
Copy link
Copy Markdown

@faabian faabian commented Mar 13, 2026

Introduce a two-column layout for blueprint pages that displays the LaTeX theorem content on the left and the corresponding Lean doc-gen declarations (statements, equations, structure fields) in a side panel on the right.

Key changes:

  • blueprint.py: Add functions to load and parse doc-gen4 declaration data (load_docgen_declarations, parse_docgen_statement) and extract HTML/plain-text for declaration headers, equations, and structure fields. Add rewrite_lean_links() Jinja2 filter that rewrites doc-gen links at render time: links to declarations present in the blueprint point to the blueprint URL, while others point to the project's doc-gen docs.

  • blueprint.jinja2s: Add a thmenv template that supports injecting extra header content (thm_header_extras_tpl, thm_header_hidden_extras_tpl) and a right-side panel (thm_side_panel_tpl) next to each theorem environment wrapper.

  • blueprint.css: Add ~490 lines of CSS for the two-column CSS Grid layout. Theorem wrappers span both columns with their own internal grid. Includes responsive fallback to single-column on smaller screens, wider TOC sidebar, and styling for Lean declaration headers, equations, structure fields, and link types.

  • _config.yml: Fix baseurl to use the project name subpath so GitHub Pages serves the site at the correct URL.

Introduce a two-column layout for blueprint pages that displays
the LaTeX theorem content on the left and the corresponding Lean
doc-gen declarations (statements, equations, structure fields) in
a side panel on the right.

Key changes:

- blueprint.py: Add functions to load and parse doc-gen4 declaration
  data (load_docgen_declarations, parse_docgen_statement) and extract
  HTML/plain-text for declaration headers, equations, and structure
  fields. Add rewrite_lean_links() Jinja2 filter that rewrites
  doc-gen links at render time: links to declarations present in the
  blueprint point to the blueprint URL, while others point to the
  project's doc-gen docs.

- blueprint.jinja2s: Add a thmenv template that supports injecting
  extra header content (thm_header_extras_tpl, thm_header_hidden_extras_tpl)
  and a right-side panel (thm_side_panel_tpl) next to each theorem
  environment wrapper.

- blueprint.css: Add ~490 lines of CSS for the two-column CSS Grid
  layout. Theorem wrappers span both columns with their own internal
  grid. Includes responsive fallback to single-column on smaller
  screens, wider TOC sidebar, and styling for Lean declaration
  headers, equations, structure fields, and link types.

- _config.yml: Fix baseurl to use the project name subpath so GitHub
  Pages serves the site at the correct URL.
@faabian
Copy link
Copy Markdown
Author

faabian commented Mar 13, 2026

For visibility, feel free to close

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