Rename `doc` to `docs` and move `htmldoc` (#4741)
* rename doc dir; move htmldoc under docs/generator * run shellcheck and shfmt on docs generator
Paweł Krupa committed
Nov 25, 2018 at 20:11 UTC
5ed8653246b5ff277e39d90328782e326b245d4f
33 files changed
+199
-197
.gitignore
+3
-3
@@ -145,6 +145,6 @@ sitespeed-result/
145
python.d/python-modules-installer.sh
146
147
# documentation generated files
148
-htmldoc/src
149
-htmldoc/build
150
-htmldoc/mkdocs.yml
148
+docs/generator/src
149
+docs/generator/build
150
+docs/generator/mkdocs.yml
Makefile.am
+21
-21
@@ -62,22 +62,22 @@ dist_noinst_DATA= \
62
netdata.cppcheck \
63
netdata.spec \
64
package.json \
65
- doc/Add-more-charts-to-netdata.md \
66
- doc/Demo-Sites.md \
67
- doc/Donations-netdata-has-received.md \
68
- doc/Netdata-Security-and-Disclosure-Information.md \
69
- doc/Performance.md \
70
- doc/Running-behind-apache.md \
71
- doc/Running-behind-caddy.md \
72
- doc/Running-behind-lighttpd.md \
73
- doc/Running-behind-nginx.md \
74
- doc/Third-Party-Plugins.md \
75
- doc/a-github-star-is-important.md \
76
- doc/high-performance-netdata.md \
77
- doc/netdata-for-IoT.md \
78
- doc/netdata-security.md \
79
- doc/Why-Netdata.md \
80
- htmldoc/themes/material/partials/footer.html \
65
+ docs/Add-more-charts-to-netdata.md \
66
+ docs/Demo-Sites.md \
67
+ docs/Donations-netdata-has-received.md \
68
+ docs/Netdata-Security-and-Disclosure-Information.md \
69
+ docs/Performance.md \
70
+ docs/Running-behind-apache.md \
71
+ docs/Running-behind-caddy.md \
72
+ docs/Running-behind-lighttpd.md \
73
+ docs/Running-behind-nginx.md \
74
+ docs/Third-Party-Plugins.md \
75
+ docs/a-github-star-is-important.md \
76
+ docs/high-performance-netdata.md \
77
+ docs/netdata-for-IoT.md \
78
+ docs/netdata-security.md \
79
+ docs/Why-Netdata.md \
80
+ docs/generator/themes/material/partials/footer.html \
81
installer/README.md \
82
installer/UNINSTALL.md \
83
installer/UPDATE.md \
@@ -92,11 +92,11 @@ dist_noinst_SCRIPTS= \
92
kickstart-static64.sh \
93
netdata-installer.sh \
94
installer/functions.sh \
95
- htmldoc/buildhtml.sh \
96
- htmldoc/buildyaml.sh \
97
- htmldoc/checklinks.sh \
98
- htmldoc/requirements.txt \
99
- htmldoc/runtime.txt \
95
+ docs/generator/buildhtml.sh \
96
+ docs/generator/buildyaml.sh \
97
+ docs/generator/checklinks.sh \
98
+ docs/generator/requirements.txt \
99
+ docs/generator/runtime.txt \
100
$(NULL)
101
102
# -----------------------------------------------------------------------------
daemon/config/README.md
+2
-2
@@ -36,7 +36,7 @@ debug log|`/var/log/netdata/debug.log`|The filename to save debug information. T
36
error log|`/var/log/netdata/error.log`|The filename to save error messages for netdata daemon and all plugins (`stderr` is sent here for all netdata programs, including the plugins). You can also set it to `syslog` to send the errors to syslog, or `none` to disable this log.
37
access log|`/var/log/netdata/access.log`|The filename to save the log of web clients accessing netdata charts. You can also set it to `syslog` to send the access log to syslog, or `none` to disable this log.
38
memory mode|save|When set to `save` netdata will save its round robin database on exit and load it on startup. When set to `map` the cache files will be updated in real time (check `man mmap` - do not set this on systems with heavy load or slow disks - the disks will continuously sync the in-memory database of netdata). When set to `ram` the round robin database will be temporary and it will be lost when netdata exits.
39
-update every|1|The frequency in seconds, for data collection. For more information see [Performance](../../doc/Performance.md#performance).
39
+update every|1|The frequency in seconds, for data collection. For more information see [Performance](../../docs/Performance.md#performance).
40
run as user|`netdata`|The user netdata will run as.
41
web files owner|`netdata`|The user that owns the web static files. Netdata will refuse to serve a file that is not owned by this user, even if it has read access to that file. If the user given is not found, netdata will only serve files owned by user given in `run as user`.
42
http port listen backlog|100|The port backlog. Check `man 2 listen`.
@@ -107,7 +107,7 @@ External plugins will have only 2 options at `netdata.conf`:
107
108
setting | default | info
109
:------:|:-------:|:----
110
-update every|the value of `[global].update every` setting|The frequency in seconds the plugin should collect values. For more information check [Performance](../../doc/Performance.md#performance).
110
+update every|the value of `[global].update every` setting|The frequency in seconds the plugin should collect values. For more information check [Performance](../../docs/Performance.md#performance).
111
command options|*empty*|Additional command line options to pass to the plugin.
112
113
External plugins that need additional configuration may support a dedicated file in `/etc/netdata`. Check their documentation.
docker/Dockerfile
+1
-1
@@ -88,7 +88,7 @@ COPY --from=builder /app /
88
89
RUN \
90
# Apply permissions as described in
91
- # https://github.com/netdata/netdata/tree/master/doc/netdata-security.md#netdata-directories
91
+ # https://github.com/netdata/netdata/tree/master/docs/netdata-security.md#netdata-directories
92
chown -R root:netdata /etc/netdata && \
93
chown -R netdata:netdata /var/cache/netdata /var/lib/netdata /usr/share/netdata && \
94
chown -R root:netdata /usr/lib/netdata && \
docs/Add-more-charts-to-netdata.md
renamed
docs/Demo-Sites.md
renamed
docs/Donations-netdata-has-received.md
renamed
docs/GettingStarted.md
renamed
docs/Netdata-Security-and-Disclosure-Information.md
renamed
docs/Performance.md
renamed
docs/Running-behind-apache.md
renamed
docs/Running-behind-caddy.md
renamed
docs/Running-behind-lighttpd.md
renamed
docs/Running-behind-nginx.md
renamed
docs/Third-Party-Plugins.md
renamed
docs/Why-Netdata.md
renamed
docs/a-github-star-is-important.md
renamed
docs/generator/buildhtml.sh
new
+60
@@ -0,0 +1,60 @@
1
+#!/bin/bash
2
+
3
+# buildhtml.sh
4
+
5
+# Builds the html static site, using mkdocs
6
+# Assumes that the script is executed either from the htmldoc folder (by netlify), or from the root repo dir (as originally intended)
7
+currentdir=$(pwd | awk -F '/' '{print $NF}')
8
+echo "$currentdir"
9
+if [ "$currentdir" = "generator" ]; then
10
+ cd ../..
11
+fi
12
+GENERATOR_DIR="docs/generator"
13
+
14
+# Copy all netdata .md files to docs/generator/src. Exclude htmldoc itself and also the directory node_modules generatord by Netlify
15
+echo "Copying files"
16
+rm -rf ${GENERATOR_DIR}/src
17
+find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o -name "*.md" -print | cpio -pd ${GENERATOR_DIR}/src
18
+
19
+# Modify the first line of the main README.md, to enable proper static html generation
20
+sed -i '0,/# netdata /s//# Introduction\n\n/' ${GENERATOR_DIR}/src/README.md
21
+
22
+# Remove specific files that don't belong in the documentation
23
+declare -a EXCLUDE_LIST=(
24
+ "HISTORICAL_CHANGELOG.md"
25
+ "collectors/charts.d.plugin/mem_apps/README.md"
26
+ "collectors/charts.d.plugin/postfix/README.md"
27
+ "collectors/charts.d.plugin/tomcat/README.md"
28
+ "collectors/charts.d.plugin/sensors/README.md"
29
+ "collectors/charts.d.plugin/cpu_apps/README.md"
30
+ "collectors/charts.d.plugin/squid/README.md"
31
+ "collectors/charts.d.plugin/nginx/README.md"
32
+ "collectors/charts.d.plugin/hddtemp/README.md"
33
+ "collectors/charts.d.plugin/cpufreq/README.md"
34
+ "collectors/charts.d.plugin/mysql/README.md"
35
+ "collectors/charts.d.plugin/exim/README.md"
36
+ "collectors/charts.d.plugin/apache/README.md"
37
+ "collectors/charts.d.plugin/load_average/README.md"
38
+ "collectors/charts.d.plugin/phpfpm/README.md"
39
+)
40
+for f in "${EXCLUDE_LIST[@]}"; do
41
+ rm "${GENERATOR_DIR}/src/$f"
42
+done
43
+
44
+echo "Creating mkdocs.yaml"
45
+
46
+# Generate mkdocs.yaml
47
+${GENERATOR_DIR}/buildyaml.sh >${GENERATOR_DIR}/mkdocs.yml
48
+
49
+echo "Fixing links"
50
+
51
+# Fix links (recursively, all types, executing replacements)
52
+${GENERATOR_DIR}/checklinks.sh -rax
53
+if [ $? -eq 1 ]; then exit 1; fi
54
+
55
+echo "Calling mkdocs"
56
+
57
+# Build html docs
58
+mkdocs build --config-file=${GENERATOR_DIR}/mkdocs.yml
59
+
60
+echo "Finished"
docs/generator/buildyaml.sh
renamed
+47
-53
@@ -1,6 +1,7 @@
1
#!/bin/bash
2
3
-cd htmldoc/src
3
+GENERATOR_DIR="docs/generator"
4
+cd ${GENERATOR_DIR}/src
5
6
# create yaml nav subtree with all the files directly under a specific directory
7
# arguments:
@@ -11,37 +12,36 @@ cd htmldoc/src
12
# maxdepth - how many levels of subdirectories do I include in the yaml in this section. 1 means just the top level and is the default if left empty
13
# excludefirstlevel - Optional param. If passed, mindepth is set to 2, to exclude the READMEs in the first directory level
14
14
-navpart () {
15
- tabs=$1
16
- dir=$2
17
- file=$3
18
- section=$4
19
- maxdepth=$5
20
- excludefirstlevel=$6
21
- spc=""
22
-
23
- i=1
24
- while [ ${i} -lt ${tabs} ] ; do
25
- spc=" $spc"
26
- i=$[$i + 1]
27
- done
28
-
29
- if [ -z "$file" ] ; then file='*' ; fi
30
- if [[ ! -z "$section" ]] ; then echo "$spc- ${section}:" ; fi
31
- if [ -z "$maxdepth" ] ; then maxdepth=1; fi
32
- if [[ ! -z "$excludefirstlevel" ]] ; then mindepth=2 ; else mindepth=1; fi
33
-
34
- for f in $(find $dir -mindepth $mindepth -maxdepth $maxdepth -name "${file}.md" -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F '\0' '{print $3}'); do
35
- # If I'm adding a section, I need the child links to be one level deeper than the requested level in "tabs"
36
- if [ -z "$section" ] ; then
37
- echo "$spc- '$f'"
38
- else
39
- echo "$spc - '$f'"
40
- fi
41
- done
15
+navpart() {
16
+ tabs=$1
17
+ dir=$2
18
+ file=$3
19
+ section=$4
20
+ maxdepth=$5
21
+ excludefirstlevel=$6
22
+ spc=""
23
+
24
+ i=1
25
+ while [ ${i} -lt ${tabs} ]; do
26
+ spc=" $spc"
27
+ i=$((i + 1))
28
+ done
29
+
30
+ if [ -z "$file" ]; then file='*'; fi
31
+ if [[ -n $section ]]; then echo "$spc- ${section}:"; fi
32
+ if [ -z "$maxdepth" ]; then maxdepth=1; fi
33
+ if [[ -n $excludefirstlevel ]]; then mindepth=2; else mindepth=1; fi
34
+
35
+ for f in $(find $dir -mindepth $mindepth -maxdepth $maxdepth -name "${file}.md" -printf '%h\0%d\0%p\n' | sort -t '\0' -n | awk -F '\0' '{print $3}'); do
36
+ # If I'm adding a section, I need the child links to be one level deeper than the requested level in "tabs"
37
+ if [ -z "$section" ]; then
38
+ echo "$spc- '$f'"
39
+ else
40
+ echo "$spc - '$f'"
41
+ fi
42
+ done
43
}
44
44
-
45
echo -e 'site_name: NetData Documentation
46
repo_url: https://github.com/netdata/netdata
47
repo_name: GitHub
@@ -51,6 +51,7 @@ copyright: NetData, 2018
51
docs_dir: src
52
site_dir: build
53
#use_directory_urls: false
54
+strict: true
55
theme:
56
name: "material"
57
custom_dir: themes/material
@@ -100,11 +101,11 @@ nav:'
101
102
navpart 1 . README "About"
103
103
-echo -ne " - 'doc/Why-Netdata.md'
104
- - 'doc/Demo-Sites.md'
105
- - 'doc/netdata-security.md'
106
- - 'doc/Donations-netdata-has-received.md'
107
- - 'doc/a-github-star-is-important.md'
104
+echo -ne " - 'docs/Why-Netdata.md'
105
+ - 'docs/Demo-Sites.md'
106
+ - 'docs/netdata-security.md'
107
+ - 'docs/Donations-netdata-has-received.md'
108
+ - 'docs/a-github-star-is-important.md'
109
- REDISTRIBUTED.md
110
- CHANGELOG.md
111
"
@@ -116,7 +117,7 @@ echo -ne "- Installation:
117
- 'installer/UNINSTALL.md'
118
"
119
119
-echo -ne "- 'doc/GettingStarted.md'
120
+echo -ne "- 'docs/GettingStarted.md'
121
"
122
123
echo -ne "- Running netdata:
@@ -127,23 +128,22 @@ navpart 2 daemon/config
128
navpart 2 web/server "" "Web server"
129
navpart 3 web/server "" "" 2 excludefirstlevel
130
echo -ne " - Running behind another web server:
130
- - 'doc/Running-behind-nginx.md'
131
- - 'doc/Running-behind-apache.md'
132
- - 'doc/Running-behind-lighttpd.md'
133
- - 'doc/Running-behind-caddy.md'
131
+ - 'docs/Running-behind-nginx.md'
132
+ - 'docs/Running-behind-apache.md'
133
+ - 'docs/Running-behind-lighttpd.md'
134
+ - 'docs/Running-behind-caddy.md'
135
"
136
#navpart 2 system
137
navpart 2 database
138
navpart 2 registry
139
139
-echo -ne " - 'doc/Performance.md'
140
- - 'doc/netdata-for-IoT.md'
141
- - 'doc/high-performance-netdata.md'
140
+echo -ne " - 'docs/Performance.md'
141
+ - 'docs/netdata-for-IoT.md'
142
+ - 'docs/high-performance-netdata.md'
143
"
144
144
-
145
navpart 1 collectors "" "Data collection" 1
146
-echo -ne " - 'doc/Add-more-charts-to-netdata.md'
146
+echo -ne " - 'docs/Add-more-charts-to-netdata.md'
147
- Internal plugins:
148
"
149
navpart 3 collectors/proc.plugin
@@ -165,7 +165,7 @@ navpart 3 collectors/apps.plugin
165
navpart 3 collectors/fping.plugin
166
navpart 3 collectors/freeipmi.plugin
167
168
-echo -ne " - 'doc/Third-Party-Plugins.md'
168
+echo -ne " - 'docs/Third-Party-Plugins.md'
169
"
170
171
navpart 1 health README "Alarms and notifications"
@@ -189,7 +189,7 @@ navpart 2 web/api/queries "" "Queries" 2
189
echo -ne "- Hacking netdata:
190
- CONTRIBUTING.md
191
- CODE_OF_CONDUCT.md
192
- - 'doc/Netdata-Security-and-Disclosure-Information.md'
192
+ - 'docs/Netdata-Security-and-Disclosure-Information.md'
193
- CONTRIBUTORS.md
194
"
195
navpart 2 makeself "" "" 4
@@ -198,9 +198,3 @@ navpart 2 libnetdata "" "libnetdata" 4
198
navpart 2 contrib
199
navpart 2 tests
200
navpart 2 diagrams/data_structures
201
-
202
-
203
-
204
-
205
-
206
-
docs/generator/checklinks.sh
renamed
+53
-50
@@ -1,15 +1,18 @@
1
#!/bin/bash
2
+# shellcheck disable=SC2181
3
4
# Doc link checker
5
# Validates and tries to fix all links that will cause issues either in the repo, or in the html site
6
7
+GENERATOR_DIR="docs/generator"
8
+
9
dbg () {
7
- if [ $VERBOSE -eq 1 ] ; then printf "%s\n" "${1}" ; fi
10
+ if [ "$VERBOSE" -eq 1 ] ; then printf "%s\\n" "${1}" ; fi
11
}
12
13
printhelp () {
11
- echo "Usage: htmldoc/checklinks.sh [-r OR -f <fname>] [OPTIONS]
12
- -r Recursively check all mds in all child directories, except htmldoc and node_modules (which is generated by netlify)
14
+ echo "Usage: docs/generator/checklinks.sh [-r OR -f <fname>] [OPTIONS]
15
+ -r Recursively check all mds in all child directories, except docs/generator and node_modules (which is generatord by netlify)
16
-f Just check the passed md file
17
General Options:
18
-x Execute commands. By default the script runs in test mode with no files changed by the script (results and fixes are just shown). Use -x to have it apply the changes.
@@ -19,13 +22,13 @@ printhelp () {
22
-a Check all link types
23
-w Check wiki links (and just warn if you see one)
24
-b Check absolute links to the netdata repo (and change them to relative). Only checks links to https://github.com/netdata/netdata/????/master*
22
- -l Check relative links to the netdata repo (and replace them with links that the html static site can live with, under htmldoc/src only)
25
+ -l Check relative links to the netdata repo (and replace them with links that the html static site can live with, under docs/generator/src only)
26
-e Check external links, outside the wiki or the repo (useless without adding the -u option, to verify that they're not broken)
27
"
28
}
29
30
fix () {
28
- if [ $EXECUTE -eq 0 ] ; then
31
+ if [ "$EXECUTE" -eq 0 ] ; then
32
echo "-- SHOULD EXECUTE: $1"
33
else
34
dbg "-- EXECUTING: $1"
@@ -37,7 +40,7 @@ ck_netdata_absolute () {
40
f=$1
41
alnk=$2
42
lnkinfile=$3
40
- testURL $alnk
43
+ testURL "$alnk"
44
45
if [[ $f =~ ^(.*)/([^/]*)$ ]] ; then
46
fpath="${BASH_REMATCH[1]}"
@@ -45,7 +48,7 @@ ck_netdata_absolute () {
48
fi
49
50
if [ $? -eq 0 ] ; then
48
- rlnk=$(echo $alnk | sed 's/https:\/\/github.com\/netdata\/netdata\/....\/master\///g')
51
+ rlnk=$(echo "$alnk" | sed 's/https:\/\/github.com\/netdata\/netdata\/....\/master\///g')
52
case $rlnk in
53
\#* ) dbg "-- (#somelink)" ;;
54
*/ ) dbg "-- # (path/)" ;;
@@ -80,13 +83,13 @@ ck_netdata_absolute () {
83
rest="${BASH_REMATCH[2]}"
84
dbg "-- Target file is at $abspath"
85
fi
83
- relativelink=$(realpath --relative-to=$fpath $abspath)
86
+ relativelink=$(realpath --relative-to="$fpath" "$abspath")
87
if [ $? -eq 0 ] ; then
85
- srch=$(echo $lnkinfile | sed 's/\//\\\//g')
86
- if [ $relativelink = "." ] ; then
87
- rplc=$(echo $rest | sed 's/\//\\\//g')
88
+ srch=$(echo "$lnkinfile" | sed 's/\//\\\//g')
89
+ if [ "$relativelink" = "." ] ; then
90
+ rplc=$(echo "$rest" | sed 's/\//\\\//g')
91
else
89
- rplc=$(echo $relativelink/$rest | sed 's/\//\\\//g')
92
+ rplc=$(echo "$relativelink/$rest" | sed 's/\//\\\//g')
93
fi
94
fix "sed -i 's/($srch)/($rplc)/g' $f"
95
else
@@ -100,9 +103,9 @@ ck_netdata_absolute () {
103
}
104
105
testURL () {
103
- if [ $TESTURLS -eq 0 ] ; then return 0 ; fi
106
+ if [ "$TESTURLS" -eq 0 ] ; then return 0 ; fi
107
dbg "-- Testing URL $1"
105
- curl -sS $1 > /dev/null
108
+ curl -sS "$1" > /dev/null
109
if [ $? -gt 0 ] ; then
110
return 1
111
fi
@@ -116,7 +119,7 @@ testinternal () {
119
ilnk=${3}
120
header=${ilnk//-/}
121
dbg "-- Searching for \"$header\" in $ifile"
119
- tr -d ',_.:? `'< $ifile | sed 's/-//g' | grep -i "^\#*$header\$" >/dev/null
122
+ tr -d ',_.:? `'< "$ifile" | sed 's/-//g' | grep -i "^\\#*$header\$" >/dev/null
123
if [ $? -eq 0 ] ; then
124
dbg "-- $ilnk found in $ifile"
125
return 0
@@ -171,34 +174,34 @@ ck_netdata_relative () {
174
case "$rlnk" in
175
\#* )
176
dbg "-- # (#somelink)"
174
- testinternal $f $f $rlnk
177
+ testinternal "$f" "$f" "$rlnk"
178
;;
179
*/ )
180
dbg "-- # (path/)"
181
TRGT="$fpath/${rlnk}README.md"
179
- testf $f $TRGT
182
+ testf "$f" "$TRGT"
183
if [ $? -eq 0 ] ; then
181
- if [ $fname != "README.md" ] ; then s="../$rlnk"; fi
184
+ if [ "$fname" != "README.md" ] ; then s="../$rlnk"; fi
185
fi
186
;;
184
- */#* )
187
+ */\#* )
188
dbg "-- # (path/#somelink)"
189
if [[ $rlnk =~ ^(.*)/#(.*)$ ]] ; then
190
TRGT="$fpath/${BASH_REMATCH[1]}/README.md"
191
LNK="#${BASH_REMATCH[2]}"
192
dbg "-- Look for $LNK in $TRGT"
190
- testf $f $TRGT
193
+ testf "$f" "$TRGT"
194
if [ $? -eq 0 ] ; then
192
- testinternal $f $TRGT $LNK
195
+ testinternal "$f" "$TRGT" "$LNK"
196
if [ $? -eq 0 ] ; then
194
- if [ $fname != "README.md" ] ; then s="../$rlnk"; fi
197
+ if [ "$fname" != "README.md" ] ; then s="../$rlnk"; fi
198
fi
199
fi
200
fi
201
;;
202
*.md )
203
dbg "-- # (path/filename.md) -> htmldoc (path/filename/)"
201
- testf $f "$fpath/$rlnk"
204
+ testf "$f" "$fpath/$rlnk"
205
if [ $? -eq 0 ] ; then
206
if [[ $rlnk =~ ^(.*)/(.*).md$ ]] ; then
207
if [ "${BASH_REMATCH[2]}" = "README" ] ; then
@@ -206,18 +209,18 @@ ck_netdata_relative () {
209
else
210
s="../${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/"
211
fi
209
- if [ $fname != "README.md" ] ; then s="../$s"; fi
212
+ if [ "$fname" != "README.md" ] ; then s="../$s"; fi
213
fi
214
fi
215
;;
213
- *.md#* )
216
+ *.md\#* )
217
dbg "-- # (path/filename.md#somelink) -> htmldoc (path/filename/#somelink)"
218
if [[ $rlnk =~ ^(.*)#(.*)$ ]] ; then
219
TRGT="$fpath/${BASH_REMATCH[1]}"
220
LNK="#${BASH_REMATCH[2]}"
218
- testf $f $TRGT
221
+ testf "$f" "$TRGT"
222
if [ $? -eq 0 ] ; then
220
- testinternal $f $TRGT $LNK
223
+ testinternal "$f" "$TRGT" "$LNK"
224
if [ $? -eq 0 ] ; then
225
if [[ $lnk =~ ^(.*)/(.*).md#(.*)$ ]] ; then
226
if [ "${BASH_REMATCH[2]}" = "README" ] ; then
@@ -225,24 +228,24 @@ ck_netdata_relative () {
228
else
229
s="../${BASH_REMATCH[1]}/${BASH_REMATCH[2]}/#${BASH_REMATCH[3]}"
230
fi
228
- if [ $fname != "README.md" ] ; then s="../$s"; fi
231
+ if [ "$fname" != "README.md" ] ; then s="../$s"; fi
232
fi
233
fi
234
fi
235
fi
236
;;
234
- *#* )
237
+ *\#* )
238
dbg "-- # (path#somelink) -> (path/#somelink)"
239
if [[ $rlnk =~ ^(.*)#(.*)$ ]] ; then
240
TRGT="$fpath/${BASH_REMATCH[1]}/README.md"
241
LNK="#${BASH_REMATCH[2]}"
239
- testf $f $TRGT
242
+ testf "$f" "$TRGT"
243
if [ $? -eq 0 ] ; then
241
- testinternal $f $TRGT $LNK
244
+ testinternal "$f" "$TRGT" "$LNK"
245
if [ $? -eq 0 ] ; then
246
if [[ $rlnk =~ ^(.*)#(.*)$ ]] ; then
247
s="${BASH_REMATCH[1]}/#${BASH_REMATCH[2]}"
245
- if [ $fname != "README.md" ] ; then s="../$s"; fi
248
+ if [ "$fname" != "README.md" ] ; then s="../$s"; fi
249
fi
250
fi
251
fi
@@ -251,7 +254,7 @@ ck_netdata_relative () {
254
* )
255
if [ -f "$fpath/$rlnk" ] ; then
256
dbg "-- # (path/someotherfile) $rlnk"
254
- if [ $fpath = "." ] ; then
257
+ if [ "$fpath" = "." ] ; then
258
s="https://github.com/netdata/netdata/tree/master/$rlnk"
259
else
260
s="https://github.com/netdata/netdata/tree/master/$fpath/$rlnk"
@@ -259,10 +262,10 @@ ck_netdata_relative () {
262
else
263
if [ -d "$fpath/$rlnk" ] ; then
264
dbg "-- # (path) -> htmldoc (path/)"
262
- testf $f "$fpath/$rlnk/README.md"
265
+ testf "$f" "$fpath/$rlnk/README.md"
266
if [ $? -eq 0 ] ; then
267
s="$rlnk/"
265
- if [ $fname != "README.md" ] ; then s="../$s"; fi
268
+ if [ "$fname" != "README.md" ] ; then s="../$s"; fi
269
fi
270
else
271
echo "-- ERROR: $f - $rlnk is neither a file or a directory. Giving up!"
@@ -273,9 +276,9 @@ ck_netdata_relative () {
276
esac
277
278
if [[ ! -z $s ]] ; then
276
- srch=$(echo $rlnk | sed 's/\//\\\//g')
277
- rplc=$(echo $s | sed 's/\//\\\//g')
278
- fix "sed -i 's/($srch)/($rplc)/g' htmldoc/src/$f"
279
+ srch=$(echo "$rlnk" | sed 's/\//\\\//g')
280
+ rplc=$(echo "$s" | sed 's/\//\\\//g')
281
+ fix "sed -i 's/($srch)/($rplc)/g' $GENERATOR_DIR/src/$f"
282
fi
283
}
284
@@ -283,26 +286,26 @@ ck_netdata_relative () {
286
checklinks () {
287
f=$1
288
dbg "Checking $f"
286
- while read l ; do
289
+ while read -r l ; do
290
for word in $l ; do
291
if [[ $word =~ .*\]\(([^\(\) ]*)\).* ]] ; then
292
lnk="${BASH_REMATCH[1]}"
290
- if [ -z $lnk ] ; then continue ; fi
293
+ if [ -z "$lnk" ] ; then continue ; fi
294
dbg "-$lnk"
295
case "$lnk" in
296
mailto:* ) dbg "-- Mailto link, ignoring" ;;
297
https://github.com/netdata/netdata/wiki* )
298
dbg "-- Wiki Link $lnk"
296
- if [ $CHKWIKI -eq 1 ] ; then echo "-- WARNING: $f - $lnk points to the wiki. Please replace it manually" ; fi
299
+ if [ "$CHKWIKI" -eq 1 ] ; then echo "-- WARNING: $f - $lnk points to the wiki. Please replace it manually" ; fi
300
;;
301
https://github.com/netdata/netdata/????/master* )
302
dbg "-- Absolute link $lnk"
300
- if [ $CHKABSOLUTE -eq 1 ] ; then ck_netdata_absolute $f $lnk $lnk ; fi
303
+ if [ "$CHKABSOLUTE" -eq 1 ] ; then ck_netdata_absolute "$f" "$lnk" "$lnk" ; fi
304
;;
305
http* )
306
dbg "-- External link $lnk"
304
- if [ $CHKEXTERNAL -eq 1 ] ; then
305
- testURL $lnk
307
+ if [ "$CHKEXTERNAL" -eq 1 ] ; then
308
+ testURL "$lnk"
309
if [ $? -eq 1 ] ; then
310
echo "-- ERROR: $f - $lnk is a broken link"
311
EXITCODE=1
@@ -311,12 +314,12 @@ checklinks () {
314
;;
315
* )
316
dbg "-- Relative link $lnk"
314
- if [ $CHKRELATIVE -eq 1 ] ; then ck_netdata_relative $f $lnk ; fi
317
+ if [ "$CHKRELATIVE" -eq 1 ] ; then ck_netdata_relative "$f" "$lnk" ; fi
318
;;
319
esac
320
fi
321
done
319
- done < $f
322
+ done < "$f"
323
}
324
325
TESTURLS=0
@@ -372,20 +375,20 @@ done
375
376
EXITCODE=0
377
375
-if [ -z ${file} ] ; then
378
+if [ -z "${file}" ] ; then
379
if [ $RECURSIVE -eq 0 ] ; then
380
printhelp
381
exit 1
382
fi
380
- for f in $(find . -type d \( -path ./htmldoc -o -path ./node_modules \) -prune -o -name "*.md" -print); do
381
- checklinks $f
383
+ for f in $(find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o -name "*.md" -print); do
384
+ checklinks "$f"
385
done
386
else
387
if [ $RECURSIVE -eq 1 ] ; then
388
printhelp
389
exit 1
390
fi
388
- checklinks $file
391
+ checklinks "$file"
392
fi
393
394
exit $EXITCODE
docs/generator/requirements.txt
renamed
docs/generator/runtime.txt
renamed
docs/generator/themes/material/partials/footer.html
renamed
docs/high-performance-netdata.md
renamed
docs/netdata-for-IoT.md
renamed
docs/netdata-security.md
renamed
htmldoc/buildhtml.sh
deleted
-55
@@ -1,55 +0,0 @@
1
-#!/bin/bash
2
-
3
-# buildhtml.sh
4
-
5
-# Builds the html static site, using mkdocs
6
-# Assumes that the script is executed either from the htmldoc folder (by netlify), or from the root repo dir (as originally intended)
7
-currentdir=$(pwd | awk -F '/' '{print $NF}')
8
-if [ $currentdir = "htmldoc" ] ; then
9
- cd ..
10
-fi
11
-
12
-
13
-# Copy all netdata .md files to htmldoc/src. Exclude htmldoc itself and also the directory node_modules generated by Netlify
14
-echo "Copying files"
15
-rm -rf htmldoc/src
16
-find . -type d \( -path ./htmldoc -o -path ./node_modules \) -prune -o -name "*.md" -print | cpio -pd htmldoc/src
17
-
18
-# Modify the first line of the main README.md, to enable proper static html generation
19
-sed -i '0,/# netdata /s//# Introduction\n\n/' htmldoc/src/README.md
20
-
21
-# Remove specific files that don't belong in the documentation
22
-rm htmldoc/src/HISTORICAL_CHANGELOG.md
23
-rm htmldoc/src/collectors/charts.d.plugin/mem_apps/README.md
24
-rm htmldoc/src/collectors/charts.d.plugin/postfix/README.md
25
-rm htmldoc/src/collectors/charts.d.plugin/tomcat/README.md
26
-rm htmldoc/src/collectors/charts.d.plugin/sensors/README.md
27
-rm htmldoc/src/collectors/charts.d.plugin/cpu_apps/README.md
28
-rm htmldoc/src/collectors/charts.d.plugin/squid/README.md
29
-rm htmldoc/src/collectors/charts.d.plugin/nginx/README.md
30
-rm htmldoc/src/collectors/charts.d.plugin/hddtemp/README.md
31
-rm htmldoc/src/collectors/charts.d.plugin/cpufreq/README.md
32
-rm htmldoc/src/collectors/charts.d.plugin/mysql/README.md
33
-rm htmldoc/src/collectors/charts.d.plugin/exim/README.md
34
-rm htmldoc/src/collectors/charts.d.plugin/apache/README.md
35
-rm htmldoc/src/collectors/charts.d.plugin/load_average/README.md
36
-rm htmldoc/src/collectors/charts.d.plugin/phpfpm/README.md
37
-
38
-echo "Creating mkdocs.yaml"
39
-
40
-# Generate mkdocs.yaml
41
-htmldoc/buildyaml.sh > htmldoc/mkdocs.yml
42
-
43
-echo "Fixing links"
44
-
45
-# Fix links (recursively, all types, executing replacements)
46
-htmldoc/checklinks.sh -rax
47
-if [ $? -eq 1 ] ; then exit 1 ; fi
48
-
49
-echo "Calling mkdocs"
50
-
51
-# Build html docs
52
-mkdocs build --config-file=htmldoc/mkdocs.yml
53
-
54
-echo "Finished"
55
-
installer/README.md
+3
-3
@@ -63,7 +63,7 @@ For automated installs, append a space + `--dont-wait` to the command line. You
63
64
</details> <br/>
65
66
-Once Netdata is installed, see [Getting Started](../doc/GettingStarted.md).
66
+Once Netdata is installed, see [Getting Started](../docs/GettingStarted.md).
67
68
---
69
@@ -128,7 +128,7 @@ sh /tmp/kickstart-static64.sh
128
129
</details> <br/>
130
131
-Once Netdata is installed, see [Getting Started](../doc/GettingStarted.md).
131
+Once Netdata is installed, see [Getting Started](../docs/GettingStarted.md).
132
133
---
134
@@ -390,7 +390,7 @@ When Netdata is first installed, it will run as _root_. This may or may not be a
390
391
1. Creat a group `netdata` via the Synology group interface. Give it no access to anything.
392
2. Create a user `netdata` via the Synology user interface. Give it no access to anything and a random password. Assign the user to the `netdata` group. Netdata will chuid to this user when running.
393
-3. Change ownership of the following directories, as defined in [Netdata Security](../doc/netdata-security.md#security-design):
393
+3. Change ownership of the following directories, as defined in [Netdata Security](../docs/netdata-security.md#security-design):
394
395
```
396
$ chown -R root:netdata /opt/netdata/usr/share/netdata
netlify.toml
+2
-2
@@ -2,11 +2,11 @@
2
# unless otherwise overridden by more specific contexts.
3
[build]
4
# Directory to change to before starting a build.
5
- base = "htmldoc/"
5
+ base = "/docs/generator"
6
7
# Directory (relative to root of your repo) that contains the deploy-ready
8
# HTML files and assets generated by the build.
9
- publish = "htmldoc/build"
9
+ publish = "docs/generator/build"
10
11
# Default build command.
12
command = "./buildhtml.sh"
registry/README.md
+1
-1
@@ -46,7 +46,7 @@ The registry keeps track of 3 entities:
46
47
## Who talks to the registry?
48
49
-Your web browser **only**! Check here if this is against your policies: [how to not send any information to a thirdparty server](../doc/netdata-security.md#security-design)
49
+Your web browser **only**! Check here if this is against your policies: [how to not send any information to a thirdparty server](../docs/netdata-security.md#security-design)
50
51
Your netdata servers do not talk to the registry. This is a UML diagram of its operation:
52
web/gui/demosites.html
+4
-4
@@ -699,21 +699,21 @@ p {
699
network, firewall, <a href="https://github.com/netdata/netdata/tree/master/collectors/tc.plugin" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=QoS>QoS</a>, NFS, ZFS, etc).
700
<br/>
701
Detailed performance metrics for dozens of
702
- <b><a href="https://github.com/netdata/netdata/blob/master/doc/Add-more-charts-to-netdata.md#add-more-charts-to-netdata" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=AddMoreCharts>applications</a></b>
702
+ <b><a href="https://github.com/netdata/netdata/blob/master/docs/Add-more-charts-to-netdata.md#add-more-charts-to-netdata" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=AddMoreCharts>applications</a></b>
703
(such as web servers, databases servers, email servers, DNS servers, etc).
704
<br/>
705
Visualize metrics collected from <b><a href="https://github.com/netdata/netdata/blob/master/collectors/node.d.plugin/snmp" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=SNMP>SNMP devices</a></b>,
706
and APM metrics via the embedded <b><a href="https://github.com/netdata/netdata/tree/master/collectors/statsd.plugin" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=statsd>statsd server</a></b>.
707
</div>
708
<div class=grid-cell><h3><span class=star>★</span> Out of the box</h3>
709
- <p>netdata supports <a href="https://github.com/netdata/netdata/tree/master/doc/Why-Netdata.md#simplicity" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=AutoDetection>auto-detection</a> for everything. It collects more than 5000 metrics automatically, with
709
+ <p>netdata supports <a href="https://github.com/netdata/netdata/tree/master/docs/Why-Netdata.md#simplicity" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=AutoDetection>auto-detection</a> for everything. It collects more than 5000 metrics automatically, with
710
<strong>zero configuration</strong>, it has <strong>zero dependencies</strong>, requires <strong>zero
711
maintenance</strong> and comes with more than <a href="https://github.com/netdata/netdata/tree/master/health/health.d" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=AlarmConfigs>100 alarms</a> pre-configured to detect common
712
failures, performance and availability issues.
713
</div>
714
<div class=grid-cell><h3><span class=star>★</span> In real-time</h3>
715
<p>netdata collects thousands of metrics per server <strong>per second</strong>,
716
- with <a href="https://github.com/netdata/netdata/blob/master/doc/Performance.md#netdata-performance" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Performance>just 1% CPU</a>
716
+ with <a href="https://github.com/netdata/netdata/blob/master/docs/Performance.md#netdata-performance" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=Performance>just 1% CPU</a>
717
utilization of a single core, <a href="https://github.com/netdata/netdata/tree/master/database" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=MemoryRequirements>a few MB of RAM</a>
718
and no disk I/O at all.
719
View everything on <strong>stunning</strong> real-time interactive web dashboards, even when netdata is
@@ -727,7 +727,7 @@ p {
727
(such as email, slack.com, pushover.net, pushbullet.com, telegram.org, twilio.com).
728
</div>
729
<div class=grid-cell><h3><span class=star>★</span> Embeddable</h3>
730
- <p>netdata has minimal dependencies and can run <b><a href="https://github.com/netdata/netdata/blob/master/doc/netdata-for-IoT.md#netdata-for-iot" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=IoT>even weak on IoT devices</a></b>. Also, its charts can be embedded on any web site.
730
+ <p>netdata has minimal dependencies and can run <b><a href="https://github.com/netdata/netdata/blob/master/docs/netdata-for-IoT.md#netdata-for-iot" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=IoT>even weak on IoT devices</a></b>. Also, its charts can be embedded on any web site.
731
</div>
732
<div class=grid-cell><h3><span class=star>★</span> Customizable</h3>
733
<p><a href="https://github.com/netdata/netdata/tree/master/web/gui/custom#custom-dashboards" target="_blank" data-ga-category="Outbound links" data-ga-action="Nav click" data-ga-label=CustomDashboards>Custom dashboards</a> can be built using simple HTML (no javascript necessary).
web/gui/index.html
+1
-1
@@ -418,7 +418,7 @@
418
<div class="p">
419
<b><a href="https://github.com/netdata/netdata/wiki" target="_blank">netdata</a></b> is free,
420
open-source software. If you decide to use it,
421
- <strong><a href="https://github.com/netdata/netdata/tree/master/doc/a-github-star-is-important.md" target="_blank">it is important to give netdata a star at GitHub</a></strong>.
421
+ <strong><a href="https://github.com/netdata/netdata/tree/master/docs/a-github-star-is-important.md" target="_blank">it is important to give netdata a star at GitHub</a></strong>.
422
</div>
423
<div class="p">
424
Enjoy real-time performance monitoring!
web/gui/main.js
+1
-1
@@ -1612,7 +1612,7 @@ function renderPage(menus, data) {
1612
html += mhead + shtml + '</div></div><hr role="separator"/>';
1613
}
1614
1615
- sidebar += '<li class="" style="padding-top:15px;"><a href="https://github.com/netdata/netdata/blob/master/doc/Add-more-charts-to-netdata.md#add-more-charts-to-netdata" target="_blank"><i class="fas fa-plus"></i> add more charts</a></li>';
1615
+ sidebar += '<li class="" style="padding-top:15px;"><a href="https://github.com/netdata/netdata/blob/master/docs/Add-more-charts-to-netdata.md#add-more-charts-to-netdata" target="_blank"><i class="fas fa-plus"></i> add more charts</a></li>';
1616
sidebar += '<li class=""><a href="https://github.com/netdata/netdata/tree/master/health#Health-monitoring" target="_blank"><i class="fas fa-plus"></i> add more alarms</a></li>';
1617
sidebar += '<li class="" style="margin:20px;color:#666;"><small>netdata on <b>' + data.hostname.toString() + '</b>, collects every ' + ((data.update_every === 1) ? 'second' : data.update_every.toString() + ' seconds') + ' <b>' + data.dimensions_count.toLocaleString() + '</b> metrics, presented as <b>' + data.charts_count.toLocaleString() + '</b> charts and monitored by <b>' + data.alarms_count.toLocaleString() + '</b> alarms, using ' + Math.round(data.rrd_memory_bytes / 1024 / 1024).toLocaleString() + ' MB of memory for ' + NETDATA.seconds4human(data.update_every * data.history, {space: ' '}) + ' of real-time history.<br/> <br/><b>netdata</b><br/>v' + data.version.toString() + '</small></li>';
1618
sidebar += '</ul>';