-
Notifications
You must be signed in to change notification settings - Fork 499
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
Add background color key to inline monospace #306
Comments
It's not yet possible to put background colors on inline elements in Asciidoctor PDF. However, Prawn does support this (using a render_behind calback). |
Thanks for the clarification. I look forward to when you have time to implement it! |
I'd love to have this - our mono font isn't too different from the regular font, so sometimes the monospaced text (which we have a lot of) gets a little lost. Being able to highlight those passages would help. |
I ended up here after desiring background consistency between block code and inline code. I see that, when using rogue, support was added for line highlighting via #663 and which #345 indicates is related to this request. Do inline blocks support the use of custom/generic rogue themes as well (we’re in transition to adoc and currently use Pygments or whatever the default is), or is further work required to make background coloring work for inline code? |
@billybooth highlighting for inline snippets is a separate issue. There's an open issue in core about how to express it in AsciiDoc, which could then be carried out by the converter. See asciidoctor/asciidoctor#1043 |
I realized that I had already done the work for this issue in the open pull request for #451 (see #664). What was left was a way to put some padding between the background/border and the text. I decided to introduce the key |
Btw, we can add border at the same time, and border radius, and all those goodies. |
… of inline code (literal)
… of inline code (literal)
… of inline code (literal)
I have tried to test it and the result is: Example text:
theme params
resultAnother theme params (no border offset)
result |
@mojavelinux fyi and thanks for this :) |
Thanks for checking. I see what's happening. Unfortunately, there's nothing I can do about that right now. The monospaced text can't have any sort of nested formatting. Prawn just doesn't understand how to work with nested formatting, so it ends up not being able to render behind the outer group (instead, it tries to render behind each nested formatted phrase). This is just where we start to hit limits in Prawn that I just can't fix from Asciidoctor PDF. |
To clarify, you can fix by using:
|
Got it, thx! |
Copyright (garbage) strings may contain characters that are reserved for formatting in Asciidoc. Avoid formatting to break in such cases by disabling "nested formatting" while using monospaced text. See [1] and [2] for background information. [1]: #8019 [2]: asciidoctor/asciidoctor-pdf#306 Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Copyright (garbage) strings may contain characters that are reserved for formatting in Asciidoc. Avoid formatting to break in such cases by disabling "nested formatting" while using monospaced text. See [1], [2] and [3] for background information. [1]: #8019 [2]: asciidoctor/asciidoctor-pdf#306 [3]: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#literals-and-source-code Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Copyright (garbage) strings may contain characters that are reserved for formatting in Asciidoc. Avoid formatting to break in such cases by disabling "nested formatting" while using monospaced text. See [1], [2] and [3] for background information. [1]: #8019 [2]: asciidoctor/asciidoctor-pdf#306 [3]: https://docs.asciidoctor.org/asciidoc/latest/syntax-quick-reference/#literals-and-source-code Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
Currently it does not seem to be possible to create a custom theme in which a background colour can be added to inline monospace (
literal
in the theme YAML).This is the default styling in the HTML output in the inline
code
style and it would be nice to be able to replicate this.Default HTML CSS:
As far as I can see this is currently possible in source block formatting (
code
YAML section), but not in the inline case surrounded by `.The text was updated successfully, but these errors were encountered: