Skip to content

Commit

Permalink
Document :separator
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Nov 29, 2016
1 parent 7a7d1a8 commit d615287
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

* Allow escape sequences in style IDs, style names and CSS class names.

* Allow a separator to be specified when HTML elements are collapsed.

* Add include_embedded_style_map argument to allow embedded style maps to be
disabled.

Expand Down
21 changes: 21 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d615287

Please sign in to comment.