Skip to content

Commit f9765f9

Browse files
committed
Improve use of diagrams
1 parent 34c85ec commit f9765f9

2 files changed

Lines changed: 80 additions & 21 deletions

File tree

docs/configuration.md

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,22 @@ project/
1919

2020
## Configuration Workflow
2121

22+
For every page, your main configuration (for all documents), document configuration (for all pages of this document) and the page configuration are merged to form the context provided to your page template.
23+
2224
```mermaid
23-
graph TD
24-
Main[Main config] -->|merge| Document[Document config]
25-
Document -->|merge| Page[Page config]
26-
Template[SVG Template] -.- Page
27-
Template -->|render| SVG[SVG Page]
25+
flowchart TD
26+
subgraph Configuration
27+
Main[YAML Main Config] -->|inherits| Doc[YAML Document Config]
28+
Doc -->|inherits| Page[YAML Page Config]
29+
end
30+
31+
subgraph Page Processing
32+
Template[SVG Template]
33+
Page -->|context| Render[Template Rendering]
34+
Template -->|jinja2| Render
35+
Render -->|output| SVG[SVG File]
36+
SVG -->|cairosvg| PDF[PDF File]
37+
end
2838
```
2939

3040
## Main Configuration File

docs/overview.md

Lines changed: 65 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,76 @@ documents with minimal effort.
1313
- **Custom Processing**: Extend the processing workflow with Python
1414
- **PDF Compression**: Optional compression of final PDFs
1515

16+
## Quickstart
17+
18+
For a quick introduction, see the [README](../README.md).
19+
20+
## Workflow
21+
22+
### From configuration to PDF documents
23+
24+
Your main configuration defines which documents to create.<br>Each document configuration defines which pages make up the document.
25+
1626
```mermaid
17-
graph TD
18-
Main[Main config] -->|merge| Document[Document config]
19-
Document -->|merge| Page[Page config]
20-
Template[SVG Template] -.- Page
21-
Template -->|render| SVG[SVG Page]
22-
SVG -->|convert| PDF[PDF Page]
27+
flowchart TD
28+
Main[YAML Main Config] -->|document 1| Doc1[Document Processing]
29+
Main -->|document 2| Doc2[Document Processing]
30+
31+
subgraph Document1[Document]
32+
Doc1 -->|page 1| Page1[Page Processing]
33+
Doc1 -->|page 2| Page2[Page Processing]
34+
Doc1 -->|page n| PageN[Page Processing]
35+
36+
Page1 --> PDF1[PDF File Page 1]
37+
Page2 --> PDF2[PDF File Page 2]
38+
PageN --> PDFN[PDF File Page ...]
39+
40+
PDF1 --> PDF[PDF Pages]
41+
PDF2 --> PDF[PDF Pages]
42+
PDFN --> PDF[PDF Pages]
43+
44+
PDF -->|combine| PDFDocument[PDF Document]
45+
end
46+
47+
Doc2 -->|pages| Doc2PageProcessing[...]
48+
Doc2PageProcessing --> Doc2PageFile[...]
49+
Doc2PageFile --> Doc2Pages[...]
50+
Doc2Pages -->|combine| Doc2PDFDocument[PDF Document]
51+
```
2352

53+
### Inheriting common values
54+
55+
Settings in the main configuration are available to all documents.<br>Settings in a document configuration are available to all of its pages.<br>Each page configuration can hold page-specific settings/content, so that the template of page is only responsible for layout/design.
56+
57+
```mermaid
58+
flowchart TD
59+
subgraph Configuration
60+
Main[YAML Main Config] -->|inherits| Doc[YAML Document Config]
61+
Doc -->|inherits| Page[YAML Page Config]
62+
end
63+
64+
subgraph Page Processing
65+
Template[SVG Template]
66+
Page -->|context| Render[Template Rendering]
67+
Template -->|jinja2| Render
68+
Render -->|output| SVG[SVG File]
69+
SVG -->|cairosvg| PDF[PDF File]
70+
end
2471
```
2572

73+
### Pages make up a document
74+
75+
After each page template was rendered and the resulting SVG file converted to PDF, these page PDFs are combined to create the document.<br>This may optionally get compressed for a nice end result.
76+
2677
```mermaid
27-
graph LR
28-
Page1[PDF Page 1] -->|combine| Document[PDF Document]
29-
Page2[PDF Page 2] -->|combine| Document
30-
PageN[PDF Page ...] -->|combine| Document
31-
Document -.->|compress| Compressed[PDF Document compressed]
32-
linkStyle 3 stroke-dasharray: 5 5
78+
flowchart LR
79+
subgraph Document Creation
80+
Page1[PDF File Page 1] -->|combine| Document[PDF Document]
81+
Page2[PDF File Page 2] -->|combine| Document
82+
PageN[PDF File Page ...] -->|combine| Document
83+
Document -.->|ghostscript| Compressed[PDF Document compressed]
84+
linkStyle 3 stroke-dasharray: 5 5
85+
end
3386
```
3487

3588
## Documentation
@@ -38,10 +91,6 @@ graph LR
3891
- [Document Variants](variants.md) - Create multiple versions of a document
3992
- [Custom Processing](custom_processing.md) - Extend the processing workflow
4093

41-
## Quickstart
42-
43-
For a quick introduction, see the [README](../README.md).
44-
4594
## Examples
4695

4796
See the [examples](examples) directory:

0 commit comments

Comments
 (0)