summaryrefslogtreecommitdiffstats
path: root/htmldoc/buildhtml.sh
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2018-12-28 14:42:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2018-12-28 14:42:52 +0000
commit12b9efaebb6d008437af4a72a98d05c4319fc825 (patch)
tree70876046e52ae898dd7327424f2c27fde1a5d45f /htmldoc/buildhtml.sh
parentReleasing debian version 1.11.0+dfsg-1~exp1. (diff)
downloadnetdata-12b9efaebb6d008437af4a72a98d05c4319fc825.tar.xz
netdata-12b9efaebb6d008437af4a72a98d05c4319fc825.zip
Merging upstream version 1.11.1+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'htmldoc/buildhtml.sh')
-rwxr-xr-xhtmldoc/buildhtml.sh33
1 files changed, 33 insertions, 0 deletions
diff --git a/htmldoc/buildhtml.sh b/htmldoc/buildhtml.sh
new file mode 100755
index 000000000..8a41f454f
--- /dev/null
+++ b/htmldoc/buildhtml.sh
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+# buildhtml.sh
+
+# Builds the html static site, using mkdocs
+# Assumes that the script is executed from the root netdata folder, by calling htmldoc/buildhtml.sh
+
+# Copy all netdata .md files to htmldoc/src. Exclude htmldoc itself and also the directory node_modules generated by Netlify
+echo "Copying files"
+rm -rf htmldoc/src
+find . -type d \( -path ./htmldoc -o -path ./node_modules \) -prune -o -name "*.md" -print | cpio -pd htmldoc/src
+
+# Modify the first line of the main README.md, to enable proper static html generation
+sed -i '0,/# netdata /s//# Introducing NetData\n\n/' htmldoc/src/README.md
+
+echo "Creating mkdocs.yaml"
+
+# Generate mkdocs.yaml
+htmldoc/buildyaml.sh > htmldoc/mkdocs.yml
+
+echo "Fixing links"
+
+# Fix links (recursively, all types, executing replacements)
+htmldoc/checklinks.sh -rax
+if [ $? -eq 1 ] ; then exit 1 ; fi
+
+echo "Calling mkdocs"
+
+# Build html docs
+mkdocs build --config-file=htmldoc/mkdocs.yml
+
+echo "Finished"
+