-
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
Applying custom styles to source blocks #1486
Comments
This is essentially the same as #483. There's currently no framework/callback in place to apply overrides from a role to a block. But the challenge is knowing what to override, what the precedence to apply, and which blocks support which properties. |
Maybe I'm missing something but I think the role should always have a higher precedence right?
Do you want to implement this feature once for all type of blocks or can I submit a pull request to implement this feature only on listing blocks? |
Yes, the role would win. But sometimes the key is figuring out where to merge the properties in time for the code to access them. Because sometimes the code goes straight to the theme and then it would end up undoing a previously overridden value. In other words, how the theme properties are accessed has to change. |
I would like #483 to be implemented first, because it's the simpler of the changes. And then we can do listing blocks after that...going further if the design allows. |
I documented one way to accomplish this using an extended converter. See #959 (comment) |
The technique for supporting roles per block type is now covered in the docs. See https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#theme-table-using-custom-role |
Hello, (merci de m'indiquer si ce sujet doit faire l'objet d'un nouveau ticket ?) What I can read concerns the extension of warning blocks. That's not what I'm looking for. My goal is to be able to change the background and border colour of a
I'm not restricted to using I'd like to be able to apply a role to customise a block. I have read several tickets, including 483. Before reading them, I thought it wasn't possible, now I'm a bit confused. Here's what I'd like to be able to do:
I currently use the example block delimiter for my questions and customise the rendering as follows:
In my theme :
For the answers, I use a sidebar block that I customise as follows:
In my theme :
I use the example and sidebar delimiters so that I can customise the rendering. But that doesn't meet my needs, which go beyond these two cases. I've read https://docs.asciidoctor.org/pdf-converter/latest/extend/use-cases/#theme-table-using-custom-role but I can't see anything that meets my needs. How can I use roles in my case? Thank you very much for your help. I love Asciidoc so much! (I should point out that I only generate my materials in pdf format) |
@gemkod please direct questions about usage to the project chat at https://chat.asciidoctor.org. Thanks. |
Let's say I want to write a Best Practices guide and I want to use a role on source blocks when it's not recommended. For instance:
In this case, I want to apply a custom style to highlight the fact that the reader should not do that.
Is that possible?
The text was updated successfully, but these errors were encountered: