From d6615105a0ce851cba724c9b4c8059a09c54593f Mon Sep 17 00:00:00 2001 From: Jonas Smedegaard Date: Mon, 26 May 2025 21:36:18 +0200 Subject: tightening and added example --- _pandoc.qmd | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/_pandoc.qmd b/_pandoc.qmd index b8c50a8..6df5b51 100644 --- a/_pandoc.qmd +++ b/_pandoc.qmd @@ -16,7 +16,7 @@ is shaped in the spirit of Markdown The Pandoc AST evolved from the needs of tracking Markdown. It mainly keeps track of structure of content, -and only to a limited extend handles layout: +and only to a limited extent handles layout: import from layout-rich document formats reduces such information, and export to layout-rich document formats use templates to effectively impose a normalized style. @@ -65,10 +65,16 @@ each representing an element of the content -- some object types containing lists of other element objects, and some themselves holding a string of content. -A Reader function breaks content into element objects, -e.g. the "Hello, world! example @fig-hello -(ignoring the metadata part) -gets broken down into these four elements: +A Reader function breaks content into element objects. +For example, this short Markdown text: + +```markdown +# Greeting + +Hello, world! +``` + +...gets broken down into these seven elements: * `Pandoc` block, containing two block objects * `Header` block, containing one inline objects @@ -88,6 +94,18 @@ where a line break requires explicit markup and any amount of simple space is treated as one soft-break, which means that it behaves as either a single word delimiting space or as a line break if needed by the rendering medium. +For example, this Markdown text: + +```markdown +This is +just one + line. +``` + +Renders (regarding spacing) in an output document such as HTML or PDF like this: + +> This is just one line. + Grouping content into sets of inline elements within block elements is aligned with HTML distinction between blocks and inlines, where content is either part of a relative loose string @@ -107,7 +125,7 @@ in the link target of all link elements. Since the full AST is available, the filter API can also be used to reorganise content, -e.g. to redefine plain tekst as belonging to a link, +e.g. to redefine plain text as belonging to a link, or vice versa, but if content is "put into the wrong boxes" (for example if parsed wrongly as is done in this project), -- cgit v1.2.3