summaryrefslogtreecommitdiffstats
path: root/docs/generator
diff options
context:
space:
mode:
authorChris Akritidis <43294513+cakrit@users.noreply.github.com>2019-07-11 20:31:18 +0200
committerGitHub <noreply@github.com>2019-07-11 20:31:18 +0200
commitd46387882edebde405c91f6faff704a1e3ee1102 (patch)
tree154b37acddb1bbcd9ad260714ab669bdb9afddd3 /docs/generator
parent2129880d1f2297ef69d4e5ca478e32668716acef (diff)
Fix issue with HTML docs generation (#6433)
* Move to the docs/generator/doc directory before running checklinks * remove the entire DOCS_DIR before switching to another language * Try copying with -a instead of -r
Diffstat (limited to 'docs/generator')
-rwxr-xr-xdocs/generator/buildhtml.sh6
-rwxr-xr-xdocs/generator/buildyaml.sh3
-rwxr-xr-xdocs/generator/checklinks.sh32
3 files changed, 23 insertions, 18 deletions
diff --git a/docs/generator/buildhtml.sh b/docs/generator/buildhtml.sh
index e1c108fb53..424c58b8a6 100755
--- a/docs/generator/buildhtml.sh
+++ b/docs/generator/buildhtml.sh
@@ -39,7 +39,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,7 +55,6 @@ 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}"
@@ -90,12 +88,12 @@ prep_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 1880a6ec97..be4d212072 100755
--- a/docs/generator/buildyaml.sh
+++ b/docs/generator/buildyaml.sh
@@ -254,9 +254,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 acc1446569..5012ad17dd 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
/* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
/*! For license information please see photos-main.js.LICENSE.txt */
(()=>{var e,n,r={90478:(e,t,n)=>{"use strict";var r=n(50791),a=Object.prototype.hasOwnProperty,i={align:"text-align",valign:"vertical-align",height:"height",width:"width"};function o(e){var t;if("tr"===e.tagName||"td"===e.tagName||"th"===e.tagName)for(t in i)a.call(i,t)&&void 0!==e.properties[t]&&(s(e,i[t],e.properties[t]),delete e.properties[t])}function s(e,t,n){var r=(e.properties.style||"").trim();r&&!/;\s*/.test(r)&&(r+=";"),r&&(r+=" ");var a=r+t+": "+n+";";e.properties.style=a}e.exports=function(e){return r(e,"element",o),e}},93790:e=>{"use strict";function t(e){if("string"==typeof e)return function(e){return t;function t(t){return Boolean(t&&t.type===e)}}(e);if(null==e)return a;if("object"==typeof e)return("length"in e?r:n)(e);if("function"==typeof e)return e;throw new Error("Expected function, string, or object as test")}function n(e){return function(t){var n;for(n in e)if(t[n]!==e[n])return!1;return!0}}function r(e){var n=function(e){for(var n=[],r=e.length,a=-1;++a<r;)n[a]=t(e[a]);return n}(e),r=n.length;return function(){var e=-1;for(;++e<r;)if(n[e].apply(this,arguments))return!0;return!1}}function a(){return!0}e.exports=t},11150:(e,t,n)=>{"use strict";e.exports=s;var r=n(93790),a=!0,i="skip",o=!1;function s(e,t,n,a){var s;function u(e,r,c){var d,h=[];return(t&&!s(e,r,c[c.length-1]||null)||(h=l(n(e,c)))[0]!==o)&&e.children&&h[0]!==i?(d=l(function(e,t){var n,r=-1,i=a?-1:1,s=(a?e.length:r)+i;for(;s>r&&s<e.length;){if((n=u(e[s],s,t))[0]===o)return n;s="number"==typeof n[1]?n[1]:s+i}}(e.children,c.concat(e))),d[0]===o?d:h):h}"function"==typeof t&&"function"!=typeof n&&(a=n,n=t,t=null),s=r(t),u(e,null,[])}function l(e){return null!==e&&"object"==typeof e&&"length"in e?e:"number"==typeof e?[a,e]:[e]}s.CONTINUE=a,s.SKIP=i,s.EXIT=o},50791:(e,t,n)=>{"use strict";e.exports=s;var r=n(11150),a=r.CONTINUE,i=r.SKIP,o=r.EXIT;function s(e,t,n,a){"function"==typeof t&&"function"!=typeof n&&(a=n,n=t,t=null),r(e,t,(function(e,t){var r=t[t.length-1],a=r?r.children.indexOf(e):null;return n(e,a,r)}),a)}s.CONTINUE=a,s.SKIP=i,s.EXIT=o},22200:(e,t,n)=>{"use strict";var r=n(57888),a=void 0,i=[];r.subscribe("csrf-token-update",(function(e){a=e.token,i.forEach((function(t){try{t(e.token)}catch(e){console.error("error updating CSRF token observer",e)}}))}));var o=function(e,t){return e?e.getAttribute(t):null},s=void 0;t.getCurrentUser=function(){if(void 0!==s)return s;var e=null===document||void 0===document?void 0:document.getElementsByTagName("head")[0];if(!e)return null;var t=o(e,"data-user");return s=null===t?null:{uid:t,displayName:o(e,"data-user-displayname"),isAdmin:!!window._oc_isadmin}},t.getRequestToken=function(){if(void 0===a){var e=null===document||void 0===document?void 0:document.getElementsByTagName("head")[0];a=e?e.getAttribute("data-requesttoken"):null}return a},t.onRequestTokenUpdate=function(e){i.push(e)}},42515:(e,t,n)=>{"use strict";t.F=function(){try{return(0,r.loadState)("core","capabilities")}catch(e){return console.debug("Could not find capabilities initial state fall back to _oc_capabilities"),"_oc_capabilities"in window?window._oc_capabilities:{}}};var r=n(20853)},20853:(e,t,n)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.loadState=function(e,t,n){var r=document.querySelector("#initial-state-".concat(e,"-").concat(t));if(null===r){if(void 0!==n)return n;throw new Error("Could not find initial state ".concat(t," of ").concat(e))}try{return JSON.parse(atob(r.value))}catch(n){throw new Error("Could not parse initial state ".concat(t," of ").concat(e))}},n(92222)},3094:(e,t,n)=>{"use strict";var r=n(75189),a=n(11642),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not a function")}},88347:(e,t,n)=>{"use strict";var r=n(82212),a=n(11642),i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not a constructor")}},8723:(e,t,n)=>{"use strict";var r=n(75189),a=String,i=TypeError;e.exports=function(e){if("object"==typeof e||r(e))return e;throw i("Can't set "+a(e)+" as a prototype")}},62079:(e,t,n)=>{"use strict";var r=n(83193),a=TypeError;e.exports=function(e,t){if(r(t,e))return e;throw a("Incorrect invocation")}},94635:(e,t,n)=>{"use strict";var r=n(47484),a=String,i=TypeError;e.exports=function(e){if(r(e))return e;throw i(a(e)+" is not an object")}},9686:(e,t,n)=>{"use strict";var r=n(68671),