Usage Examples¶
Examples round tripping reStructuredText.
CL-USER> (common-doc.format:emit-to-string
(make-instance 'common-doc-restructuredtext:restructuredtext)
(common-doc.format:parse-document
(make-instance 'common-doc-restructuredtext:restructuredtext)
"
Heading
#######
Subtitle
^^^^^^^^
Paragraph text
Heading 3
`````````
* item1
* item2
* item3
* item4
"))
"=======
Heading
=======
:Date: 2023-07-30T21:11:34.469497+02:00
**Subtitle**
Paragraph text
Heading 3
=========
- item1
- item2
- item3
- item4
"
Parsing a document that doesn’t begin with a heading. This will prevent promotion of the first heading to a title.
CL-USER> (common-doc.format:emit-to-string
(make-instance 'common-doc-restructuredtext:restructuredtext)
(common-doc.format:parse-document
(make-instance 'common-doc-restructuredtext:restructuredtext)
"
Document without a title
Heading
#######
Subtitle
^^^^^^^^
Paragraph text
Heading 3
`````````
* item1
* item2
* item3
* item4
"))
"Document without a title
Heading
=======
Subtitle
--------
Paragraph text
Heading 3
`````````
- item1
- item2
- item3
- item4
"