-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Closed as duplicate of#5969
Closed as duplicate of#5969
Copy link
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.Proposal
Milestone
Description
Proposal Details
I would like to propose adding optional syntax highlighting to the present tool.
The Problem
Currently, .code and .play blocks in presentations render as plain text inside <pre> tags. This works fine for small snippets, but for larger blocks of code, the lack of highlighting makes it harder for the audience to parse the logic quickly.
Proposed Solution
I propose integrating Prism.js into the default templates.
I suggest Prism because:
- It's minimal: We can vendor a build containing only Core + Go support, which is very small (~2KB).
- No dependencies: It's just a JS file and a CSS file; no complex build pipeline is needed.
- Progressive enhancement: If the script fails to load or JS is disabled, the code renders as plain text, preserving the current behavior exactly.
Implementation Plan
If accepted, I can submit a CL that:
- Adds a minified
prism.jsand a minimalprism.cssto thestatic/directory. - Updates
templates/action.tmplto add the standardclass="language-%s"attribute to the<pre>block based on the file extension. - Includes the script/css links in the header/footer templates.
This would be a strictly client-side change with no impact on the Go code logic in the server.
Thoughts?
tmthrgd
Metadata
Metadata
Assignees
Labels
FeatureRequestIssues asking for a new feature that does not need a proposal.Issues asking for a new feature that does not need a proposal.Proposal