Skip to content

Commit

Permalink
Add go.d documentation and modify collector menu (#5215)
Browse files Browse the repository at this point in the history
docs/generator/buildyaml.sh
* Modified menu structure of collectors
* Added go.d plugin

docs/generator/buildhtml.sh
* Added go.d documentation (git clone). Clean up the go.d cloned dir before and after execution
* Replace page edit links to github for go.d.plugin. Removed nomkdocs option which doesn't work with this.
  • Loading branch information
cakrit committed Feb 6, 2019
1 parent 59419c7 commit d054de0
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ collectors/charts.d.plugin/charts.d.plugin
collectors/node.d.plugin/node.d.plugin
collectors/python.d.plugin/python.d.plugin
collectors/fping.plugin/fping.plugin
collectors/go.d.plugin

# installer generated files
netdata-uninstaller.sh
Expand Down
20 changes: 15 additions & 5 deletions docs/generator/buildhtml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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"
63 changes: 39 additions & 24 deletions docs/generator/buildyaml.sh
Original file line number Diff line number Diff line change
Expand Up @@ -174,31 +174,46 @@ navpart 3 collectors/freebsd.plugin
navpart 3 collectors/macos.plugin

navpart 2 collectors/plugins.d "" "External plugins"
navpart 3 collectors/python.d.plugin "" "Python modules" 3
navpart 3 collectors/node.d.plugin "" "Node.js modules" 3
echo -ne " - BASH modules:

echo -ne " - Go:
- 'collectors/go.d.plugin/README.md'
"
navpart 4 collectors/go.d.plugin "" "Modules" 3 excludefirstlevel

echo -ne " - Python:
- 'collectors/python.d.plugin/README.md'
"
navpart 4 collectors/python.d.plugin "" "Modules" 3 excludefirstlevel

echo -ne " - Node.js:
- 'collectors/node.d.plugin/README.md'
"
navpart 4 collectors/node.d.plugin "" "Modules" 3 excludefirstlevel

echo -ne " - BASH:
- 'collectors/charts.d.plugin/README.md'
- 'collectors/charts.d.plugin/ap/README.md'
- 'collectors/charts.d.plugin/apcupsd/README.md'
- 'collectors/charts.d.plugin/example/README.md'
- 'collectors/charts.d.plugin/libreswan/README.md'
- 'collectors/charts.d.plugin/nut/README.md'
- 'collectors/charts.d.plugin/opensips/README.md'
- Obsolete BASH modules:
- 'collectors/charts.d.plugin/mem_apps/README.md'
- 'collectors/charts.d.plugin/postfix/README.md'
- 'collectors/charts.d.plugin/tomcat/README.md'
- 'collectors/charts.d.plugin/sensors/README.md'
- 'collectors/charts.d.plugin/cpu_apps/README.md'
- 'collectors/charts.d.plugin/squid/README.md'
- 'collectors/charts.d.plugin/nginx/README.md'
- 'collectors/charts.d.plugin/hddtemp/README.md'
- 'collectors/charts.d.plugin/cpufreq/README.md'
- 'collectors/charts.d.plugin/mysql/README.md'
- 'collectors/charts.d.plugin/exim/README.md'
- 'collectors/charts.d.plugin/apache/README.md'
- 'collectors/charts.d.plugin/load_average/README.md'
- 'collectors/charts.d.plugin/phpfpm/README.md'
- Modules:
- 'collectors/charts.d.plugin/ap/README.md'
- 'collectors/charts.d.plugin/apcupsd/README.md'
- 'collectors/charts.d.plugin/example/README.md'
- 'collectors/charts.d.plugin/libreswan/README.md'
- 'collectors/charts.d.plugin/nut/README.md'
- 'collectors/charts.d.plugin/opensips/README.md'
- Obsolete Modules:
- 'collectors/charts.d.plugin/mem_apps/README.md'
- 'collectors/charts.d.plugin/postfix/README.md'
- 'collectors/charts.d.plugin/tomcat/README.md'
- 'collectors/charts.d.plugin/sensors/README.md'
- 'collectors/charts.d.plugin/cpu_apps/README.md'
- 'collectors/charts.d.plugin/squid/README.md'
- 'collectors/charts.d.plugin/nginx/README.md'
- 'collectors/charts.d.plugin/hddtemp/README.md'
- 'collectors/charts.d.plugin/cpufreq/README.md'
- 'collectors/charts.d.plugin/mysql/README.md'
- 'collectors/charts.d.plugin/exim/README.md'
- 'collectors/charts.d.plugin/apache/README.md'
- 'collectors/charts.d.plugin/load_average/README.md'
- 'collectors/charts.d.plugin/phpfpm/README.md'
"

navpart 3 collectors/fping.plugin
Expand Down

0 comments on commit d054de0

Please sign in to comment.