Add contributing guideline on including external files

Signed-off-by: David Runge <dave@sleepmap.de>
This commit is contained in:
David Runge 2023-12-09 12:16:52 +01:00 committed by Heiko Schaefer
parent 90cca801ce
commit 4903214c7a
No known key found for this signature in database
GPG key ID: DAE9A9050FCCF1EB

View file

@ -56,6 +56,27 @@ The syntax follows what is available in [MyST-parser].
---
#### Including files
It is advisable to [include external files](https://myst-parser.readthedocs.io/en/latest/syntax/code_and_apis.html#including-code-from-files) with data, instead of using a code block to display the data.
---
**NOTE**: The reason for this is, that `codespell` is used to check for common spelling mistakes and output from other programs may contain text, that will trigger it to flag it as an error.
To work around this issue, `codespell` is configured to ignore example files, so that not entire chapter files have to be ignored.
---
Use the `{literalcode}` directive to include files:
````
```{literalinclude} examples/my-example.txt
:language: text
```
````
#### Cross-referencing
There are a few guidelines when it comes to cross-referencing, which work around oddities with [sphinx] and [MyST-parser]: