summaryrefslogtreecommitdiffstats
path: root/docs/generator
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2019-08-04 08:57:13 +0000
commitcbf70980c060bde02906a8e9de2064459bacc93c (patch)
tree5b9ade02e0ed32a4b33f5e8647092d0c02ea586d /docs/generator
parentReleasing debian version 1.16.0-1. (diff)
downloadnetdata-cbf70980c060bde02906a8e9de2064459bacc93c.tar.xz
netdata-cbf70980c060bde02906a8e9de2064459bacc93c.zip
Merging upstream version 1.16.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'docs/generator')
-rwxr-xr-xdocs/generator/buildhtml.sh16
-rwxr-xr-xdocs/generator/buildyaml.sh22
-rwxr-xr-xdocs/generator/checklinks.sh32
-rw-r--r--docs/generator/custom/css/netdata.css68
4 files changed, 113 insertions, 25 deletions
diff --git a/docs/generator/buildhtml.sh b/docs/generator/buildhtml.sh
index e1c108fb5..dbd303911 100755
--- a/docs/generator/buildhtml.sh
+++ b/docs/generator/buildhtml.sh
@@ -27,10 +27,9 @@ find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o
# Copy Netdata html resources
cp -a ./${GENERATOR_DIR}/custom ./${SRC_DIR}/
-
# 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/' ${SRC_DIR}/README.md
+sed -i -e '0,/# Netdata /s//# Netdata Documentation\n\n/' ${SRC_DIR}/README.md
# Remove all GA tracking code
find ${SRC_DIR} -name "*.md" -print0 | xargs -0 sed -i -e 's/\[!\[analytics.*UA-64295674-3)\]()//g'
@@ -39,7 +38,6 @@ find ${SRC_DIR} -name "*.md" -print0 | xargs -0 sed -i -e 's/\[!\[analytics.*UA-
declare -a EXCLUDE_LIST=(
"HISTORICAL_CHANGELOG.md"
"contrib/sles11/README.md"
- "packaging/maintainers/README.md"
)
for f in "${EXCLUDE_LIST[@]}"; do
@@ -56,13 +54,12 @@ MKDOCS_CONFIG_FILE="${GENERATOR_DIR}/mkdocs.yml"
MKDOCS_DIR="doc"
DOCS_DIR=${GENERATOR_DIR}/${MKDOCS_DIR}
rm -rf ${DOCS_DIR}
-mkdir ${DOCS_DIR}
prep_html() {
lang="${1}"
echo "Creating ${lang} mkdocs.yaml"
- if [ "${lang}" = "en" ] ; then
+ if [ "${lang}" == "en" ] ; then
SITE_DIR="build"
else
SITE_DIR="build/${lang}"
@@ -86,16 +83,21 @@ prep_html() {
if [ "${lang}" != "en" ] ; then
find "${GENERATOR_DIR}/${SITE_DIR}" -name "*.html" -print0 | xargs -0 sed -i -e 's/https:\/\/github.com\/netdata\/netdata\/blob\/master\/\S*md/https:\/\/github.com\/netdata\/localization\//g'
fi
+
+ # Replace index.html with DOCUMENTATION/index.html. Since we're moving it up one directory, we need to remove ../ from the links
+ echo "Replacing index.html with DOCUMENTATION/index.html"
+ sed 's/\.\.\///g' ${GENERATOR_DIR}/${SITE_DIR}/DOCUMENTATION/index.html > ${GENERATOR_DIR}/${SITE_DIR}/index.html
+
}
for d in "en" $(find ${LOC_DIR} -mindepth 1 -maxdepth 1 -name .git -prune -o -type d -printf '%f ') ; do
echo "Preparing source for $d"
- cp -a ${SRC_DIR}/* ${DOCS_DIR}/
+ cp -r ${SRC_DIR} ${DOCS_DIR}
if [ "${d}" != "en" ] ; then
cp -a ${LOC_DIR}/${d}/* ${DOCS_DIR}/
fi
prep_html $d
- rm -rf ${DOCS_DIR}/*
+ rm -rf ${DOCS_DIR}
done
# Remove cloned projects and temp directories
diff --git a/docs/generator/buildyaml.sh b/docs/generator/buildyaml.sh
index e4a5466a4..f887c695d 100755
--- a/docs/generator/buildyaml.sh
+++ b/docs/generator/buildyaml.sh
@@ -48,11 +48,12 @@ navpart() {
}
echo -e 'site_name: Netdata Documentation
+site_url: https://docs.netdata.cloud
repo_url: https://github.com/netdata/netdata
repo_name: GitHub
edit_uri: blob/master
site_description: Netdata Documentation
-copyright: Netdata, 2018
+copyright: Netdata, 2019
docs_dir: '${docs_dir}'
site_dir: '${site_dir}'
#use_directory_urls: false
@@ -67,6 +68,9 @@ extra:
link: "https://www.facebook.com/linuxnetdata/"
theme:
name: "material"
+ palette:
+ primary: "blue grey"
+ accent: "light green"
custom_dir: custom/themes/material
favicon: custom/img/favicon.ico
language: '${language}'
@@ -85,7 +89,6 @@ markdown_extensions:
- footnotes
- tables
- admonition
- - codehilite
- meta
- sane_lists
- smarty
@@ -99,6 +102,9 @@ markdown_extensions:
- pymdownx.caret
- pymdownx.critic
- pymdownx.details
+ - pymdownx.highlight:
+ pygments_style: manni
+ noclasses: true
- pymdownx.inlinehilite
- pymdownx.magiclink
- pymdownx.mark
@@ -117,9 +123,12 @@ markdown_extensions:
- pymdownx.extrarawhtml
nav:'
-navpart 1 . README "About"
+navpart 1 . "README" ""
-echo -ne " - 'docs/Demo-Sites.md'
+navpart 1 . . "About Netdata"
+
+echo -ne " - 'docs/what-is-netdata.md'
+ - 'docs/Demo-Sites.md'
- 'docs/netdata-security.md'
- 'docs/anonymous-statistics.md'
- 'docs/Donations-netdata-has-received.md'
@@ -138,6 +147,7 @@ echo -ne " - 'docs/Demo-Sites.md'
- 'packaging/installer/README.md'
- 'packaging/docker/README.md'
- 'packaging/installer/UPDATE.md'
+ - 'packaging/DISTRIBUTIONS.md'
- 'packaging/installer/UNINSTALL.md'
- 'docs/GettingStarted.md'
- Running Netdata:
@@ -153,6 +163,7 @@ echo -ne " - Running behind another web server:
- 'docs/Running-behind-apache.md'
- 'docs/Running-behind-lighttpd.md'
- 'docs/Running-behind-caddy.md'
+ - 'docs/Running-behind-haproxy.md'
"
#navpart 2 system
navpart 2 database
@@ -253,9 +264,10 @@ navpart 2 web/api/badges "" "" 2
navpart 2 web/api/health "" "" 2
navpart 2 web/api/queries "" "Queries" 2
-echo -ne "- Hacking Netdata:
+echo -ne "- Additional Info:
- CODE_OF_CONDUCT.md
- CONTRIBUTORS.md
+ - packaging/maintainers/README.md
"
navpart 2 packaging/makeself "" "" 4
navpart 2 libnetdata "" "libnetdata" 4
diff --git a/docs/generator/checklinks.sh b/docs/generator/checklinks.sh
index acc144656..5012ad17d 100755
--- a/docs/generator/checklinks.sh
+++ b/docs/generator/checklinks.sh
@@ -5,6 +5,8 @@
# Validates and tries to fix all links that will cause issues either in the repo, or in the html site
GENERATOR_DIR="docs/generator"
+MKDOCS_DIR="doc"
+DOCS_DIR=${GENERATOR_DIR}/${MKDOCS_DIR}
dbg () {
if [ "$VERBOSE" -eq 1 ] ; then printf "%s\\n" "${1}" ; fi
@@ -186,25 +188,27 @@ ck_netdata_relative () {
fi
;;
* )
- if [ -f "$fpath/$rlnk" ] ; then
- dbg "-- # (path/someotherfile) $rlnk"
- if [ "$fpath" = "." ] ; then
- s="https://github.com/netdata/netdata/tree/master/$rlnk"
- else
- s="https://github.com/netdata/netdata/tree/master/$fpath/$rlnk"
+ if [ -d "$fpath/$rlnk" ] ; then
+ dbg "-- # (path) -> htmldoc (path/)"
+ testf "$f" "$fpath/$rlnk/README.md"
+ if [ $? -eq 0 ] ; then
+ s="$rlnk/"
+ if [ "$fname" != "README.md" ] ; then s="../$s"; fi
fi
else
- if [ -d "$fpath/$rlnk" ] ; then
- dbg "-- # (path) -> htmldoc (path/)"
- testf "$f" "$fpath/$rlnk/README.md"
- if [ $? -eq 0 ] ; then
- s="$rlnk/"
- if [ "$fname" != "README.md" ] ; then s="../$s"; fi
+ cd - >/dev/null
+ if [ -f "$fpath/$rlnk" ] ; then
+ dbg "-- # (path/someotherfile) $rlnk"
+ if [ "$fpath" = "." ] ; then
+ s="https://github.com/netdata/netdata/tree/master/$rlnk"
+ else
+ s="https://github.com/netdata/netdata/tree/master/$fpath/$rlnk"
fi
else
echo "-- ERROR: $f - $rlnk is neither a file or a directory. Giving up!"
EXITCODE=1
fi
+ cd $DOCS_DIR >/dev/null
fi
;;
esac
@@ -212,7 +216,7 @@ ck_netdata_relative () {
if [[ ! -z $s ]] ; then
srch=$(echo "$rlnk" | sed 's/\//\\\//g')
rplc=$(echo "$s" | sed 's/\//\\\//g')
- fix "sed -i 's/($srch)/($rplc)/g' $GENERATOR_DIR/doc/$f"
+ fix "sed -i 's/($srch)/($rplc)/g' $f"
fi
}
@@ -314,9 +318,11 @@ if [ -z "${file}" ] ; then
printhelp
exit 1
fi
+ cd ${DOCS_DIR}
for f in $(find . -type d \( -path ./${GENERATOR_DIR} -o -path ./node_modules \) -prune -o -name "*.md" -print); do
checklinks "$f"
done
+ cd -
else
if [ $RECURSIVE -eq 1 ] ; then
printhelp
diff --git a/docs/generator/custom/css/netdata.css b/docs/generator/custom/css/netdata.css
index d9003be15..27f1b08cc 100644
--- a/docs/generator/custom/css/netdata.css
+++ b/docs/generator/custom/css/netdata.css
@@ -5,3 +5,71 @@
.md-typeset {
font-size: .75rem
}
+
+/* Underline text */
+
+.md-typeset a:not(.nav-button):not(.md-icon):not(.headerlink) {
+ border-bottom: 1px solid #272b30;
+}
+
+/* Custom styling for the new documentation homepage.
+ In particular, the three buttons for install/getting started/configuration. */
+
+.homepage-nav {
+ display: flex;
+ margin-top: 1.4rem;
+}
+
+.homepage-nav div {
+ flex: 1;
+}
+
+.homepage-nav .nav-install {
+ margin-right: 1rem;
+}
+
+.homepage-nav .nav-configuration {
+ margin-left: 1rem;
+}
+
+.nav-button {
+ border: 2px solid black;
+ border-radius: 4px;
+ display: block;
+ font-weight: 700;
+ margin: 0 auto;
+ padding: 0.6rem 0;
+ text-align: center;
+}
+
+/* Hide the label at the top of the navigation menu. Does nothing.
+ Well, it does do something on mobile, and this media query makes
+ sure it's hidden only on screens wide enough to not use the mobile sidebar. */
+@media only screen and (min-width:76.25em) {
+ .md-nav--primary .md-nav__title {
+ display: none;
+ }
+}
+
+/* Change the language selector dropdown to match new color. */
+.md-header-nav select#sel {
+ background-color: rgba(0,0,0,.26) !important;
+ padding: 3px;
+ margin-left: 5px;
+ margin-right: 20px;
+}
+
+/* Add some whitespace to the bottom of each doc. */
+.md-content {
+ margin-bottom: 6rem;
+}
+
+/* Make sure inline code in tables doesn't break. */
+.md-typeset__table code {
+ word-break: normal;
+}
+
+/* Bold the first item on the docs sidebar: Netdata Documentation */
+.md-nav--primary > .md-nav__list > .md-nav__item:first-of-type {
+ font-weight: 700;
+} \ No newline at end of file