-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheditor-manual.qmd
More file actions
1238 lines (823 loc) · 47 KB
/
editor-manual.qmd
File metadata and controls
1238 lines (823 loc) · 47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Guide for Writing Techncial Documentation"
subtitle: "Copernicus Land Monitoring Service"
author: "European Environment Agency (EEA)"
version: 0.6
description: "A comprehensive guide for creating technical documentation for the Copernicus
Land Monitoring Service using Quarto. It covers Markdown basics, document rendering,
and the review process, ensuring consistency and clarity in documentation."
date: "2025-06-04"
template-version: 1.0
format:
html: default
---
<!--# maybe we should promote (or at least describe the option of unsing variables in yaml that can be reused in the document: e.g. product-name: "Example Product" --- # Welcome to {{ product-name }} Documentation. -->
# Introduction
This manual guides users through creating technical documentation for the Copernicus Land Monitoring Service using [**Quarto**](https://quarto.org/). Quarto simplifies the process of writing professional documents in [**Markdown**](https://www.markdownguide.org/), and converting them into **HTML** and **PDF** for nice publishing. The manual covers basic Markdown writing, document rendering, as well a the review, and publication process of technical CLMS documents. It also describes the project folder structure, template usage, and common mistakes to avoid.
::: callout-note
You don't need to be a programmer nor an expert to use Quarto. If you've ever written a document in Microsoft Word, you'll be able to use Quarto with a bit of practice.
:::
## Folder and File Structure
<!--# If this is for the doc part only, does it make sense to mention also the potential insert into an IT project, but can exist also on their own...(something like this, just mentioning it) -->
This section explains how your documentation project is organized and where to put your files. The structure ensures consistency, simplifies maintenance, and allows documents to be rendered correctly in both your local project and the central Technical Library.
Below is the standard folder layout you'll see at the root of the `DOCS/` directory in your project:
```text
DOCS/
├── _meta/ # Scripts, config, and metadata (do not edit)
├── includes/ # Quarto include files (do not edit)
├── templates/ # Document templates (do not edit)
├── theme/ # Styling definitions (do not edit)
├── _quarto.yml # Project-wide Quarto config
├── CLMS_your-product-one_ATBD.qmd
├── CLMS_your-product-one_ATBD-media/
├── CLMS_your-product-two_PUM.qmd
├── CLMS_your-product-two_PUM-media/
├── ...
└── CLMS_your-product-last_PUM.qmd
```
### What You Should Do
- You simply need to **add your own `.qmd` files** in the `DOCS/` directory.
- If your document uses charts, screenshots, or diagrams, create a **media folder** with the same base name as your document and a `-media` suffix.
Example:
```text
DOCS/
├── CLMS_your-product-one_ATBD.qmd
└── CLMS_your-product-one_ATBD-media/
└── figure1.png
```
- Do **not modify** the following folders: `_meta/`, `includes/`, `templates/`, `theme/`. These are managed centrally.
- **`templates/`**
This is where you’ll find ready-to-use `.qmd` templates. There are templates for two document types:
- **ATBD** (Algorithm Theoretical Basis Document)
- **PUM** (Product User Manual)
When you start a new document, copy the appropriate template from this directory. This ensures consistency in structure and formatting across all documents in the Technical Library.
- Styling and rendering will **automatically reflect** the structure and appearance defined by the central documentation project.
### Previewing Your Documentation
To preview the full rendered documentation from your project, use:
```bash
git docs-preview
```
For more details on previewing and validating, see the final chapter of this manual.
# Basic Markdown Syntax
::: callout-note
In addition to this guide and the official documentation, you can also explore the template `.qmd` files in the `templates` folder. These files include real examples of how to structure documents using Markdown and Quarto-specific syntax. They're a great reference when you're not sure how to format something.
:::
Markdown is a simple way to format text using plain characters --- no need for complicated tools or buttons. Quarto uses Markdown to let you write clean, readable documents that can be turned into HTML or PDF automatically.
This section shows the most useful Markdown elements you'll need when writing documentation. If you want to explore more, visit the official [Quarto Markdown guide](https://quarto.org/docs/authoring/markdown-basics.html).
## Line Breaks and New Lines
In Markdown, how you break a line can affect how your text is displayed in the final document. Quarto follows standard Markdown behavior, so it's important to understand the difference between soft and hard line breaks.
### Soft Line Break (Just Pressing Enter)
When you press `Enter` once and start a new line in your text editor, Markdown **does not** create a visible line break in the output. Instead, it treats the two lines as part of the same paragraph.
Example (input):
```markdown
This is the first line
and this is the second line.
```
Rendered output:
This is the first line
and this is the second line.
This keeps your Markdown source tidy, but it won’t create new lines unless explicitly instructed
### Hard Line Break (Using \ at End of Line)
To force a visible line break in Markdown, you must add two spaces at the end of a line or use a backslash `\`. Quarto supports both, but using `\` is clearer and more explicit.
```markdown
This is the first line.\
and this is the second line.
```
Rendered output:
This is the first line.\
and this is the second line.
### Paragraph Break (Double Enter)
If you press Enter twice (i.e., leave a blank line between two lines), Markdown will treat the content as two separate paragraphs. This results in a larger vertical space between the lines in the rendered output.
Example (input):
```markdown
This is the first paragraph.
This is the second paragraph.
```
Rendered output:
This is the first paragraph.
This is the second paragraph.
This behavior is especially important when structuring readable documentation, separating ideas, or organizing content clearly.
### Summary
- Use `Enter` for a new line in your editor, but **don’t expect a visible line break**.
- Use `\` at the end of a line when you want to **force a line break**.
- Use **double Enter** (i.e., an empty line between paragraphs) to start a **new paragraph with extra spacing**.
## Headings
Use the `#` symbol to create headings and organize your content. More `#` means a smaller heading level:
``` markdown
# Title (Level 1)
## Section (Level 2)
### Subsection (Level 3)
```
## Paragraphs and Line Breaks
Just write text normally to create a paragraph. Leave an empty line between paragraphs.\
To create a **line break** inside a paragraph, end the line with two spaces:
``` markdown
This is one line.
This is another line.
```
## Bold and Italic Text
- *Italic* --- use one asterisk or underscore: `*italic*` or `_italic_`\
- **Bold** --- use two asterisks: `**bold**`\
- ***Bold and italic*** --- use three asterisks: `***bold and italic***`
## Lists
### Bullet (Unordered) List
``` markdown
- Item one
- Item two
- Subitem
```
### Numbered (Ordered) List
``` markdown
1. First step
2. Second step
1. Sub-step
```
::: callout-important
Make sure to include a blank line between list items, and ensure they are correctly indented. This ensures proper rendering in .docx and .pdf outputs. Without these, list entries may merge, misalign, or render incorrectly.
:::
### Paragraphs Within List Items
To include a paragraph or a block of text as part of a list item, indent the paragraph to match the indentation of the list content. Also, make sure the paragraph follows the list item without a blank line, or it may break the list.
```markdown
- This is the list item title.
This is a paragraph that belongs to the same list item.
It should be indented to align with the start of "This is a paragraph..."
- Another item
With its own paragraph block.
```
### Single-Item List Rendering Issue
When a list or sublist contains only one item, it can be incorrectly rendered in .docx or .pdf formats. In such cases, the item may appear in the wrong font or style.
To fix this, apply a custom style to the single list item. In the provided Word template, use the style named "NormalLine".
Here is how to apply it:
```markdown
- step 1
- [step 1.1]{custom-style="NormalLine"}\
```
::: callout-note
- The custom-style attribute ensures the correct formatting.
- Don't forget to include the backslash (\) at the end of the line to prevent unwanted spacing or breaks.
:::
## Links and Images
### Link
``` markdown
[Quarto website](https://quarto.org)
```
### Image
Place image files in your `media/` folder, and use:
``` markdown

```
## Code Blocks and Inline Code
### Inline code
Use backticks (\`) to highlight short code inside a sentence:
``` markdown
Use the `render` button to build your document.
```
Rendered result:
Use the `render` button to build your document.
### Code block
Use triple backticks for larger code examples:
```` markdown
```python
print("Hello, world!")
```
````
Rendered result:
``` python
print("Hello, world!")
```
You can replace `python` with other languages like `bash`, `r`, or `json`.
## Tables
Tables are a great way to present structured information. Below are two common ways to create them, along with rendered previews.
::: callout-tip
## If you like there are several table generators on the internet which can help you generating markdown or html tables.
:::
### Simple (Pipe) Table
``` markdown
| Name | Role | Status |
|-----------:|------------|:--------:|
| Alice | Developer | *Active* |
| Bob | Reviewer | **Pending** |
: Demonstration of pipe table syntax
```
Rendered result:
| Name | Role | Status |
|------:|-----------|:-----------:|
| Alice | Developer | *Active* |
| Bob | Reviewer | **Pending** |
: Demonstration of pipe table syntax
Make sure to align columns using `|` and `-`.
### HTML-style Table (for advanced layouts)
``` markdown
```{=html}
<table style="border-collapse: collapse; width: 100%; font-size: 14px;">
<thead style="background-color: #2c3e50; color: black;">
<tr>
<th colspan="3" style="padding: 10px; border: 1px solid #ccc; text-align: center;">
Document Workflow Overview
</th>
</tr>
<tr>
<th style="padding: 8px; border: 1px solid #ccc;">Step</th>
<th style="padding: 8px; border: 1px solid #ccc;">Task</th>
<th style="padding: 8px; border: 1px solid #ccc;">Details</th>
</tr>
</thead>
<tbody style="background-color: #ecf0f1;">
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">1</td>
<td style="padding: 8px; border: 1px solid #ccc;">Initialize Project</td>
<td style="padding: 8px; border: 1px solid #ccc;">Set up folder structure and copy base template</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">2</td>
<td colspan="2" style="padding: 8px; border: 1px solid #ccc;">Create and configure `.qmd` file</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">3</td>
<td style="padding: 8px; border: 1px solid #ccc;">Write Content</td>
<td style="padding: 8px; border: 1px solid #ccc;">
Add sections, insert media, and apply styles.<br>
Use templates to ensure structure consistency.
</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">4</td>
<td style="padding: 8px; border: 1px solid #ccc;">Render Output</td>
<td style="padding: 8px; border: 1px solid #ccc;">
<ul style="margin: 0; padding-left: 20px;">
<li>HTML for preview</li>
<li>DOCX for formatting check</li>
<li>PDF via automation</li>
</ul>
</td>
</tr>
<tr>
<td colspan="3" style="padding: 8px; border: 1px solid #ccc; background-color: #d1ecf1; text-align: center;">
✅ All steps completed — document ready for review
</td>
</tr>
</tbody>
</table>
```
Rendered result:
```{=html}
<table style="border-collapse: collapse; width: 100%; font-size: 14px;">
<thead style="background-color: #2c3e50; color: black;">
<tr>
<th colspan="3" style="padding: 10px; border: 1px solid #ccc; text-align: center;">
Document Workflow Overview
</th>
</tr>
<tr>
<th style="padding: 8px; border: 1px solid #ccc;">Step</th>
<th style="padding: 8px; border: 1px solid #ccc;">Task</th>
<th style="padding: 8px; border: 1px solid #ccc;">Details</th>
</tr>
</thead>
<tbody style="background-color: #ecf0f1;">
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">1</td>
<td style="padding: 8px; border: 1px solid #ccc;">Initialize Project</td>
<td style="padding: 8px; border: 1px solid #ccc;">Set up folder structure and copy base template</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">2</td>
<td colspan="2" style="padding: 8px; border: 1px solid #ccc;">Create and configure `.qmd` file</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">3</td>
<td style="padding: 8px; border: 1px solid #ccc;">Write Content</td>
<td style="padding: 8px; border: 1px solid #ccc;">
Add sections, insert media, and apply styles.<br>
Use templates to ensure structure consistency.
</td>
</tr>
<tr>
<td style="padding: 8px; border: 1px solid #ccc;">4</td>
<td style="padding: 8px; border: 1px solid #ccc;">Render Output</td>
<td style="padding: 8px; border: 1px solid #ccc;">
<ul style="margin: 0; padding-left: 20px;">
<li>HTML for preview</li>
<li>DOCX for formatting check</li>
<li>PDF via automation</li>
</ul>
</td>
</tr>
<tr>
<td colspan="3" style="padding: 8px; border: 1px solid #ccc; background-color: #d1ecf1; text-align: center;">
✅ All steps completed — document ready for review
</td>
</tr>
</tbody>
</table>
```
::: callout-warning
Avoid using **nested tables** (a table inside another table) when writing documentation intended for DOCX or PDF output. While this might work in HTML, it often causes serious rendering problems in Word or during PDF conversion — such as layout breakage, invisible borders, or unreadable formatting.
✅ Instead of nesting:
- Reorganize the content into a simpler layout
- Split one large complex table into two or more smaller tables placed one after another
This ensures your document remains clean, readable, and properly formatted across all output formats.
:::
## Figures (with captions and layout)
You can add figures using this special block format:
``` markdown
::: {.figure}

A short caption for the figure.
:::
```
You can also use layout options, like `fig-align="center"` or `fig-width="80%"` in advanced cases.\
More: <https://quarto.org/docs/authoring/figures.html>
## Showing Images in Multiple Columns or Rows
Sometimes you want to display a group of images side by side or in a grid. This is useful for comparisons or visual overviews. The following approaches work well in both HTML and DOCX outputs, including when converting to PDF.
------------------------------------------------------------------------
### Without Captions
You can use a Markdown table to arrange images in multiple columns and rows:
``` markdown
| {width=120} | {width=120} | {width=120} |
|----------------------------|----------------------------|----------------------------|
| {width=120} | {width=120} | {width=120} |
```
This creates two rows with three images each. Adjust the width as needed to fit your layout.
------------------------------------------------------------------------
### With Captions
To add captions under each image, simply include a row of text below each row of images:
``` markdown
| {width=120} | {width=120} | {width=120} |
|:------------------------:|:------------------------:|:------------------------:|
| Caption 1 | Caption 2 | Caption 3 |
| {width=120} | {width=120} | {width=120} |
| Caption 4 | Caption 5 | Caption 6 |
```
This method keeps captions aligned with each image, and works across all output formats.
> ⚠️ **Note:** Tables used for captions will show borders in DOCX and PDF outputs. Removing them requires custom styles in a reference DOCX.
## Page Breaks for .docx/.pdf Outputs
In Quarto, using section breaks (like - - -) may not reliably produce a page break in .docx or .pdf outputs. Instead, to insert a page break that appears only in those formats, use the following block: that appears only in .docx or .pdf outputs, use the following block:
```markdown
::: {.content-visible format=docx}
```{=openxml}
<w:p><w:r><w:br w:type="page"/></w:r></w:p>
:::
```
This will ensure that the page break is included in the rendered Word or PDF document, but not visible in HTML or other formats.
## Equations
Quarto supports mathematical equations using LaTeX-style syntax. You can add inline equations or display equations as blocks.
### Inline Equations
Use single dollar signs `$...$` for inline math:
``` markdown
The formula for the area is $A = \pi r^2$.
```
Rendered result:
The formula for the area is $A = \pi r^2$.
### Display Equations
Use double dollar signs `$$...$$` to show a larger, centered equation block:
``` markdown
$$
E = mc^2
$$
```
Rendered result:
$$
E = mc^2
$$
You can use most standard LaTeX math symbols and operators.\
For more examples, check the [Quarto math documentation](https://quarto.org/docs/authoring/markdown-basics.html#equations).
## Diagrams
Quarto supports diagrams using **mermaid** and **dot**. Just use a code block like this:
### Mermaid example
```` markdown
```{mermaid}
flowchart LR
A[Hard edge] --> B(Round edge)
B --> C{Decision}
C --> D[Result one]
C --> E[Result two]
```
````
```{mermaid}
flowchart LR
A[Hard edge] --> B(Round edge)
B --> C{Decision}
C --> D[Result one]
C --> E[Result two]
```
### Dot example
```` markdown
```{dot}
digraph DocumentationWorkflow {
node [shape=box, style=rounded]
Start -> "Create .qmd File"
"Create .qmd File" -> "Write Content"
"Write Content" -> "Render to HTML"
"Write Content" -> "Render to DOCX"
"Render to DOCX" -> "Convert to PDF"
"Render to HTML" -> Review
"Convert to PDF" -> Review
Review -> "Push to GitHub"
"Push to GitHub" -> Done
Done [shape=ellipse, style=filled, fillcolor=lightgrey]
}
```
````
```{dot}
digraph DocumentationWorkflow {
node [shape=box, style=rounded]
Start -> "Create .qmd File"
"Create .qmd File" -> "Write Content"
"Write Content" -> "Render to HTML"
"Write Content" -> "Render to DOCX"
"Render to DOCX" -> "Convert to PDF"
"Render to HTML" -> Review
"Convert to PDF" -> Review
Review -> "Push to GitHub"
"Push to GitHub" -> Done
Done [shape=ellipse, style=filled, fillcolor=lightgrey]
}
```
More: <https://quarto.org/docs/authoring/diagrams.html>
## Footnotes
You can add footnotes to explain details without interrupting the main text. Use `[^1]` where you want the footnote, and define the footnote at the bottom:
``` markdown
This is a sentence with a footnote.[^1]
[^1]: This is the footnote content.
```
Rendered result:
This is a sentence with a footnote.[^1]
[^1]: This is the footnote content.
## Notebook Output Embeds
If you're working with code notebooks (like Jupyter or R Markdown), you can include outputs such as plots or tables directly in the document. Quarto will automatically embed them after the code block.
More: <https://quarto.org/docs/authoring/notebook-embed.html>
# Creating New Documentation
Creating a new document is simple when you follow a clear workflow. You can either start from a ready-made template or create a file from scratch.
## Step 1: Start a New File
There are two ways to begin:
### Option 1: Use a Template
1. Open the `templates/` folder.
2. Choose the right template:
- ``` CLMS``_Template``_ATBD.qmd ``` for an Algorithm Theoretical Basis Document (ATBD)
- ``` CLMS``_Template``_PUM.qmd ``` for a Product User Manual (PUM)
3. Copy the template into the `products/` folder.
4. Rename it to match your new document. Example: `my-product.qmd`
5. Create a new media folder named `my-product-media/` next to it to store images and charts.
### Option 2: Create from scratch
1. Inside the `products/` folder, create a new file: e.g. `my-product.qmd`
2. Create a new media folder named `my-product-media/` for related images and figures.
> 💡 Using templates is recommended because they include structure and helpful comments. But starting from scratch gives you full control.
## Step 2: Understand and Use the Template
Templates include:
- A pre-filled YAML header (the part at the top with `---`)
- Required sections and headings
- Helpful comments you should keep while editing
> 💡 If you use an already defined template, the YAML header is included — you don’t need to add it manually.
## Step 3: Add or Adjust the YAML Header
If you're creating the `.qmd` file from scratch (i.e. not using one of the provided ATBD or PUM templates), you typically **do not need to specify the `format` field** manually. Quarto will automatically apply its default rendering format, which is sufficient in most cases.
However, if you need to customize the rendering outputs (e.g. to apply a specific DOCX style), then you **must define the `format:` field** carefully.
These fields are **required** for correct rendering:
- `format`: controls how your document is rendered (HTML, styled DOCX, PDF)
::: callout-important
You **must include** the `pdf: default` format in the YAML header.
Although PDF is not rendered directly during this step, defining it here ensures compatibility with the automated rendering workflow later. Details are explained in the [Rendering Documentation](#rendering-documentation) section.
:::
If you override the `format` section, please follow these strict guidelines:
- Only modify the `format:` block.
- You must define all three output formats:
- `html:`
- `docx:` (with `reference-doc:` pointing to the style template)
- `pdf:`
Improper modifications can break the rendering process locally or in the central Technical Library. To see correct examples of a fully-defined format block, refer to the template files in `DOCS/templates/`.
Here's a basic header you can use:
``` markdown
---
title: "Product SHORT NAME"
subtitle: "Product full name"
date: "2022-10-06"
version: 1.0
template-version: 1.0.0
product-name: Product Name
description: "Product DESCRIPTION"
---
```
### Field Descriptions:
- `title`: The main title of the document (displayed in the rendered output).
- `subtitle`: An optional second line of text under the title.
- `date`: The publication or last updated date.
- `version`: The version of your document (e.g. "1.0", "v2.3-draft").
- `template-version`: **Not rendered** — this is a special internal field that helps keep track of which template was originally used. Do not remove or modify this field unless you're updating the template version intentionally.
> These fields must be filled in by the user. Only other fields — such as shared configuration or output format — are pre-filled in the template.
# Importance of File Naming
Each `.qmd` file has a filename, like `my-document.qmd`, and this name plays an important role in how your documentation is organized and accessed online.
The filename (without the `.qmd` extension):
- Is used to generate the final HTML file name.
- Becomes part of the document’s **URL** after publishing.
**Example:** If your file is named `products/data-guide.qmd`, the published URL will be `https://your-docs-site.org/products/data-guide.html`.
To avoid issues:
- Choose a clear, short, and consistent name when creating the file.
- Avoid renaming it later, as it can break links and references.
- Use lowercase letters and dashes (e.g. `product-user-manual.qmd`).
::: callout-important
Stick with the original name once created unless you have a strong reason and can update all links accordingly.
:::
# Ready-Made QMD Templates
To make documentation creation easier and more consistent, you can start your work from ready-made `.qmd` template files. These templates include the correct structure, required sections, and helpful comments to guide your editing.
Templates are stored in the `templates/` directory. Currently, two types of templates are provided:
## ATBD Template
**Filename:** ``` CLMS``_Template``_ATBD.qmd ```
This template is used for creating an **Algorithm Theoretical Basis Document (ATBD)**.
It includes:
- A structured outline based on standard ATBD requirements
- Placeholder sections for theory, algorithm descriptions, validation, and references
- YAML metadata pre-filled with necessary fields and style settings
- Commented guidance within each section
> 💡 Use this template when documenting the scientific or technical foundation of a data product.
## PUM Template
**Filename:** ``` CLMS``_Template``_PUM.qmd ```
This template is used for creating a **Product User Manual (PUM)**.
It includes:
- Sections for product overview, data access, interpretation, and use
- Notes on where to insert images, tables, and figures
- YAML header configured for standard rendering
> 💡 Use this template when documenting how users should interact with or interpret a product.
## How to Use the Templates
1. Go to `templates/`
2. Choose either ``` CLMS``_Template``_ATBD.qmd ``` or ``` CLMS``_Template``_PUM.qmd ```
3. Copy the file into the `products/` folder
4. Rename it to match your project (e.g. `my-product.qmd`)
5. Begin editing based on the guidance in the template
If you're unsure which template to use, ask your team lead or check what was used in previous similar documents.
::: callout-important
Do not modify the structure of the template unless absolutely necessary.\
Keeping the structure consistent across all documents ensures that the documentation system stays clear, professional, and easy to navigate for all users and reviewers.
:::
# Using Pandoc to Convert DOCX to QMD
When translating existing documents from Word (`.docx`) into Quarto Markdown (`.qmd`), you can use **Pandoc** to quickly generate a base file. This can save time by preserving text structure, headings, and even tables — though the result will still need cleanup.
## What is Pandoc?
[Pandoc](https://pandoc.org/installing.html) is a powerful command-line tool that can convert documents between various formats, including Markdown, DOCX, HTML, LaTeX, and more.
To use Pandoc on your computer, download and install it from the official site: <https://pandoc.org/installing.html>
## When and How to Use It
Use Pandoc **only** for converting existing `.docx` documents into `.qmd`. Do **not** use it to convert PDFs — Pandoc does not support PDF as an input format. This approach is ideal when you're: <!--# state that 'the system is doing that for you' -->
- Migrating legacy documentation into the Quarto system
- Creating a quick starting point for manual cleanup
- Extracting embedded images and figures from `.docx`
## Basic Usage Example
Open a terminal or command prompt — ideally from within **RStudio’s Terminal tab** so you can stay in one environment — and run the following command. You can provide either a relative or full path to the `.docx` file:
``` bash
$ pandoc my-doc.docx -o my-doc.qmd --wrap=none --from=docx --to=markdown+fenced_divs+grid_tables+pipe_tables+smart
```
### What this command does:
- `my-doc.docx`: The input Word document.
- `-o my-doc.qmd`: Output file in Markdown format.
- `--wrap=none`: Prevents Pandoc from breaking long lines into multiple lines.
- `--from=docx`: Specifies that the input file is a Word document.
- `--to=markdown+fenced_divs+grid_tables+pipe_tables+smart`: Sets output format and enables enhanced table and layout options.
## Where Are Media Files Stored?
When Pandoc finds images or other media in the `.docx` file, it extracts them automatically into a new folder.\
By default, extracted media will be placed into a subfolder named `media/`, located next to your output `.qmd` file. <!--# so it does not do the docname-media?-->\
This is created automatically and will contain all image assets referenced in the converted file.
### Changing the Media Folder Name
You can change the default media folder name using the `--extract-media` option:
``` bash
$ pandoc my-doc.docx -o my-doc.qmd --extract-media=custom-media-folder
```
::: callout-note
Pandoc will create a `media/` subfolder *inside* the folder you specify. For example, running the above command will result in:
```
custom-media-folder/media/
```
If you want to follow the structure expected by your project (e.g. `my-doc-media/`), make sure to move the contents **out of that inner `media/` folder** and place them in the right location manually.
:::
## Next Steps
After conversion, you’ll likely need to:
- Clean up unnecessary styles or extra spacing
- Rename and organize media files <!--# pls cross referenc to it -->
- Add a proper YAML header at the top of the `.qmd` file <!--# pls cross referenc to it -->
- Restructure the content to match your template or documentation style <!--# pls cross referenc to it -->
While not perfect, this method gives you a solid starting point — especially for long or complex documents.
# Default Styles and Options
To make documentation look consistent and professional, we use a set of predefined styles and settings. These are applied automatically when you render your `.qmd` files, so you don't need to worry about design details --- just focus on the content.
## Shared Styling Configuration
Most formatting options (fonts, colors, spacing, margins, etc.) are defined in shared configuration files. These files are stored in `styles` directory and include:
- A custom DOCX file for styling PDF output
- A CSS stylesheet for HTML
- Metadata files for shared fields like project name, institution, and contributors
Don't edit them! --- they're used automatically by the rendering scripts.
## Theme <!--# is this somewhere? I do not fully understnd what this is about? in the YAML?-->
It ensures that all documents have a clean, modern, and consistent appearance --- both in HTML and PDF output.
> This theme is applied automatically. You do not need to configure it manually in your documents.
## Table of Contents
The table of contents (TOC) is enabled by default and appears on the left-hand side in HTML documents.
You can control how many heading levels are shown by adjusting `toc-depth` in your YAML header, though the default setting (`toc-depth: 3`) is usually enough.
## Customizing Per-Document Settings
If needed, you can override the default styles or add extra options in your document's YAML header. For example:
``` markdown
format:
html:
toc: true
toc-depth: 3
docx:
reference-doc: ../styles/custom-reference.docx
pdf: default
```
# Automatic Keywords Generation
You do not need to manually add keywords to your document’s metadata. The system is designed to handle this automatically using AI during the publishing workflow.
## How It Works
- The default Quarto metadata configuration automatically injects a special placeholder value into the `keywords:` field in your document’s header.
- When your document is rendered and processed for publication, an AI service analyzes its content and automatically generates **10 relevant keywords**.
- These keywords help with document indexing, search, and classification on the publication platform.
This process ensures consistent keyword formatting and reduces the work required from authors.
## What You Should Do
Nothing!\
Simply leave the `keywords:` field untouched or omit it entirely. The publishing system will take care of it for you.
If you do add custom keywords for internal purposes, they will be overwritten during the publishing step — so it’s best to let the system manage them.
# Using RStudio with Quarto <!--# we may group the software prerequisites in one chapter? -->
[RStudio](https://posit.co/products/open-source/rstudio/) is the recommended tool for working with `.qmd` (Quarto Markdown) files. It provides a simple, user-friendly interface for writing, editing, and rendering documentation.
You don't need to know R to use RStudio --- we only use it here as a Markdown editor with rendering features.
## Opening Your Project
1. Open RStudio.
2. Use **File \> Open Project...** and select the root folder of the Technical Library.
3. Navigate to the `products/` folder.
4. Open the `.qmd` file you want to edit.
## Editing QMD Files
You can edit `.qmd` files just like regular text documents. RStudio provides:
- Syntax highlighting for Markdown and code blocks
- A live preview of rendered output
- Auto-saving and formatting support
- Instant feedback when rendering errors occur
Use the **Preview on Save** option (checkbox in the toolbar) to automatically render your file every time you save it. This makes editing more efficient.
## Managing Media Files
If your document uses images or diagrams:
- Place them in a dedicated media folder (e.g. `my-doc-media/`)
- Use relative paths in your `.qmd` file, like:
``` markdown

```
# Rendering Documentation {#rendering-documentation}
Once your `.qmd` file is ready, the next step is to render it --- this means turning it into a final document that can be published. Quarto supports multiple output formats, but in our workflow, we focus on: **HTML** and **PDF**.
You can render your documentation directly in RStudio as described below or using command-line tools, depending on what you prefer. Both options work the same way and produce identical results --- choose the one that fits your workflow best.
## Render to HTML
<!--# there is also "Render webside" under build on the top right side. if that is relevant here add a screenshot and clarify the difference between the two -->
HTML is the default output format and is useful for previewing your document in a web browser while you work. Rendered HTML uses the custom Technical Library theme and includes a table of contents, clickable navigation, and consistent styles. It's a great way to check formatting, layout, and images as you write.
There are two ways to preview your `.qmd` file:
- Click the **Render** button at the top of the RStudio window. 
- Or enable **Preview on Save** (in the RStudio IDE toolbar). This option automatically re-renders your document every time you save it. 
After clicking the **Render** button (or saving the file with **Preview on Save** enabled), the HTML version of your document will appear in the **Viewer** tab, located in the **Output** pane (typically in the lower right corner of RStudio).

If the **Viewer** tab is not visible:
1. Go to **Tools \> Global Options** in the top menu.
2. Navigate to the **R Markdown** section.
3. Ensure that **Show output preview in:** is set to **Viewer Pane**.
{height="300px"}
This setting ensures that rendered documents are displayed within RStudio, providing a seamless preview experience.
## Render to PDF via DOCX and LibreOffice
PDFs are not generated directly by Quarto. Instead, the process involves a few automatic steps:
1. Quarto first generates a `.docx` (Word) file using the styles and settings defined in the YAML header and shared config files.
2. Then, a LibreOffice macro automatically converts the `.docx` to `.pdf`. <!--# in this case libreoffice is a software prerequisit and should be listed as such. I am not sure what the state is of libre vs MSword script is? -->
3. The resulting PDF file is saved in the output location.
This approach ensures consistent and well-formatted PDFs, even across different systems.
::: callout-important
- Make sure `pdf: default` is included in your YAML header --- this triggers the PDF pipeline.
- Do not define custom `pdf:` options unless you know what you're doing. <!--# wasn't there an order what must be placed first? docx then pdf, of is pdf enough and your macro ensures the libre workflow? -->
:::
### Preview with DOCX Instead of PDF
Instead of manually generating a PDF (which involves running scripts or waiting for the automated conversion), you can simply render a `.docx` file. It will look almost exactly like the final PDF because it uses the same styles and layout rules.
This is a great option when you want to quickly check how your document will look in PDF format — especially while you're still editing the `.qmd` file.
You don't need to change the order of output formats in the YAML header. Just click the **black arrow next to the Render button** in RStudio and select **“Render MS Word”** from the dropdown menu.