1
0
Fork 0
mirror of https://codeberg.org/Mo8it/AdvLabDB.git synced 2024-09-19 18:31:16 +00:00

Added update_docs.sh

This commit is contained in:
Mo 2022-01-16 16:13:48 +01:00
parent 0fbe584b4e
commit 0b5dcfb460
4 changed files with 932 additions and 4922 deletions

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

14
docs/README.adoc Normal file
View file

@ -0,0 +1,14 @@
= Updating documentation
After changing the documentation files with the `.adoc` extension in this directory, the script `update_docs.sh` has to be run to update the related html files in the directory `advlabdb/advlabdb/templates/docs`.
IMPORTANT: You have to `cd` into the `advlabdb/docs` directory where the script, this README and the documentation files with the `.adoc` extenstion are located before running the script!
IMPORTANT: The packages `fd` (`find` alternative) and `asciidoctor` have to be installed!
Run the script with:
[source,bash]
----
bash update_docs.sh
----

24
docs/update_docs.sh Normal file
View file

@ -0,0 +1,24 @@
#!/usr/bin/bash
# Needed packages: fd (find alternative), asciidoctor
# You have to cd into the docs directory where this script is located before running it!
# List of documentation files
doc_file_names=$(fd -d 1 -t f --extension adoc --exclude "README.adoc")
for doc_file_name in $doc_file_names
do
doc_file_name_without_extension=${doc_file_name::-5}
output_path=../advlabdb/templates/docs/$doc_file_name_without_extension.html
# Convert to html with asciidoctor
asciidoctor -v --backend html5 $doc_file_name -o $output_path
# Add the Jinja raw tag
sed -i "1i {% raw %}" $output_path
echo -e "\n{% endraw %}" >> $output_path
# Done
echo "Generated $output_path"
done