0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-21 04:10:38 +00:00
netdata_netdata/htmldoc/buildhtml.sh
Chris Akritidis 1149ce3240 Sanitize headers and htmlstructure ()
* Restructured html site, corrected header in REDISTRIBUTED

* Added header

* Header updates and restructuring

* Move requirements and runtime txts to htmldoc, by adding a netlify.toml that changes the base directory

* Minor corrections to support the html doc restructuring

* Debugging netlify

* Debugging netlify

* Debugging netlify

* Beautify headers, comment in buildhtml

* Beautify headers

* Sanitize headers and reorganize static html site

* Updated Makefile with moved and created htmldoc scripts
2018-11-23 01:16:56 +02:00

55 lines
2 KiB
Bash
Executable file

#!/bin/bash
# buildhtml.sh
# Builds the html static site, using mkdocs
# Assumes that the script is executed either from the htmldoc folder (by netlify), or from the root repo dir (as originally intended)
currentdir=$(pwd | awk -F '/' '{print $NF}')
if [ $currentdir = "htmldoc" ] ; then
cd ..
fi
# 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//# Introduction\n\n/' htmldoc/src/README.md
# Remove specific files that don't belong in the documentation
rm htmldoc/src/HISTORICAL_CHANGELOG.md
rm htmldoc/src/collectors/charts.d.plugin/mem_apps/README.md
rm htmldoc/src/collectors/charts.d.plugin/postfix/README.md
rm htmldoc/src/collectors/charts.d.plugin/tomcat/README.md
rm htmldoc/src/collectors/charts.d.plugin/sensors/README.md
rm htmldoc/src/collectors/charts.d.plugin/cpu_apps/README.md
rm htmldoc/src/collectors/charts.d.plugin/squid/README.md
rm htmldoc/src/collectors/charts.d.plugin/nginx/README.md
rm htmldoc/src/collectors/charts.d.plugin/hddtemp/README.md
rm htmldoc/src/collectors/charts.d.plugin/cpufreq/README.md
rm htmldoc/src/collectors/charts.d.plugin/mysql/README.md
rm htmldoc/src/collectors/charts.d.plugin/exim/README.md
rm htmldoc/src/collectors/charts.d.plugin/apache/README.md
rm htmldoc/src/collectors/charts.d.plugin/load_average/README.md
rm htmldoc/src/collectors/charts.d.plugin/phpfpm/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"