Skip to content

Controlling output formatting #373

Answered by jenshalm
noelwelsh asked this question in Q&A
Discussion options

You must be logged in to vote

The best approach depends a bit on your context. Here are some options:

  • If you are working with Markdown sources, the @: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 a div with a class attribute matching your directive attribute.
  • If you don't want a div the simplest path might still be using the @:style directive and then using a customized renderer for this node type (by matching on a BlockSequence that has the style you assigned).
  • If you want/need to work with the AST directly, the withStyle method should ac…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by noelwelsh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #372 on February 21, 2023 11:50.