diff --git a/docs/devGuide/design/architecture.md b/docs/devGuide/design/architecture.md index fa4d54ec6..949d5705b 100644 --- a/docs/devGuide/design/architecture.md +++ b/docs/devGuide/design/architecture.md @@ -60,5 +60,60 @@ Its syntax is also the most compatible and independent of the other stages. 3. Having processed possibly conflicting Nunjucks and Markdown syntax, HTML is then processed last. +### Demonstrating the content processing flow +To demonstrate the content processing flow, let's take a look at a small toy MarkBind file: +```markdown +{% raw %}{% set myVariable = "Item" %} + +# A basic level 1 header +There will be 5 items here: + + +A link that gets [converted](contents/topic1.md) + +{% endraw %} +``` + +At the first step of the processing flow, the `VariableProcessor` converts Nunjucks template code into HTML: +```markdown +{% raw %}# A basic level 1 header +There will be 5 items here: + + +A link that gets [converted](contents/topic1.md) + +{% endraw %} +``` +Notice that `myVariable` is consumed and that the unordered list is expanded. + +Next, the NodeProcessor converts Markdown to HTML: +```markdown +{% raw %}

A basic level 1 header

+

There will be 5 items here:

+ +

A link that gets converted

+
+
+

Topic 1

+
+

This is a placeholder page - more content to be added.

{% endraw %} +``` +It does this by traversing the node graph and matching node titles to their HTML equivalents. `include` nodes are recursively traversed and converted. + +After this, the content is embedded into the layout and the .html file is written to. + {% from "njk/common.njk" import previous_next %} -{{ previous_next('projectStructure', 'serverSideRendering') }} \ No newline at end of file +{{ previous_next('projectStructure', 'serverSideRendering') }}