Skip to content

Section Breaks

Anton edited this page Aug 3, 2019 · 3 revisions

A section break is a small image in the center of the page which indicates the end of a section. With larger sections which also include sub-sections, this feature can help to differentiate when the topic finishes and another one starts. They can also be used to navigate back to table of contents, or a location specified with the href attribute.

At the moment, there is support for pre-installed section breaks. In future, more support of custom images will be included.

To insert a section brake, the following marker is used:

%~[, number[, attributes]]%

For example:

%~%
%~ 15%
%~ -1%
%~ href="https://hello.world" width="200"%
<p align="center"><a href="#table-of-contents">
  <img src="/.documentary/section-breaks/0.svg?sanitize=true">
</a></p>
<p align="center"><a href="#table-of-contents">
  <img src="/.documentary/section-breaks/15.svg?sanitize=true">
</a></p>
<p align="center"><a href="#table-of-contents">
  <img src="/.documentary/section-breaks/-1.svg?sanitize=true">
</a></p>
<p align="center"><a href="https://hello.world">
  <img src="/.documentary/section-breaks/16.svg?sanitize=true" width="200">
</a></p>

There are 23 available section breaks which will be inserted in incremental order in the document. When the end of the list is reached, the count restarts. There are also 3 ending breaks which can be inserted at the end and do not participate in the rotation, so that they must be inserted manually. To select a specific image, its number can be given.

0 1 2 3 4 5 6 7 8 9 10 11
12 13 14 15 16 17 18 19 20 21 22
-1 -2 -3

By default, the section brake will link to the table of contents, however this can be changed by setting the href attribute. The images are also SVGs therefore it is possible to give them any width via the width attribute and they will stretch without any loss of quality. Documentary will copy images from its source code to the .documentary/section-breaks directory in the repository. To control the destination, set the to attribute on section breaks.