Open
Conversation
43e2a47 to
170ec5a
Compare
cb341
commented
Apr 30, 2026
cb341
commented
Apr 30, 2026
Contributor
Author
There was a problem hiding this comment.
I don't know why this was missing
cb341
commented
May 5, 2026
Comment on lines
+15
to
+20
| LANGS = { | ||
| ".rb" => "ruby", ".js" => "js", ".ts" => "ts", ".sh" => "sh", | ||
| ".yml" => "yaml", ".yaml" => "yaml", ".json" => "json", | ||
| ".scss" => "scss", ".css" => "css", ".html" => "html", | ||
| ".feature" => "gherkin", ".erb" => "erb", ".jsx" => "jsx" | ||
| } |
Contributor
Author
There was a problem hiding this comment.
This is debatable.
We could either choose the easy route and serve it as RAW text.
OR we could take this approach and create virtual sections where the file contents are wrapped in a code block.
Contributor
Author
There was a problem hiding this comment.
The upside of the code block is the copy button and the more consistent look and feel.
cb341
commented
May 5, 2026
Contributor
Author
There was a problem hiding this comment.
As this is mostly a behavioral change for mdbook itslef and doesn't affect the actual contents.
cb341
commented
May 5, 2026
| items.each(&walk) | ||
|
|
||
| inlined.each do |path, content| | ||
| fence = "`" * ([3, (content.scan(/`+/).map(&:length).max || 0) + 1].max) |
38c69f5 to
8418df9
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Rewrites relative links to templates/* (non-.md) into mdbook-rendered pages that show the file contents as syntax-highlighted code blocks. The preprocessor injects a virtual chapter for each referenced template and rewrites the link to .html, so clicking a template link in the served book opens a fast, locally-rendered page instead of triggering a raw-file download or a slow GitHub blob round trip.
Before the
.rbfiles would simply get downloaded instead of rendered.Rendering a code block has the advantage that sharing a link to the code automatically gets the theming of the ASG as well as a copy button.