From 0b5dcfb460d865dab4d284ff61db2e34ce214f19 Mon Sep 17 00:00:00 2001 From: Mo8it Date: Sun, 16 Jan 2022 16:13:48 +0100 Subject: [PATCH] Added update_docs.sh --- advlabdb/templates/docs/admin.html | 2908 ++++-------------------- advlabdb/templates/docs/assistant.html | 2908 ++++-------------------- docs/README.adoc | 14 + docs/update_docs.sh | 24 + 4 files changed, 932 insertions(+), 4922 deletions(-) create mode 100644 docs/README.adoc create mode 100644 docs/update_docs.sh diff --git a/advlabdb/templates/docs/admin.html b/advlabdb/templates/docs/admin.html index 266eef9..520cc90 100644 --- a/advlabdb/templates/docs/admin.html +++ b/advlabdb/templates/docs/admin.html @@ -1,2468 +1,454 @@ +{% raw %} - - - - - - Admin documentation - - + + + + +Admin documentation + + - - -
+ +
-
- +
+ - - \ No newline at end of file + +{% endraw %} diff --git a/advlabdb/templates/docs/assistant.html b/advlabdb/templates/docs/assistant.html index 881ae4c..db57b82 100644 --- a/advlabdb/templates/docs/assistant.html +++ b/advlabdb/templates/docs/assistant.html @@ -1,2468 +1,454 @@ +{% raw %} - - - - - - Assistant documentation - - + + + + +Assistant documentation + + - - -
+ +
-
- +
+ - - \ No newline at end of file + +{% endraw %} diff --git a/docs/README.adoc b/docs/README.adoc new file mode 100644 index 0000000..2050342 --- /dev/null +++ b/docs/README.adoc @@ -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 +---- diff --git a/docs/update_docs.sh b/docs/update_docs.sh new file mode 100644 index 0000000..0ca6946 --- /dev/null +++ b/docs/update_docs.sh @@ -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