summaryrefslogtreecommitdiffstats
path: root/docs/generator/buildhtml.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docs/generator/buildhtml.sh')
-rwxr-xr-xdocs/generator/buildhtml.sh20
1 files changed, 15 insertions, 5 deletions
diff --git a/docs/generator/buildhtml.sh b/docs/generator/buildhtml.sh
index 3cc87d29f8..3f73420815 100755
--- a/docs/generator/buildhtml.sh
+++ b/docs/generator/buildhtml.sh
@@ -14,6 +14,10 @@ if [ "$currentdir" = "generator" ]; then
fi
GENERATOR_DIR="docs/generator"
+# Fetch go.d.plugin docs
+rm -rf ./collectors/go.d.plugin
+git clone https://github.com/netdata/go.d.plugin.git ./collectors/go.d.plugin
+
# Copy all netdata .md files to docs/generator/src. Exclude htmldoc itself and also the directory node_modules generatord by Netlify
echo "Copying files"
rm -rf ${GENERATOR_DIR}/src
@@ -22,6 +26,8 @@ find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o
# Copy netdata html resources
cp -a ./${GENERATOR_DIR}/custom ./${GENERATOR_DIR}/src/
+
+
# Modify the first line of the main README.md, to enable proper static html generation
echo "Modifying README header"
sed -i -e '0,/# netdata /s//# Introduction\n\n/' ${GENERATOR_DIR}/src/README.md
@@ -50,11 +56,15 @@ echo "Fixing links"
# Fix links (recursively, all types, executing replacements)
${GENERATOR_DIR}/checklinks.sh -rax
-if [ "${1}" != "nomkdocs" ] ; then
- echo "Calling mkdocs"
+echo "Calling mkdocs"
- # Build html docs
- mkdocs build --config-file=${GENERATOR_DIR}/mkdocs.yml
-fi
+# Build html docs
+mkdocs build --config-file=${GENERATOR_DIR}/mkdocs.yml
+
+# Fix edit buttons for the markdowns that are not on the main netdata repo
+find ${GENERATOR_DIR}/build/collectors/go.d.plugin -name "*.html" -print0 | xargs -0 sed -i -e 's/https:\/\/github.com\/netdata\/netdata\/blob\/master\/collectors\/go.d.plugin/https:\/\/github.com\/netdata\/go.d.plugin\/blob\/master/g'
+
+# Remove the cloned go.d.plugin project
+rm -rf ./collectors/go.d.plugin
echo "Finished"