diff options
| author | Michael Williamson <mike@zwobble.org> | 2016-11-29 22:11:32 +0000 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2016-11-29 22:11:32 +0000 |
| commit | d61528737eaee72823258bf3460e2ac88e94a6a6 (patch) | |
| tree | a37164f65a913bb5f10dbb6006d547b43b7e50e3 /README.md | |
| parent | 7a7d1a88427af1e87688ff6dd8637af9c7c1681a (diff) | |
Document :separator
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -526,6 +526,27 @@ Modifiers must be used in the correct order: h1.section-title:fresh ``` +#### Separators + +To specify a separator to place between the contents of paragraphs that are collapsed together, +use `:separator('SEPARATOR STRING')`. + +For instance, suppose a document contains a block of code where each line of code is a paragraph with the style `Code Block`. +We can write a style mapping to map such paragraphs to `<pre>` elements: + +``` +p[style-name='Code Block'] => pre +``` + +Since `pre` isn't marked as `:fresh`, +consecutive `pre` elements will be collapsed together. +However, this results in the code all being on one line. +We can use `:separator` to insert a newline between each line of code: + +``` +p[style-name='Code Block'] => pre:separator('\n') +``` + #### Nested elements Use `>` to specify nested elements. |
