diff --git a/docs/devGuide/design/architecture.md b/docs/devGuide/design/architecture.md
index de4629e21d..4a90d67899 100644
--- a/docs/devGuide/design/architecture.md
+++ b/docs/devGuide/design/architecture.md
@@ -12,9 +12,104 @@
This page provides an overview of the MarkBind's architecture.
+
-
+
+graph LR
+ %% --- Styling ---
+ classDef entry fill:#ffe6cc,stroke:#d79b00,stroke-width:2px;
+ classDef core fill:#dae8fc,stroke:#6c8ebf,stroke-width:2px;
+ classDef process fill:#e1f5fe,stroke:#4a90e2,stroke-width:2px;
+ classDef manager fill:#d5e8d4,stroke:#82b366,stroke-width:2px;
+ classDef vue fill:#f3e5f5,stroke:#b266b3,stroke-width:2px;
+ classDef output fill:#fff2cc,stroke:#d6b656,stroke-width:2px;
+
+ %% --- 1. Entry Point ---
+ CLI["index.js
CLI Entry"]:::entry
+
+ %% --- 2. Core Architecture ---
+ subgraph Core [Core Site Architecture]
+ direction TB
+ Site["Site
Orchestrates Build"]:::core
+ Page["Page
Per-File Processing"]:::core
+ end
+
+ %% --- 3. Resource Managers ---
+ subgraph Managers [Resource Managers]
+ direction TB
+ LM["LayoutManager
• Generate layouts
• Combine with page"]:::manager
+ EM["ExternalManager
• Generate dependencies
• Copy assets"]:::manager
+ end
+
+ %% --- 4. Content Processing Pipeline ---
+ subgraph Pipeline [Content Processing Pipeline]
+ direction TB
+
+ VP["VariableProcessor
Nunjucks Templates"]:::process
+
+ subgraph NodeProcessing [Node Processing]
+ direction TB
+ NP["NodeProcessor
DOM Traversal"]:::process
+ MP["Markdown Processing
markdown-it instance"]:::process
+ Note["Traverses DOM &
renders markdown attributes into vue slots using markdown-it"]:::process
+ HP["HTML element processing
• Link processing
• Flags externals for generation
in ExternalManager"]:::process
+ end
+
+ Layout["Apply Layout
LayoutManager.combine"]:::process
+ end
+
+ %% --- 5. Vue Rendering Layer ---
+ subgraph VueLayer [Vue Rendering Layer]
+ direction TB
+ VueCompile["PageVueServerRenderer
1. compileTemplate()
2. save .page-vue-render.js"]:::vue
+ SSR["renderVuePage()
Server-Side Render"]:::vue
+ Template["Template Rendering
page.njk"]:::vue
+ end
+
+ %% --- 6. Output & Client ---
+ subgraph Output [Output & Client]
+ direction TB
+ HTML["Static HTML File"]:::output
+ Hydrate["Client Hydration
createSSRApp().mount()"]:::output
+ VueComponents["@markbind/vue-components
Interactive Components"]:::output
+ end
+
+ %% --- RELATIONSHIPS ---
+ CLI --> Site
+ Site --> Page
+ Page -. "uses" .-> LM
+ Page -. "uses" .-> EM
+ LM -. "uses" .-> EM
+
+ Page --> VP
+ VP --> NP
+ NP --> Layout
+ Layout --> VueCompile
+ EM --> VueCompile
+
+ NP -. "uses" .-> MP
+ MP -.-> HP
+ HP -.-> Note
+ VueCompile --> SSR
+ SSR --> Template
+ Template --> HTML
+
+ HTML --> Hydrate
+ Hydrate --> VueComponents
+
+ Note -. "recursive" .-> VP
+
+ %% Styling Links
+ linkStyle 0,1 stroke:#3366CC,stroke-width:3px
+ linkStyle 2,3,4 stroke:#F28522,stroke-width:2px,stroke-dasharray: 5 5
+ linkStyle 5,6,7,8,9 stroke:#2D882D,stroke-width:3px
+ linkStyle 10,11,12 stroke:#b266b3,stroke-width:2px,stroke-dasharray: 5 5
+ linkStyle 13,14,15 stroke:#b266b3,stroke-width:3px
+ linkStyle 16 stroke:#d6b656,stroke-width:3px
+ linkStyle 17,18 stroke:#82b366,stroke-width:2px
+
+
The above diagram shows the key classes and content processing flow in MarkBind. You may note the following from these:
@@ -49,24 +144,28 @@ Note that generation of `External`s (e.g. ``) **do not fall wit
These are only flagged for generation, and then processed by `ExternalManager` **after**, in **another** similar content processing flow within an `External` instance.
-****Rationale****
+\***\*Rationale\*\***
This simple three stage flow provides a simple, predictable content processing flow for the user, and removes several other development concerns:
1. As the templating language of choice, Nunjucks is always processed first, allowing its templating capabilities to be used to the full extent.
-Its syntax is also the most compatible and independent of the other stages.
+ Its syntax is also the most compatible and independent of the other stages.
2. Secondly, Markdown is **rendered before HTML**, which produces more HTML. This also allows core Markdown features (e.g. code blocks) and Markdown plugins with eccentric syntaxes to be used without having to patch the HTML parser.
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:
+