-
Is it possible to use Chroma with Bash while having a $ at front? This would make it easier to identify that it's a shell command, while also can just press copy and copy the command without the $. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
it's possible to override the behavior for a given language using Hugo codeblock render hooks in this case you could define a bash/shell hook to remove the dollar sign from the body while still displaying the sign with CSS and copy it won't include the dollar sign then |
Beta Was this translation helpful? Give feedback.
-
The compiled html has this structure: <pre ...>
<code class="language-bash" ...>
<span class="line">Each line has a span</span>
</code>
</pre> I can inject a code.language-bash>span.line::before { /*for the light theme*/
content: "$";
margin-right: 0.5rem;
font-weight: bold;
color: rgb(189, 176, 0);
}
.dark code.language-bash>span.line::before { /*for the dark theme*/
color: rgb(255, 241, 46);
} |
Beta Was this translation helpful? Give feedback.
The compiled html has this structure:
I can inject a
$
with CSS by simply using::before
: