Skip to content

Commit d493f8c

Browse files
committed
docs: markdown faeatures
1 parent 89df9ef commit d493f8c

1 file changed

Lines changed: 32 additions & 5 deletions

File tree

guide/docs/docs.md

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
The Data Hub allows you to create generic documentation pages below the *Docs* section in the navigation.
44
For this create [Markdown files](https://www.markdownguide.org/basic-syntax/) inside the `./docs/` folder of your project.
55

6-
The File `Home.md` inside this folder is used to display the home page of your Data Hub. Other than that you free to create any and as many files as needed. The navigation shows the up to one folder depth.
6+
The File `Home.md` inside this folder is used to display the home page of your Data Hub. Other than that you free to create any and as many files as needed. The navigation shows files up to one folder depth.
77

8-
- To **sort** the items in the navigation you can prepend a prefix to filename like this `10_*`, `20_*`, … This prefix will not show in the navigation item name.
8+
- To **sort** the items in the navigation you can prepend a prefix to the filename like this `10_*`, `20_*`, … This prefix will not show in the navigation item name.
99
- For **translating** pages you can create files with the same name but an additional suffix consisting of the language code, i.e., if `Project.md` contains the English variant, `Project.de.md` contains the German one. English is expected to be the default language.
1010

11-
Additionally, you can add a front matter, a YAML based configuration between `---` separators at the beginning of your Markdown files consisting of further attributes of the files. This can be used to change the display name of an entry, i.e., for translated pages that should not have the file (English) name as navigation entry use this:
11+
Additionally, you can add a front matter, a YAML based configuration before a `---` separator at the beginning of your Markdown files consisting of further attributes of the files. This can be used to change the display name of an entry, i.e., for translated pages that should not have the filename (English) as navigation link:
1212

1313

1414
```md [Project.de.md]
@@ -21,13 +21,40 @@ title: Projekt
2121
Lorem… 
2222
```
2323

24-
## Images
24+
## Links
2525

26-
You can add images to your documentation, the files need to be placed inside the folder `./docs/images/`. Inside the Markdown files include them with `![]({% static <filename> %})`. For example the image at `./docs/images/example.png` would be included by `![]({% static "example.png" %})`.
26+
Besides the standard way of creating links in markdown (`[<text>](<url>)`), you can also link to parts of the Data Hub.
27+
28+
To link to other markdown pages inside the `docs/`folder use the filepath form the `docs/` folder, i.e., `[other page](./10_Other page.md)` (the path needs to originate in `docs/`).
29+
30+
To link to Shapes, Shape types and Data Layers you can use the following syntax. If you leave the text empty it will be automatically set to the name of the object.
31+
32+
- Shapes: `[](shape_key=<key>)`
33+
- Shape type: `[](type_key=<key>)`
34+
- Data Layer: `[](datalayer_key=<key>)`
35+
36+
Additionally you can also use the Django Template URL tag like this: `[]({% url "<app>:<name>" [parameters] %})`
37+
38+
## Images & files
39+
40+
To insert images in a document you can use the standard Markdown syntax for images `![<alt text>](<path>)`. The path should originate form `docs/`, i.e., `![alt](./image.png`) to include the image saved at `docs/image.png`.
41+
42+
If you need more complex markup in an HTML `<img>` you can use the `{% file "<path>" %}` Django Template tag like this:
43+
44+
```
45+
<img src="{% file './images/GabonDepartments.svg' %}" alt="...">
46+
```
47+
48+
The path again needs to originate from inside the `docs/` folder.
49+
50+
This can also be used inside links to, i.e. link to files: `[PDF file]({% file './infos.pdf' %})`.
2751

2852

2953
## Variables
3054

3155
The Markdown content gets processed by the Django Template Engine beforehand. So you can also use variables and template tags available from the Django framework. The variables names need to be put between double curly braces like this <code v-pre>{{ var_name }}</code>.
3256

57+
| Variable name | Content |
58+
| -------------------- | ----------------------------- |
59+
| `{{ datahub_name }}` | Name of the Data Hub instance |
3360

0 commit comments

Comments
 (0)