From 768546f6d448ccb356403ef396e77d9c734ca8bb Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 19 Nov 2016 21:43:10 +0000 Subject: Document :separator --- README.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'README.md') diff --git a/README.md b/README.md index 4eb8fb1..614e43c 100644 --- a/README.md +++ b/README.md @@ -404,6 +404,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 `
` 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.
-- 
cgit v1.2.3