-
Notifications
You must be signed in to change notification settings - Fork 447
Highlight bash commands #1544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Highlight bash commands #1544
+403
−36
Conversation
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
Collaborator
|
🚀 Preview deployment available at: https://456d69d1.rdoc-6cd.pages.dev (commit: c01b7fc) |
33f140c to
b6f5235
Compare
b6f5235 to
8bcfca6
Compare
8bcfca6 to
d920014
Compare
tompng
reviewed
Jan 6, 2026
tompng
reviewed
Jan 6, 2026
Replace language-specific CSS variables (--c-*) with a shared neutral color palette (--code-*) that can be reused across different syntax highlighters. This reduces duplication and makes it easier to maintain consistent colors across C, Ruby, and future language highlighters. Changes: - Add --code-cyan and --code-gray to neutral palette - Remove --c-* semantic variables for C highlighting - Update .c-* classes to reference neutral --code-* variables
Add a simple shell/bash syntax highlighter for documentation code blocks. The highlighter is focused on command-line documentation rather than full bash scripts. Highlights: - $ prompts (gray) - Commands/executables - first word on line (blue) - Options like -f, --flag, --option=value (cyan) - Single and double quoted strings (green) - Comments starting with # (gray, italic) The highlighter targets code blocks with language classes: bash, sh, shell, console. Files added: - lib/rdoc/generator/template/aliki/js/bash_highlighter.js - test/rdoc/generator/aliki/highlight_bash_test.rb
d920014 to
c01b7fc
Compare
tompng
approved these changes
Jan 19, 2026
Member
tompng
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎉
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.
The current bash command code blocks are highlighted inconsistently because some code blocks got detected as Ruby, so Ruby highlighting is applied. This has been addressed in #1538.
But after the PR, we don't have any highlighting for bash, which I think we can provide rather simply.
With this PR, we can highlight code blocks tagged as
sh,shell,bash, andconsolewith a simple JS highlighter.