leanprover / leanprover/verso

Code blocks should be rendered as <pre><code> instead of just <pre>

Open
#751 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lean
Stars
384
Forks
124
Avg merge
22h 28m
Merged PRs (30d)
10

Description

IIUC currently Block.toHtml renders .code blocks using only a <pre> container:

https://github.com/leanprover/verso/blob/1e49d3dc8cb58fbe7a8cbc416042ef7bf666dab2/src/verso/Verso/Doc/Html.lean#L172

This breaks client-side highlighters like Highlight.js and some CSS themes which expect the standard structrue. I think it would be great to reuse some existing highlighters as a catch-all highlighting on the top of define_lexed_text defined languages.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read src/verso/Verso/Doc/Html.lean at Block.toHtml, then inspect define_lexed_text to understand how defined languages are rendered. The change is complete when code blocks produce standard

 structure and the intended catch-all highlighting behavior is clearly addressed.

Written by the indexing model from the issue text.

Assessment

Tech stack
html
Domain
documentation
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.