You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: examples/sile-and-djot.dj
+18-15Lines changed: 18 additions & 15 deletions
Original file line number
Diff line number
Diff line change
@@ -65,10 +65,11 @@ Actually, let's start with attributes, as they have the same general syntax for
65
65
66
66
Attributes are put inside curly braces.
67
67
On inline elements, attributes are placed immediately after the element they are attached to, with no intervening whitespace.
68
-
They may contain line breaks, and may be "stacked," in which case they will be combined.
68
+
They may contain line breaks, and may be "stacked," in which case they are combined.
69
69
70
70
To attach attributes to a block-level element, put the attributes on the line immediately before the block.
71
-
Block attributes have the same syntax as inline attributes, but they must fit on one line. Repeated attribute specifiers can also be used, and the attributes will accumulate.
71
+
Block attributes have the same syntax as inline attributes, but they must fit on one line.
72
+
Repeated attribute specifiers can also be used, and the attributes accumulate.
72
73
73
74
Inside the curly braces, the following syntax is possible:
74
75
@@ -78,7 +79,7 @@ Inside the curly braces, the following syntax is possible:
78
79
79
80
- `.foo` specifies a class, for styling purposes.
80
81
81
-
Multiple classes may be given in this way; they will be combined.
82
+
Multiple classes may be given in this way.
82
83
83
84
- `key="value"` or `key=value` specifies a key-value attribute.
84
85
@@ -303,7 +304,7 @@ Attributes are optional, and are passed through to the underlying SILE package.
303
304
You can notably specify the required image width and/or height, as done just above, by appending the `{width=... height=...}` attributes --- Note that any unit system supported by SILE is accepted, as well as percentages (see §[](#final-notes-units)).
304
305
There are actually two kinds of image syntax: (direct) inline images and (indirect) reference images.
305
306
Above, we used the former kind.
306
-
The reference images are defined elsewhere in the document, and are referenced by their label:
307
+
The reference images are defined elsewhere in the document, referred to by their label.
An image with nonempty caption (i.e. "alternate" text), occurring alone by itself in a paragraph, will be rendered as a figure with a caption, as actually seen above.
325
+
An image with nonempty caption (i.e. "alternate" text), occurring alone by itself in a paragraph, is rendered as a figure with a caption, as actually seen above.
325
326
Otherwise, the caption is ignored.
326
327
327
-
If your document class or previously loaded packages provide a `captioned-figure` environment, it will be wrapped around the image (and it is then assumed to take care of the caption, i.e. to extract and display it appropriately).
328
-
Specifically, if the *resilient* book class is used, the caption will be numbered by default, and added to the list of figures. Specify `.unnumbered`, and `.notoc` respectively, if you do not want it.
328
+
If your document class or previously loaded packages provide a `captioned-figure` environment, it is wrapped around the image (and it is then assumed to take care of the caption, i.e. to extract and display it appropriately).
329
+
Specifically, if the *resilient* book class is used, the caption is numbered by default, and added to the list of figures. Specify `.unnumbered`, and `.notoc` respectively, if you do not want it.
329
330
Otherwise, the converter uses its own fallback method.
330
331
331
332
#### Extended image types
@@ -415,7 +416,7 @@ Another link to [the SILE website][sile].
415
416
[sile]: https://sile-typesetter.org/
416
417
417
418
The reference label should be defined somewhere in the document.
418
-
If the label is empty, then the link text will be taken to be the reference label as well as the link text.
419
+
If the label is empty, then the link text is taken to be the reference label as well as the link text.
419
420
420
421
{#djot-cross-references}
421
422
#### Cross-references
@@ -431,7 +432,7 @@ Empty local links (that is, without inline display content) are interpreted as c
431
432
By default, they are resolved to the closest numbering item, whatever that might be in the hierarchical structure of your document.
432
433
A pseudo-class attribute may be used to override the default behavior and specify which type
433
434
of reference is expected (page number, section number or title text).
434
-
Thus, the above example was obtained from the following input:
435
+
Thus, the above example was obtained with:
435
436
436
437
{custom-style=CodeBlock}
437
438
:::
@@ -626,7 +627,7 @@ The contents of the block quote are parsed as block-level content.
626
627
>
627
628
> > Such quotes can be nested.
628
629
629
-
If your document class or previously loaded packages provide a `blockquote` environment, it will be used.
630
+
If your document class or previously loaded packages provide a `blockquote` environment, it is used.
630
631
Otherwise, the converter uses its own fallback method, with hard-coded styling.
631
632
632
633
#### Attributed quotes (epigraphs)
@@ -896,7 +897,7 @@ Djot supports the "pipe table" syntax, with its own way for marking the optional
896
897
:::
897
898
898
899
899
-
When using the *resilient* classes, the caption will be numbered by default, and added to the list of tables.
900
+
When using the *resilient* classes, the caption is numbered by default, and added to the list of tables.
900
901
Specify `.unnumbered`, and `.notoc` respectively, as table attributes, if you do not want it.
901
902
902
903
### Code blocks
@@ -946,7 +947,7 @@ This is a very naive approach to syntax-highlighting, until the converter possib
946
947
947
948
#### Rendered code blocks
948
949
949
-
If the converter knows how to render the content of a code block, it will do so by default.
950
+
If the converter knows how to render the content of a code block, it does so by default.
950
951
The `render` attribute can be set to `false` to prevent this behavior, and enforce the content to be rendered as raw verbatim text.
951
952
952
953
: Mardown and Djot code blocks
@@ -1027,7 +1028,7 @@ The `render` attribute can be set to `false` to prevent this behavior, and enfor
1027
1028
1028
1029
: Pie charts
1029
1030
1030
-
Likewise, if you installed the optional *piecharts.sile* collection, then code blocks marked as "piechart" are automatically rendered, with all other attributes are passed to the underlying processor.
1031
+
Likewise, if you installed the optional *piecharts.sile* collection, then code blocks marked as "piechart" are automatically rendered, with all other attributes passed to the underlying processor.
1031
1032
Consider the following code block, consisting in a CSV table...
1032
1033
1033
1034
{custom-style=CodeBlock}
@@ -1331,22 +1332,24 @@ Since it's possible to have unused footnote definitions, let's craft one as show
1331
1332
When encountering a symbol, this converter looks for such a footnote and expands its content.
1332
1333
It works with inline elements as shown above, but also with full blocks, provided the symbol is the only element in a paragraph of its own.
1333
1334
1334
-
Of course, these pseudo-footnotes[^djot-pseudo-footnotes] can in turn contain symbols, which will get replaced too.
1335
+
Of course, these pseudo-footnotes[^djot-pseudo-footnotes] can in turn contain symbols, which get replaced too.
1335
1336
1336
1337
1337
1338
[^djot-pseudo-footnotes]: You may still use them as regular footnotes.
1338
1339
Whether this is a good idea is another question...
1339
1340
1340
1341
### Predefined symbols
1341
1342
1342
-
This converter also comes with a few symbols predefined.
1343
+
This converter also comes with a few symbols predefined.[^djot-programmatic-symbols]
1343
1344
1344
1345
- `:_TOC_:` must stand alone in its own paragraph. It inserts a table of contents.
1345
1346
Attributes on the symbol are passed through, e.g. `:_TOC_:{depth=3}`.
1346
1347
- `:U+xxxx:` (where `xxxx` is a hexadecimal value in upper case) is replaced by the corresponding Unicode character --- `:U+2122:` gives :U+2122:.
1347
1348
1348
1349
The above variable substitution mechanism has precedence over these symbols, allowing you to possibly override them.
1349
1350
1351
+
[^djot-programmatic-symbols]: For 3d-party class and package designers, a Lua method is provided to add their own symbols.
0 commit comments