-
I'm trying to style sections that consist of a title and then a varying amount of text, code, and possibly other content. I have many of these types of sections; they are exercise solutions. My desired styling is to hide the body content until the user clicks an UI element to reveal it. At the moment I only care about HTML output. I could use the I could easily write a snippet of Javascript to do the styling, but I can't see how to get the HTML output I need. I thought I could use a Any suggestions to solve this problem would be great. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
The best approach depends a bit on your context. Here are some options:
I cannot comment on this as I am not sure why you wanted to use a
This would be a bug. However, the implementation and all the tests using |
Beta Was this translation helpful? Give feedback.
-
Thanks for the advice! I've been able to solve the problem. |
Beta Was this translation helpful? Give feedback.
The best approach depends a bit on your context. Here are some options:
@:style
directive might be the simplest option (https://planet42.github.io/Laika/latest/07-reference/01-standard-directives.html#style). You can wrap any number of block elements in this directive. Those would then be wrapped in adiv
with a class attribute matching your directive attribute.div
the simplest path might still be using the@:style
directive and then using a customized renderer for this node type (by matching on aBlockSequence
that has the style you assigned).withStyle
method should ac…