|
1 | | -# secvisogram-documentation |
| 1 | +# Secvisogram Documentation |
| 2 | + |
| 3 | +This repository contains documentation for secvisogram comprising specification and usage details. |
| 4 | +The documentation is integrated via git subtree in the secvisogram repository and published via GitHub pages at . |
| 5 | +Additionally, an author guide is generated as PDF document. |
| 6 | + |
| 7 | +## Generating the Author Guide |
| 8 | + |
| 9 | +The author guide is a concatenation of the usage documentation files compiled into an accessible PDF document. |
| 10 | +To generate this document the following steps are necessary: |
| 11 | + |
| 12 | +* Merge the usage documentation files (`*-usage.en.md`) using the script `md_merge.py`. |
| 13 | + |
| 14 | + `python docs/md_merge.py --input docs/user --lang en --output docs --name author_guide.md` |
| 15 | + |
| 16 | + This script allows for selecting a specific language, see the `--lang` flag. |
| 17 | + See [below](#translating-the-documentation) for details on how to translate the documentation. |
| 18 | + |
| 19 | +* Convert the resulting markdown file into docx format. |
| 20 | + |
| 21 | + `pandoc docs/author_guide.md -f markdown -t docx -o docs/author_guide.docx -V block-headings --table-of-contents --lua-filter=docs/filters.lua --defaults=docs/defaults.yaml` |
| 22 | + |
| 23 | +* Populate the documents' table of contents with a custom macro. |
| 24 | + |
| 25 | + `libreoffice --headless --invisible "macro:///Standard.customModule.UpdateIndexes(/absolute/path/to/author_guide.docx)"` |
| 26 | + |
| 27 | + This requires the [custom macro](https://github.com/secvisogram/secvisogram-documentation/blob/main/customModule.xba) to be available in libreoffice. |
| 28 | + |
| 29 | +* Convert the docx file into an accessible PDF with libreoffice. |
| 30 | + |
| 31 | + `libreoffice --headless --convert-to pdf:writer_pdf_Export --outdir docs docs/author_guide.docx` |
| 32 | + |
| 33 | + To generate an accessible PDF this requires Universal Access Compliance to be enabled in libreoffice. |
| 34 | + |
| 35 | +The title and author of the resulting document can be changed in `defaults.yaml`. |
| 36 | + |
| 37 | +A GitHub action is used to automate these steps and publish the English author guide as an artifact. |
| 38 | +See the [generate-author-guide.yml](https://github.com/secvisogram/secvisogram-documentation/blob/main/.github/workflows/generate-author-guide.yml) workflow. |
| 39 | + |
| 40 | +## Translating the Documentation |
| 41 | + |
| 42 | +The script `translate_docs.py` uses the [DeepL Translation API](https://www.deepl.com/pro-api) to bootstrap translation |
| 43 | +of the documentation in another language supported by the DeepL API. The DeepL API requires an API Key, check the |
| 44 | +[documentation](https://www.deepl.com/pro-api?cta=header-pro-api) for more information. |
| 45 | + |
| 46 | +Some effort is made to preserve formatting, but it is not guaranteed to be always correct in the translation results. |
| 47 | +Also, translations are most likely not perfect or coherent throughout all different files. |
| 48 | +It is highly recommended to manually check and correct the translations before adding them. |
0 commit comments