expand examples in documentation
Add examples showing how sections that take lists of strings can also
include a single string, and expand on why the escaped rst formatting
works.
Change-Id: I26be8c3027aebbfb1bf4a6f17c6f995dc44aac1a
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Doug Hellmann
6 years ago
0 | |
.. release-notes:: Examples
|
|
0 |
==========
|
|
1 |
Examples
|
|
2 |
==========
|
|
3 |
|
|
4 |
Input file
|
|
5 |
==========
|
|
6 |
|
|
7 |
.. literalinclude:: ../../examples/notes/add-complex-example-6b5927c246456896.yaml
|
|
8 |
:caption: examples/notes/add-complex-example-6b5927c246456896.yaml
|
|
9 |
:language: yaml
|
|
10 |
|
|
11 |
Rendered
|
|
12 |
========
|
|
13 |
|
|
14 |
.. release-notes::
|
1 | 15 |
:relnotessubdir: examples
|
|
16 |
:earliest-version: 1.0.0
|
13 | 13 |
| with | so the reStructuredText
|
14 | 14 |
| parser will retain
|
15 | 15 |
| the line breaks.
|
|
16 |
features:
|
|
17 |
This note is a simple string, and does not retain its
|
|
18 |
formatting when it is rendered in HTML. rst markup here
|
|
19 |
may break the YAML parser, since the string is not escaped.
|
|
20 |
fixes:
|
|
21 |
- Use YAML lists to add multiple items to the same section.
|
|
22 |
- Another fix could be listed here.
|
16 | 23 |
other:
|
17 | 24 |
- |
|
18 | |
This bullet item includes a paragraph and a nested list.
|
|
25 |
This bullet item includes a paragraph and a nested list,
|
|
26 |
which works because the content of the YAML list item
|
|
27 |
is an escaped string block with reStructuredText formatting.
|
19 | 28 |
|
20 | 29 |
* list item 1
|
21 | 30 |
* list item 2
|
22 | 31 |
|
23 | |
::
|
|
32 |
.. code-block:: text
|
24 | 33 |
|
25 | 34 |
This example is also rendered
|
26 | 35 |
correctly on multiple lines
|
27 | 36 |
as a pre-formatted block.
|
28 | |
features:
|
29 | |
This note is a simple string, and does not retain its
|
30 | |
formatting when it is rendered in HTML.
|