mirror of https://gitee.com/bigwinds/arangodb
backport documentation variable configurations (#3850)
* Correct custom search IDs, sitemap and edit URLs * deploy versions through shell script from central places * shellcheckify * shellcheck, indent * move all configs into one file * add settings * one more char that may occur in ids * add per book version, its not yet the right ids. * Update VERSIONS Created new CSE for Devel Cookbook, replaced all IDs by Devel CSE IDs, adjusted prio to 0.3
This commit is contained in:
parent
64f259aa70
commit
3fe4b2fda5
|
@ -37,8 +37,8 @@
|
||||||
},
|
},
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/AQL/",
|
"prefix": "https://docs.arangodb.com/devel/AQL/",
|
||||||
"changefreq": "daily",
|
"changefreq": "@GCHANGE_FREQ@",
|
||||||
"priority": 0.3
|
"priority": @GPRIORITY@
|
||||||
},
|
},
|
||||||
"ga": {
|
"ga": {
|
||||||
"token": "UA-81053435-2"
|
"token": "UA-81053435-2"
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
// Try to set the version number early, jQuery not available yet
|
// Try to set the version number early, jQuery not available yet
|
||||||
|
var searcheable_versions = [@BROWSEABLE_VERSIONS@];
|
||||||
|
var cx = '@GSEARCH_ID@';
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
if (!gitbook.state.root) return;
|
if (!gitbook.state.root) return;
|
||||||
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
||||||
|
@ -16,7 +19,22 @@ window.localStorage.removeItem(":keyword");
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
function appendHeader() {
|
function appendHeader() {
|
||||||
|
var VERSION_SELECTOR = ""
|
||||||
|
var i = 0;
|
||||||
|
var prefix;
|
||||||
|
for (i = 0; i < searcheable_versions.length; i++ ) {
|
||||||
|
if (searcheable_versions[i] === 'devel') {
|
||||||
|
prefix = '';
|
||||||
|
} else {
|
||||||
|
prefix = 'v';
|
||||||
|
}
|
||||||
|
VERSION_SELECTOR += '<option value="' +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'">' + prefix +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'</option>\n';
|
||||||
|
}
|
||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.innerHTML = '<div class="arangodb-header">\n' +
|
div.innerHTML = '<div class="arangodb-header">\n' +
|
||||||
' <div class="arangodb-logo">\n' +
|
' <div class="arangodb-logo">\n' +
|
||||||
|
@ -30,11 +48,7 @@ function appendHeader() {
|
||||||
' </a>\n' +
|
' </a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' <select class="arangodb-version-switcher">\n' +
|
' <select class="arangodb-version-switcher">\n' +
|
||||||
' <option value="devel">devel</option>\n' +
|
VERSION_SELECTOR +
|
||||||
' <option value="3.2">v3.2</option>\n' +
|
|
||||||
' <option value="3.1">v3.1</option>\n' +
|
|
||||||
' <option value="3.0">v3.0</option>\n' +
|
|
||||||
' <option value="2.8">v2.8</option>\n' +
|
|
||||||
' </select>\n' +
|
' </select>\n' +
|
||||||
' <div class="google-search">\n' +
|
' <div class="google-search">\n' +
|
||||||
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
||||||
|
@ -93,7 +107,6 @@ function appendHeader() {
|
||||||
//render header
|
//render header
|
||||||
rerenderNavbar();
|
rerenderNavbar();
|
||||||
function addGoogleSrc() {
|
function addGoogleSrc() {
|
||||||
var cx = '010085642145132923492:6ymjhhr677k';
|
|
||||||
var gcse = document.createElement('script');
|
var gcse = document.createElement('script');
|
||||||
gcse.type = 'text/javascript';
|
gcse.type = 'text/javascript';
|
||||||
gcse.async = true;
|
gcse.async = true;
|
||||||
|
|
|
@ -36,15 +36,15 @@
|
||||||
"css": ["styles/header.css"]
|
"css": ["styles/header.css"]
|
||||||
},
|
},
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/3.2/cookbook/",
|
"prefix": "https://docs.arangodb.com/devel/cookbook/",
|
||||||
"changefreq": "weekly",
|
"changefreq": "@GCHANGE_FREQ@",
|
||||||
"priority": 0.8
|
"priority": @GPRIORITY@
|
||||||
},
|
},
|
||||||
"ga": {
|
"ga": {
|
||||||
"token": "UA-81053435-2"
|
"token": "UA-81053435-2"
|
||||||
},
|
},
|
||||||
"edit-link": {
|
"edit-link": {
|
||||||
"base": "https://github.com/arangodb/Cookbook/edit/master/recipes",
|
"base": "https://github.com/arangodb/arangodb/edit/devel/Documentation/Books/Cookbook",
|
||||||
"label": "Edit Page"
|
"label": "Edit Page"
|
||||||
},
|
},
|
||||||
"localized-footer": {
|
"localized-footer": {
|
||||||
|
|
|
@ -1,4 +1,7 @@
|
||||||
// Try to set the version number early, jQuery not available yet
|
// Try to set the version number early, jQuery not available yet
|
||||||
|
var searcheable_versions = [@BROWSEABLE_VERSIONS@];
|
||||||
|
var cx = '@GSEARCH_ID@';
|
||||||
|
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
if (!gitbook.state.root) return;
|
if (!gitbook.state.root) return;
|
||||||
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
||||||
|
@ -16,6 +19,21 @@ window.localStorage.removeItem(":keyword");
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
function appendHeader() {
|
function appendHeader() {
|
||||||
|
var VERSION_SELECTOR = ""
|
||||||
|
var i = 0;
|
||||||
|
var prefix;
|
||||||
|
for (i = 0; i < searcheable_versions.length; i++ ) {
|
||||||
|
if (searcheable_versions[i] === 'devel') {
|
||||||
|
prefix = '';
|
||||||
|
} else {
|
||||||
|
prefix = 'v';
|
||||||
|
}
|
||||||
|
VERSION_SELECTOR += '<option value="' +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'">' + prefix +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'</option>\n';
|
||||||
|
}
|
||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.innerHTML = '<div class="arangodb-header">\n' +
|
div.innerHTML = '<div class="arangodb-header">\n' +
|
||||||
|
@ -30,11 +48,7 @@ function appendHeader() {
|
||||||
' </a>\n' +
|
' </a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' <select class="arangodb-version-switcher">\n' +
|
' <select class="arangodb-version-switcher">\n' +
|
||||||
' <option value="devel">devel</option>\n' +
|
VERSION_SELECTOR +
|
||||||
' <option value="3.2">v3.2</option>\n' +
|
|
||||||
' <option value="3.1">v3.1</option>\n' +
|
|
||||||
' <option value="3.0">v3.0</option>\n' +
|
|
||||||
' <option value="2.8">v2.8</option>\n' +
|
|
||||||
' </select>\n' +
|
' </select>\n' +
|
||||||
' <div class="google-search">\n' +
|
' <div class="google-search">\n' +
|
||||||
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
||||||
|
@ -93,7 +107,6 @@ function appendHeader() {
|
||||||
//render header
|
//render header
|
||||||
rerenderNavbar();
|
rerenderNavbar();
|
||||||
function addGoogleSrc() {
|
function addGoogleSrc() {
|
||||||
var cx = '010085642145132923492:ol7d_ppmq48';
|
|
||||||
var gcse = document.createElement('script');
|
var gcse = document.createElement('script');
|
||||||
gcse.type = 'text/javascript';
|
gcse.type = 'text/javascript';
|
||||||
gcse.async = true;
|
gcse.async = true;
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
},
|
},
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/HTTP/",
|
"prefix": "https://docs.arangodb.com/devel/HTTP/",
|
||||||
"changefreq": "daily",
|
"changefreq": "@GCHANGE_FREQ@",
|
||||||
"priority": 0.3
|
"priority": @GPRIORITY@
|
||||||
},
|
},
|
||||||
"ga": {
|
"ga": {
|
||||||
"token": "UA-81053435-2"
|
"token": "UA-81053435-2"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// Try to set the version number early, jQuery not available yet
|
// Try to set the version number early, jQuery not available yet
|
||||||
|
var searcheable_versions = [@BROWSEABLE_VERSIONS@];
|
||||||
|
var cx = '@GSEARCH_ID@';
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
if (!gitbook.state.root) return;
|
if (!gitbook.state.root) return;
|
||||||
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
||||||
|
@ -16,6 +18,21 @@ window.localStorage.removeItem(":keyword");
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
function appendHeader() {
|
function appendHeader() {
|
||||||
|
var VERSION_SELECTOR = ""
|
||||||
|
var i = 0;
|
||||||
|
var prefix;
|
||||||
|
for (i = 0; i < searcheable_versions.length; i++ ) {
|
||||||
|
if (searcheable_versions[i] === 'devel') {
|
||||||
|
prefix = '';
|
||||||
|
} else {
|
||||||
|
prefix = 'v';
|
||||||
|
}
|
||||||
|
VERSION_SELECTOR += '<option value="' +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'">' + prefix +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'</option>\n';
|
||||||
|
}
|
||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.innerHTML = '<div class="arangodb-header">\n' +
|
div.innerHTML = '<div class="arangodb-header">\n' +
|
||||||
|
@ -30,11 +47,7 @@ function appendHeader() {
|
||||||
' </a>\n' +
|
' </a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' <select class="arangodb-version-switcher">\n' +
|
' <select class="arangodb-version-switcher">\n' +
|
||||||
' <option value="devel">devel</option>\n' +
|
VERSION_SELECTOR +
|
||||||
' <option value="3.2">v3.2</option>\n' +
|
|
||||||
' <option value="3.1">v3.1</option>\n' +
|
|
||||||
' <option value="3.0">v3.0</option>\n' +
|
|
||||||
' <option value="2.8">v2.8</option>\n' +
|
|
||||||
' </select>\n' +
|
' </select>\n' +
|
||||||
' <div class="google-search">\n' +
|
' <div class="google-search">\n' +
|
||||||
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
||||||
|
@ -93,7 +106,6 @@ function appendHeader() {
|
||||||
//render header
|
//render header
|
||||||
rerenderNavbar();
|
rerenderNavbar();
|
||||||
function addGoogleSrc() {
|
function addGoogleSrc() {
|
||||||
var cx = '010085642145132923492:fixi4yzeiz8';
|
|
||||||
var gcse = document.createElement('script');
|
var gcse = document.createElement('script');
|
||||||
gcse.type = 'text/javascript';
|
gcse.type = 'text/javascript';
|
||||||
gcse.async = true;
|
gcse.async = true;
|
||||||
|
|
|
@ -37,8 +37,8 @@
|
||||||
},
|
},
|
||||||
"sitemap-general": {
|
"sitemap-general": {
|
||||||
"prefix": "https://docs.arangodb.com/devel/Manual/",
|
"prefix": "https://docs.arangodb.com/devel/Manual/",
|
||||||
"changefreq": "daily",
|
"changefreq": "@GCHANGE_FREQ@",
|
||||||
"priority": 0.3
|
"priority": @GPRIORITY@
|
||||||
},
|
},
|
||||||
"ga": {
|
"ga": {
|
||||||
"token": "UA-81053435-2"
|
"token": "UA-81053435-2"
|
||||||
|
|
|
@ -1,4 +1,6 @@
|
||||||
// Try to set the version number early, jQuery not available yet
|
// Try to set the version number early, jQuery not available yet
|
||||||
|
var searcheable_versions = [@BROWSEABLE_VERSIONS@];
|
||||||
|
var cx = '@GSEARCH_ID@';
|
||||||
document.addEventListener("DOMContentLoaded", function(event) {
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
if (!gitbook.state.root) return;
|
if (!gitbook.state.root) return;
|
||||||
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
var bookVersion = gitbook.state.root.match(/\/(\d\.\d(\.\d)?|devel)\//);
|
||||||
|
@ -16,6 +18,21 @@ window.localStorage.removeItem(":keyword");
|
||||||
$(document).ready(function() {
|
$(document).ready(function() {
|
||||||
|
|
||||||
function appendHeader() {
|
function appendHeader() {
|
||||||
|
var VERSION_SELECTOR = ""
|
||||||
|
var i = 0;
|
||||||
|
var prefix;
|
||||||
|
for (i = 0; i < searcheable_versions.length; i++ ) {
|
||||||
|
if (searcheable_versions[i] === 'devel') {
|
||||||
|
prefix = '';
|
||||||
|
} else {
|
||||||
|
prefix = 'v';
|
||||||
|
}
|
||||||
|
VERSION_SELECTOR += '<option value="' +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'">' + prefix +
|
||||||
|
searcheable_versions[i] +
|
||||||
|
'</option>\n';
|
||||||
|
}
|
||||||
|
|
||||||
var div = document.createElement('div');
|
var div = document.createElement('div');
|
||||||
div.innerHTML = '<div class="arangodb-header">\n' +
|
div.innerHTML = '<div class="arangodb-header">\n' +
|
||||||
|
@ -30,11 +47,7 @@ function appendHeader() {
|
||||||
' </a>\n' +
|
' </a>\n' +
|
||||||
' </div>\n' +
|
' </div>\n' +
|
||||||
' <select class="arangodb-version-switcher">\n' +
|
' <select class="arangodb-version-switcher">\n' +
|
||||||
' <option value="devel">devel</option>\n' +
|
VERSION_SELECTOR +
|
||||||
' <option value="3.2">v3.2</option>\n' +
|
|
||||||
' <option value="3.1">v3.1</option>\n' +
|
|
||||||
' <option value="3.0">v3.0</option>\n' +
|
|
||||||
' <option value="2.8">v2.8</option>\n' +
|
|
||||||
' </select>\n' +
|
' </select>\n' +
|
||||||
' <div class="google-search">\n' +
|
' <div class="google-search">\n' +
|
||||||
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
' <gcse:searchbox-only></gcse:searchbox-only>\n' +
|
||||||
|
@ -93,7 +106,6 @@ function appendHeader() {
|
||||||
//render header
|
//render header
|
||||||
rerenderNavbar();
|
rerenderNavbar();
|
||||||
function addGoogleSrc() {
|
function addGoogleSrc() {
|
||||||
var cx = '010085642145132923492:djexw6vlsgo';
|
|
||||||
var gcse = document.createElement('script');
|
var gcse = document.createElement('script');
|
||||||
gcse.type = 'text/javascript';
|
gcse.type = 'text/javascript';
|
||||||
gcse.async = true;
|
gcse.async = true;
|
||||||
|
|
|
@ -2,38 +2,54 @@
|
||||||
ALLBOOKS="HTTP AQL Manual Cookbook"
|
ALLBOOKS="HTTP AQL Manual Cookbook"
|
||||||
OTHER_MIME="pdf epub mobi"
|
OTHER_MIME="pdf epub mobi"
|
||||||
|
|
||||||
|
# shellcheck disable=SC2016
|
||||||
|
TRIPPLETICS='```'
|
||||||
declare -A COLORS
|
declare -A COLORS
|
||||||
declare -A C
|
declare -A C
|
||||||
COLORS[RESET]='\033[0m'
|
COLORS[RESET]='\033[0m'
|
||||||
# Regular Colors
|
# Regular Colors
|
||||||
#COLORS[Black]='\033[0;30m' # Black
|
#COLORS[Black]='\033[0;30m' # Black
|
||||||
|
# shellcheck disable=SC2154
|
||||||
COLORS[Red]='\033[0;31m' # Red
|
COLORS[Red]='\033[0;31m' # Red
|
||||||
|
# shellcheck disable=SC2154
|
||||||
COLORS[Green]='\033[0;32m' # Green
|
COLORS[Green]='\033[0;32m' # Green
|
||||||
|
# shellcheck disable=SC2154
|
||||||
COLORS[Yellow]='\033[0;33m' # Yellow
|
COLORS[Yellow]='\033[0;33m' # Yellow
|
||||||
#COLORS[Blue]='\033[0;34m' # Blue
|
#COLORS[Blue]='\033[0;34m' # Blue
|
||||||
#COLORS[Purple]='\033[0;35m' # Purple
|
#COLORS[Purple]='\033[0;35m' # Purple
|
||||||
#COLORS[Cyan]='\033[0;36m' # Cyan
|
#COLORS[Cyan]='\033[0;36m' # Cyan
|
||||||
|
# shellcheck disable=SC2154
|
||||||
COLORS[White]='\033[0;37m' # White
|
COLORS[White]='\033[0;37m' # White
|
||||||
|
|
||||||
for i in "${!COLORS[@]}"; do
|
for i in "${!COLORS[@]}"; do
|
||||||
|
# shellcheck disable=SC2086
|
||||||
C[${i}]=$(echo -e ${COLORS[$i]})
|
C[${i}]=$(echo -e ${COLORS[$i]})
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# shellcheck disable=SC2034
|
||||||
WRN_COLOR="${C[Yellow]}"
|
WRN_COLOR="${C[Yellow]}"
|
||||||
ERR_COLOR="${C[Red]}"
|
ERR_COLOR="${C[Red]}"
|
||||||
STD_COLOR="${C[White]}"
|
STD_COLOR="${C[White]}"
|
||||||
OK_COLOR="${C[Green]}"
|
OK_COLOR="${C[Green]}"
|
||||||
RESET="${C[RESET]}"
|
RESET="${C[RESET]}"
|
||||||
|
|
||||||
newVersionNumber=$(cat ../../VERSION | tr -d '\r\n')
|
newVersionNumber=$( tr -d '\r\n' < ../../VERSION)
|
||||||
|
|
||||||
|
declare -A ALL_GSEARCH_ID
|
||||||
|
for book in ${ALLBOOKS}; do
|
||||||
|
ALL_GSEARCH_ID[$book]=$( grep "GSEARCH_ID_${book}" ../../VERSIONS |sed 's;.*"\([0-9a-zA-Z:-]*\)".*;\1;')
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
GCHANGE_FREQ=$(grep "GCHANGE_FREQ" ../../VERSIONS |sed 's;.*"\([0-9a-zA-Z:]*\)".*;\1;')
|
||||||
|
GPRIORITY=$(grep "GPRIORITY" ../../VERSIONS |sed 's;.*"\([0-9a-zA-Z.]*\)".*;\1;')
|
||||||
|
BROWSEABLE_VERSIONS=$(grep "BROWSEABLE_VERSIONS" ../../VERSIONS |sed -e 's;" *$;;' -e 's;.*";;')
|
||||||
|
|
||||||
function start_X11_display()
|
function start_X11_display()
|
||||||
{
|
{
|
||||||
PIDFILE="$1"
|
PIDFILE="$1"
|
||||||
if test -f "${PIDFILE}"; then
|
if test -f "${PIDFILE}"; then
|
||||||
stop_X11_display "${PIDFILE}"
|
stop_X11_display "${PIDFILE}"
|
||||||
fi
|
fi
|
||||||
/usr/bin/daemon "--pidfile=${PIDFILE}" --name=xvfb --inherit --output=/tmp/xvfb.log -- Xvfb "${DISPLAY}" -screen 0 800x600x16 -ac -pn -noreset
|
/usr/bin/daemon "--pidfile=${PIDFILE}" --name=xvfb --inherit --output=/tmp/xvfb.log -- Xvfb "${DISPLAY}" -screen 0 800x600x16 -ac -pn -noreset
|
||||||
}
|
}
|
||||||
|
@ -57,18 +73,18 @@ function check-summary()
|
||||||
grep -v gitbook-plugin | \
|
grep -v gitbook-plugin | \
|
||||||
grep -v node_modules/ | \
|
grep -v node_modules/ | \
|
||||||
sort > /tmp/is_md.txt
|
sort > /tmp/is_md.txt
|
||||||
|
|
||||||
grep -v '^ *# '< "${NAME}/SUMMARY.md" | \
|
grep -v '^ *# '< "${NAME}/SUMMARY.md" | \
|
||||||
grep '(' |sed -e "s;.*(;;" -e "s;).*;;" | \
|
grep '(' |sed -e "s;.*(;;" -e "s;).*;;" | \
|
||||||
sort > /tmp/is_summary.txt
|
sort > /tmp/is_summary.txt
|
||||||
|
|
||||||
if test "$(comm -3 /tmp/is_md.txt /tmp/is_summary.txt|wc -l)" -ne 0; then
|
if test "$(comm -3 /tmp/is_md.txt /tmp/is_summary.txt|wc -l)" -ne 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "not all files are mapped to the summary!"
|
echo "not all files are mapped to the summary!"
|
||||||
echo " files found | files in summary"
|
echo " files found | files in summary"
|
||||||
comm -3 /tmp/is_md.txt /tmp/is_summary.txt
|
comm -3 /tmp/is_md.txt /tmp/is_summary.txt
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -78,11 +94,11 @@ function book-check-leftover-docublocks()
|
||||||
echo "${STD_COLOR}##### checking for left over docublocks in ${NAME}${RESET}"
|
echo "${STD_COLOR}##### checking for left over docublocks in ${NAME}${RESET}"
|
||||||
ERRORS=$(grep -rl "startDocuBlock" --include "*.md" "ppbooks/${NAME}" | sed -e "s/^/- /g")
|
ERRORS=$(grep -rl "startDocuBlock" --include "*.md" "ppbooks/${NAME}" | sed -e "s/^/- /g")
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "startDocuBlock markers still found in generated output files:"
|
echo "startDocuBlock markers still found in generated output files:"
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,11 +108,11 @@ function book-check-restheader-leftovers()
|
||||||
echo "${STD_COLOR}##### checking for restheader leftovers in ${NAME}${RESET}"
|
echo "${STD_COLOR}##### checking for restheader leftovers in ${NAME}${RESET}"
|
||||||
ERRORS=$(find "ppbooks/${NAME}" -name "*.md" -exec grep -- '^@[A-Z]*' {} \; -print)
|
ERRORS=$(find "ppbooks/${NAME}" -name "*.md" -exec grep -- '^@[A-Z]*' {} \; -print)
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found these unconverted Swagger Restapi tags: "
|
echo "found these unconverted Swagger Restapi tags: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,12 +120,12 @@ function ppbook-precheck-bad-code-sections()
|
||||||
{
|
{
|
||||||
NAME="$1"
|
NAME="$1"
|
||||||
echo "${STD_COLOR}##### checking for bad code sections in ${NAME}${RESET}"
|
echo "${STD_COLOR}##### checking for bad code sections in ${NAME}${RESET}"
|
||||||
if grep -qR '^``` *.* ' "${NAME}"; then
|
if grep -qR "^${TRIPPLETICS} *.* " "${NAME}"; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "tripple tics with blanks afterwards found: "
|
echo "tripple tics with blanks afterwards found: "
|
||||||
grep -R '^``` *.* ' "${NAME}"
|
grep -R "^${TRIPPLETICS} *.* " "${NAME}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,11 +134,11 @@ function ppbook-precheck-bad-headings()
|
||||||
NAME="$1"
|
NAME="$1"
|
||||||
echo "${STD_COLOR}##### checking for headers that won't proper display on github in ${NAME}${RESET}"
|
echo "${STD_COLOR}##### checking for headers that won't proper display on github in ${NAME}${RESET}"
|
||||||
if grep -qRI '^##*[a-zA-Z]' "${NAME}"; then
|
if grep -qRI '^##*[a-zA-Z]' "${NAME}"; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Headlines broken on github found: "
|
echo "Headlines broken on github found: "
|
||||||
grep -RI '^##*[a-zA-Z]' "${NAME}"
|
grep -RI '^##*[a-zA-Z]' "${NAME}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,14 +156,14 @@ function ppbook-check-html-link()
|
||||||
grep -v 'header.css' | \
|
grep -v 'header.css' | \
|
||||||
grep -v -f /tmp/books.regex > /tmp/relative_html_links.txt
|
grep -v -f /tmp/books.regex > /tmp/relative_html_links.txt
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if test "$(wc -l < /tmp/relative_html_links.txt)" -gt 0; then
|
if test "$(wc -l < /tmp/relative_html_links.txt)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Found links to .html files inside of the document! use <foo>.md instead!"
|
echo "Found links to .html files inside of the document! use <foo>.md instead!"
|
||||||
echo
|
echo
|
||||||
cat /tmp/relative_html_links.txt
|
cat /tmp/relative_html_links.txt
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -168,11 +184,11 @@ function ppbook-check-directory-link()
|
||||||
set -e
|
set -e
|
||||||
nERRORS=$(echo -n "${ERRORS}" | wc -l)
|
nERRORS=$(echo -n "${ERRORS}" | wc -l)
|
||||||
if test "$nERRORS" -gt 0; then
|
if test "$nERRORS" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Found director links! use ../<directory>/README.md instead!"
|
echo "Found director links! use ../<directory>/README.md instead!"
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,77 +199,77 @@ function book-check-markdown-leftovers()
|
||||||
echo "${STD_COLOR}##### checking for remaining markdown snippets in the HTML output of ${NAME}${RESET}"
|
echo "${STD_COLOR}##### checking for remaining markdown snippets in the HTML output of ${NAME}${RESET}"
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep -- '##' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep -- '##' {} \; -print)
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}";
|
echo "${ERR_COLOR}";
|
||||||
echo "found these unconverted markdown titles: "
|
echo "found these unconverted markdown titles: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}";
|
echo "${RESET}";
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep -- '&gt;' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep -- '&gt;' {} \; -print)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found these double converted > signs: "
|
echo "found these double converted > signs: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1;
|
exit 1;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\.md\"[ />]' {} \; | grep -v data-filepath)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\.md\"[ />]' {} \; | grep -v data-filepath)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "found dangling markdown links; see the list above "
|
echo "found dangling markdown links; see the list above "
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\.md#' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\.md#' {} \; -print)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found dangling markdown links: "
|
echo "found dangling markdown links: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '```' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep "${TRIPPLETICS}" {} \; -print)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found dangling markdown code sections: "
|
echo "found dangling markdown code sections: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\]<a href' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\]<a href' {} \; -print)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found unconverted markdown links: "
|
echo "found unconverted markdown links: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
set +e
|
set +e
|
||||||
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\[.*\](.*[\.html|\.md|http|#.*])' {} \; -print)
|
ERRORS=$(find "books/${NAME}" -name '*.html' -exec grep '\[.*\](.*[\.html|\.md|http|#.*])' {} \; -print)
|
||||||
set -e
|
set -e
|
||||||
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
if test "$(echo -n "${ERRORS}" | wc -l)" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "found unconverted markdown links: "
|
echo "found unconverted markdown links: "
|
||||||
echo "${ERRORS}"
|
echo "${ERRORS}"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,60 +277,61 @@ function check-dangling-anchors()
|
||||||
{
|
{
|
||||||
echo "${STD_COLOR}##### checking for dangling anchors${RESET}"
|
echo "${STD_COLOR}##### checking for dangling anchors${RESET}"
|
||||||
find books/ -name '*.html' | while IFS= read -r htmlf; do
|
find books/ -name '*.html' | while IFS= read -r htmlf; do
|
||||||
fn=$(basename "${htmlf}")
|
fn=$(basename "${htmlf}")
|
||||||
dir=$(echo "$htmlf" |sed "s;/$fn;;")
|
dir=$(sed "s;/$fn;;" <<< "$htmlf")
|
||||||
mkdir -p "/tmp/tags/${dir}"
|
mkdir -p "/tmp/tags/${dir}"
|
||||||
grep '<h. ' < "${htmlf}" | \
|
grep '<h. ' < "${htmlf}" | \
|
||||||
sed -e 's;.*id=";;' -e 's;".*;;' > "/tmp/tags/${dir}/${fn}"
|
sed -e 's;.*id=";;' -e 's;".*;;' > "/tmp/tags/${dir}/${fn}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "${STD_COLOR}##### fetching anchors from generated http files${RESET}"
|
echo "${STD_COLOR}##### fetching anchors from generated http files${RESET}"
|
||||||
grep -R "a href.*#" books/ | \
|
grep -R "a href.*#" books/ | \
|
||||||
egrep -v "(styles/header\.js|/app\.js|class=\"navigation|https*://|href=\"#\")" | \
|
egrep -v "(styles/header\.js|/app\.js|class=\"navigation|https*://|href=\"#\")" | \
|
||||||
sed 's;\(.*\.html\):.*a href="\(.*\)#\(.*\)">.*</a>.*;\1,\2,\3;' | grep -v " " > /tmp/anchorlist.txt
|
sed 's;\(.*\.html\):.*a href="\(.*\)#\(.*\)">.*</a>.*;\1,\2,\3;' | grep -v " " > /tmp/anchorlist.txt
|
||||||
|
|
||||||
echo "${STD_COLOR}##### cross checking anchors${RESET}"
|
echo "${STD_COLOR}##### cross checking anchors${RESET}"
|
||||||
NO=0
|
NO=0
|
||||||
echo "${NO}" > /tmp/anchorlistcount.txt
|
echo "${NO}" > /tmp/anchorlistcount.txt
|
||||||
|
# shellcheck disable=SC2002
|
||||||
cat /tmp/anchorlist.txt | while IFS= read -r i; do
|
cat /tmp/anchorlist.txt | while IFS= read -r i; do
|
||||||
ANCHOR=$(echo "$i" | cut '-d,' -f 3)
|
ANCHOR=$(echo "$i" | cut '-d,' -f 3)
|
||||||
FN=$(echo "$i" | cut '-d,' -f 2)
|
FN=$(echo "$i" | cut '-d,' -f 2)
|
||||||
SFN=$(echo "$i" | cut '-d,' -f 1)
|
SFN=$(echo "$i" | cut '-d,' -f 1)
|
||||||
|
|
||||||
if test -z "$FN"; then
|
if test -z "$FN"; then
|
||||||
FN="$SFN"
|
FN="$SFN"
|
||||||
else
|
else
|
||||||
SFNP=$(echo "$SFN" | sed 's;/[a-zA-Z0-9]*.html;;')
|
SFNP=$(sed 's;/[a-zA-Z0-9]*.html;;' <<< "$SFN")
|
||||||
FN="${SFNP}/${FN}"
|
FN="${SFNP}/${FN}"
|
||||||
fi
|
fi
|
||||||
if test -d "$FN"; then
|
if test -d "$FN"; then
|
||||||
FN="${FN}index.html"
|
FN="${FN}index.html"
|
||||||
fi
|
fi
|
||||||
if test -n "$ANCHOR"; then
|
if test -n "$ANCHOR"; then
|
||||||
if test ! -f "/tmp/tags/${FN}"; then
|
if test ! -f "/tmp/tags/${FN}"; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "File referenced by ${i} doesn't exist."
|
echo "File referenced by ${i} doesn't exist."
|
||||||
NO=$((NO + 1))
|
NO=$((NO + 1))
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
else
|
else
|
||||||
if grep -q "^$ANCHOR$" "/tmp/tags/$FN"; then
|
if grep -q "^$ANCHOR$" "/tmp/tags/$FN"; then
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Anchor not found in $i"
|
echo "Anchor not found in $i"
|
||||||
NO=$((NO + 1))
|
NO=$((NO + 1))
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "${NO}" > /tmp/anchorlistcount.txt
|
echo "${NO}" > /tmp/anchorlistcount.txt
|
||||||
done
|
done
|
||||||
NO="$(cat /tmp/anchorlistcount.txt)"
|
NO="$(cat /tmp/anchorlistcount.txt)"
|
||||||
if test "${NO}" -gt 0; then
|
if test "${NO}" -gt 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "${NO} Dangling anchors found!"
|
echo "${NO} Dangling anchors found!"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
rm -rf /tmp/anchorlist.txt /tmp/tags
|
rm -rf /tmp/anchorlist.txt /tmp/tags
|
||||||
}
|
}
|
||||||
|
@ -324,13 +341,13 @@ function book-check-images-referenced()
|
||||||
NAME="$1"
|
NAME="$1"
|
||||||
set +e
|
set +e
|
||||||
find "${NAME}" -name \*.png | while IFS= read -r image; do
|
find "${NAME}" -name \*.png | while IFS= read -r image; do
|
||||||
baseimage=$(basename "$image")
|
baseimage=$(basename "$image")
|
||||||
if ! grep -Rq "${baseimage}" "${NAME}"; then
|
if ! grep -Rq "${baseimage}" "${NAME}"; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "$image is not used!"
|
echo "$image is not used!"
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit "1"
|
exit "1"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
set -e
|
set -e
|
||||||
}
|
}
|
||||||
|
@ -341,9 +358,9 @@ function build-book-symlinks()
|
||||||
cd "books/${NAME}"
|
cd "books/${NAME}"
|
||||||
pwd
|
pwd
|
||||||
find . -name "README.md" |\
|
find . -name "README.md" |\
|
||||||
sed -e 's:README\.md$::' |\
|
sed -e 's:README\.md$::' |\
|
||||||
awk '{print "ln -s index.html " "$1" "README.html"}' |\
|
awk '{print "ln -s index.html " "$1" "README.html"}' |\
|
||||||
bash
|
bash
|
||||||
}
|
}
|
||||||
|
|
||||||
function build-book()
|
function build-book()
|
||||||
|
@ -354,24 +371,24 @@ function build-book()
|
||||||
ppbook-precheck-bad-headings "${NAME}"
|
ppbook-precheck-bad-headings "${NAME}"
|
||||||
|
|
||||||
if test ! -d "ppbooks/${NAME}"; then
|
if test ! -d "ppbooks/${NAME}"; then
|
||||||
mkdir -p "ppbooks/${NAME}"
|
mkdir -p "ppbooks/${NAME}"
|
||||||
WD=$(pwd)
|
WD=$(pwd)
|
||||||
find "${NAME}" -type d | while IFS= read -r dir; do
|
find "${NAME}" -type d | while IFS= read -r dir; do
|
||||||
cd "${WD}/ppbooks"
|
cd "${WD}/ppbooks"
|
||||||
test -d "${dir}" || mkdir -p "${dir}"
|
test -d "${dir}" || mkdir -p "${dir}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if ditaa --help > /dev/null; then
|
if ditaa --help > /dev/null; then
|
||||||
echo "${STD_COLOR} - generating ditaa images${RESET}"
|
echo "${STD_COLOR} - generating ditaa images${RESET}"
|
||||||
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
||||||
ditaa "${image}" "ppbooks/${image//ditaa/png}"
|
ditaa "${image}" "ppbooks/${image//ditaa/png}"
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "${ERR_COLOR} - generating FAKE ditaa images - no ditaa installed${RESET}"
|
echo "${ERR_COLOR} - generating FAKE ditaa images - no ditaa installed${RESET}"
|
||||||
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
find "${NAME}" -name "*.ditaa" | while IFS= read -r image; do
|
||||||
cp "../../js/node/node_modules/mocha/images/error.png" \
|
cp "../../js/node/node_modules/mocha/images/error.png" \
|
||||||
"ppbooks/${image//ditaa/png}"
|
"ppbooks/${image//ditaa/png}"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "${STD_COLOR} - preparing environment${RESET}"
|
echo "${STD_COLOR} - preparing environment${RESET}"
|
||||||
(
|
(
|
||||||
|
@ -386,15 +403,8 @@ function build-book()
|
||||||
cp "../../${NAME}/FOOTER.html" .
|
cp "../../${NAME}/FOOTER.html" .
|
||||||
fi
|
fi
|
||||||
)
|
)
|
||||||
if test -z "${RELEASE_DIRECTORY}"; then
|
|
||||||
if ! test -f "ppbooks/${NAME}/book.json" ; then
|
|
||||||
cp "${NAME}/book.json" "ppbooks/${NAME}"
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if ! test -f "ppbooks/${NAME}/book.json" ; then
|
|
||||||
sed "s;/devel;/${RELEASE_DIRECTORY};" < "${NAME}/book.json" > "ppbooks/${NAME}/book.json"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
(
|
(
|
||||||
cd "ppbooks/${NAME}"
|
cd "ppbooks/${NAME}"
|
||||||
cp -a "../../${NAME}/styles/"* styles/
|
cp -a "../../${NAME}/styles/"* styles/
|
||||||
|
@ -402,8 +412,8 @@ function build-book()
|
||||||
WD=$(pwd)
|
WD=$(pwd)
|
||||||
echo "${STD_COLOR} - copying images${RESET}"
|
echo "${STD_COLOR} - copying images${RESET}"
|
||||||
find "${NAME}" -name "*.png" | while IFS= read -r pic; do
|
find "${NAME}" -name "*.png" | while IFS= read -r pic; do
|
||||||
cd "${WD}/ppbooks"
|
cd "${WD}/ppbooks"
|
||||||
cp "${WD}/${pic}" "${pic}"
|
cp "${WD}/${pic}" "${pic}"
|
||||||
done
|
done
|
||||||
|
|
||||||
echo "${STD_COLOR} - generating MD-Files${RESET}"
|
echo "${STD_COLOR} - generating MD-Files${RESET}"
|
||||||
|
@ -412,22 +422,7 @@ function build-book()
|
||||||
ppbooks/ \
|
ppbooks/ \
|
||||||
../../js/apps/system/_admin/aardvark/APP/api-docs.json \
|
../../js/apps/system/_admin/aardvark/APP/api-docs.json \
|
||||||
"${FILTER}" || exit 1
|
"${FILTER}" || exit 1
|
||||||
if echo "${newVersionNumber}" | grep -q devel; then
|
|
||||||
VERSION="${newVersionNumber} $(date +' %d. %b %Y ')"
|
|
||||||
else
|
|
||||||
VERSION="${newVersionNumber}"
|
|
||||||
fi
|
|
||||||
export VERSION
|
|
||||||
echo "${STD_COLOR} - Building Version ${VERSION}${RESET}"
|
|
||||||
|
|
||||||
(
|
|
||||||
cd "ppbooks/${NAME}"
|
|
||||||
sed -i -e "s/VERSION_NUMBER/v${VERSION}/g" styles/header.js
|
|
||||||
sed -i -e "s/VERSION_NUMBER/v${VERSION}/g" HEADER.html
|
|
||||||
sed -i -e "s/VERSION_NUMBER/v${VERSION}/g" README.md
|
|
||||||
sed -i -e "s/VERSION_NUMBER/v${VERSION}/g" book.json
|
|
||||||
)
|
|
||||||
|
|
||||||
test -d "books/${NAME}" || mkdir -p "books/${NAME}"
|
test -d "books/${NAME}" || mkdir -p "books/${NAME}"
|
||||||
|
|
||||||
echo "${STD_COLOR} - Checking integrity ${VERSION}${RESET}"
|
echo "${STD_COLOR} - Checking integrity ${VERSION}${RESET}"
|
||||||
|
@ -437,22 +432,53 @@ function build-book()
|
||||||
ppbook-check-directory-link "${NAME}"
|
ppbook-check-directory-link "${NAME}"
|
||||||
book-check-images-referenced "${NAME}"
|
book-check-images-referenced "${NAME}"
|
||||||
|
|
||||||
|
if echo "${newVersionNumber}" | grep -q devel; then
|
||||||
|
VERSION="${newVersionNumber} $(date +' %d. %b %Y ')"
|
||||||
|
RELEASE_DIRECTORY=devel
|
||||||
|
else
|
||||||
|
VERSION="${newVersionNumber}"
|
||||||
|
RELEASE_DIRECTORY=$(sed "s;\.[0-9]*$;;" <<< "${newVersionNumber}")
|
||||||
|
fi
|
||||||
|
export VERSION
|
||||||
|
|
||||||
|
if ! test -f "ppbooks/${NAME}/book.json" ; then
|
||||||
|
cp "${NAME}/book.json" "ppbooks/${NAME}"
|
||||||
|
fi
|
||||||
|
|
||||||
|
for facilityfile in book.json styles/header.js HEADER.html README.md; do
|
||||||
|
export facilityfile
|
||||||
|
export RELEASE_DIRECTORY
|
||||||
|
(
|
||||||
|
cd "ppbooks/${NAME}"
|
||||||
|
sed -e "s/VERSION_NUMBER/v${VERSION}/g" \
|
||||||
|
-e "s;/devel;/${RELEASE_DIRECTORY};" \
|
||||||
|
-e "s;@GSEARCH_ID@;${ALL_GSEARCH_ID[${NAME}]};" \
|
||||||
|
-e "s;@GCHANGE_FREQ@;${GCHANGE_FREQ};" \
|
||||||
|
-e "s;@GPRIORITY@;${GPRIORITY};" \
|
||||||
|
-e "s;@BROWSEABLE_VERSIONS@;${BROWSEABLE_VERSIONS};" \
|
||||||
|
\
|
||||||
|
-i "${facilityfile}"
|
||||||
|
)
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "${STD_COLOR} - Building Version ${VERSION}${RESET}"
|
||||||
|
|
||||||
if test -n "${NODE_MODULES_DIR}"; then
|
if test -n "${NODE_MODULES_DIR}"; then
|
||||||
echo "${STD_COLOR}#### Installing plugins from ${NODE_MODULES_DIR}${RESET}"
|
echo "${STD_COLOR}#### Installing plugins from ${NODE_MODULES_DIR}${RESET}"
|
||||||
cp -a "${NODE_MODULES_DIR}" "ppbooks/${NAME}"
|
cp -a "${NODE_MODULES_DIR}" "ppbooks/${NAME}"
|
||||||
else
|
else
|
||||||
echo "${STD_COLOR}#### Downloading plugins from ${NODE_MODULES_DIR}${RESET}"
|
echo "${STD_COLOR}#### Downloading plugins from ${NODE_MODULES_DIR}${RESET}"
|
||||||
(cd "ppbooks/${NAME}"; gitbook install -g)
|
(cd "ppbooks/${NAME}"; gitbook install -g)
|
||||||
fi
|
fi
|
||||||
echo "${STD_COLOR} - Building Book ${NAME} ${RESET}"
|
echo "${STD_COLOR} - Building Book ${NAME} ${RESET}"
|
||||||
(cd "ppbooks/${NAME}" && gitbook ${GITBOOK_ARGS} build "./" "./../../books/${NAME}")
|
(cd "ppbooks/${NAME}" && gitbook "${GITBOOK_ARGS[@]}" build "./" "./../../books/${NAME}")
|
||||||
rm -f "./books/${NAME}/HEADER.html"
|
rm -f "./books/${NAME}/HEADER.html"
|
||||||
rm -f "./books/${NAME}/FOOTER.html"
|
rm -f "./books/${NAME}/FOOTER.html"
|
||||||
echo "${STD_COLOR} - deleting markdown files in output (gitbook 3.x bug)"
|
echo "${STD_COLOR} - deleting markdown files in output (gitbook 3.x bug)"
|
||||||
find "./books/${NAME}/" -type f -name "*.md" -delete
|
find "./books/${NAME}/" -type f -name "*.md" -delete
|
||||||
echo "${STD_COLOR} - putting in deprecated items ${RESET}"
|
echo "${STD_COLOR} - putting in deprecated items ${RESET}"
|
||||||
python ../Scripts/deprecated.py || exit 1
|
python ../Scripts/deprecated.py || exit 1
|
||||||
|
|
||||||
book-check-markdown-leftovers "${NAME}"
|
book-check-markdown-leftovers "${NAME}"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -462,12 +488,12 @@ function build-book-dist()
|
||||||
export DISPLAY="$2"
|
export DISPLAY="$2"
|
||||||
cd "ppbooks/${NAME}"
|
cd "ppbooks/${NAME}"
|
||||||
for ext in ${OTHER_MIME}; do
|
for ext in ${OTHER_MIME}; do
|
||||||
OUTPUT="${OUTPUT_DIR}/ArangoDB_${NAME}_${newVersionNumber}.${ext}"
|
OUTPUT="${OUTPUT_DIR}/ArangoDB_${NAME}_${newVersionNumber}.${ext}"
|
||||||
if gitbook ${GITBOOK_ARGS} "${ext}" ./ "${OUTPUT}"; then
|
if gitbook "${GITBOOK_ARGS[@]}" "${ext}" ./ "${OUTPUT}"; then
|
||||||
echo "success building ${OUTPUT}"
|
echo "success building ${OUTPUT}"
|
||||||
else
|
else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -503,21 +529,21 @@ function clean-book-intermediate()
|
||||||
function check-docublocks()
|
function check-docublocks()
|
||||||
{
|
{
|
||||||
grep -R '@startDocuBlock' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
grep -R '@startDocuBlock' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
||||||
grep -v '@startDocuBlockInline' |\
|
grep -v '@startDocuBlockInline' |\
|
||||||
grep -v ppbook |\
|
grep -v ppbook |\
|
||||||
grep -v allComments.txt |\
|
grep -v allComments.txt |\
|
||||||
grep -v Makefile |\
|
grep -v Makefile |\
|
||||||
grep -v '.*~:.*' |\
|
grep -v '.*~:.*' |\
|
||||||
grep -v '.*#.*:.*' \
|
grep -v '.*#.*:.*' \
|
||||||
> /tmp/rawindoc.txt
|
> /tmp/rawindoc.txt
|
||||||
|
|
||||||
grep -R '@startDocuBlockInline' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
grep -R '@startDocuBlockInline' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
||||||
grep -v ppbook |\
|
grep -v ppbook |\
|
||||||
grep -v allComments.txt |\
|
grep -v allComments.txt |\
|
||||||
grep -v Makefile |\
|
grep -v Makefile |\
|
||||||
grep -v '.*~:.*' |\
|
grep -v '.*~:.*' |\
|
||||||
grep -v '.*#.*:.*' \
|
grep -v '.*#.*:.*' \
|
||||||
>> /tmp/rawindoc.txt
|
>> /tmp/rawindoc.txt
|
||||||
|
|
||||||
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawindoc.txt |sort -u > /tmp/indoc.txt
|
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawindoc.txt |sort -u > /tmp/indoc.txt
|
||||||
|
|
||||||
|
@ -525,45 +551,45 @@ function check-docublocks()
|
||||||
grep -R '^@startDocuBlock' ../DocuBlocks --include "*.md" --include "*.md" |grep -v aardvark > /tmp/rawinprog.txt
|
grep -R '^@startDocuBlock' ../DocuBlocks --include "*.md" --include "*.md" |grep -v aardvark > /tmp/rawinprog.txt
|
||||||
# searching the Inline docublocks needs some more blacklisting:
|
# searching the Inline docublocks needs some more blacklisting:
|
||||||
grep -R '@startDocuBlockInline' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
grep -R '@startDocuBlockInline' --include "*.h" --include "*.cpp" --include "*.js" --include "*.md" . |\
|
||||||
grep -v ppbook |\
|
grep -v ppbook |\
|
||||||
grep -v allComments.txt |\
|
grep -v allComments.txt |\
|
||||||
grep -v Makefile |\
|
grep -v Makefile |\
|
||||||
grep -v '.*~:.*' |\
|
grep -v '.*~:.*' |\
|
||||||
grep -v '.*#.*:.*' \
|
grep -v '.*#.*:.*' \
|
||||||
>> /tmp/rawinprog.txt
|
>> /tmp/rawinprog.txt
|
||||||
set -e
|
set -e
|
||||||
echo "Generated: startDocuBlockInline errorCodes">> /tmp/rawinprog.txt
|
echo "Generated: startDocuBlockInline errorCodes">> /tmp/rawinprog.txt
|
||||||
|
|
||||||
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawinprog.txt |sort > /tmp/inprog_raw.txt
|
sed -e "s;.*ck ;;" -e "s;.*ne ;;" < /tmp/rawinprog.txt |sort > /tmp/inprog_raw.txt
|
||||||
sort -u < /tmp/inprog_raw.txt > /tmp/inprog.txt
|
sort -u < /tmp/inprog_raw.txt > /tmp/inprog.txt
|
||||||
|
|
||||||
if test "$(wc -l < /tmp/inprog.txt)" -ne "$(wc -l < /tmp/inprog_raw.txt)"; then
|
if test "$(wc -l < /tmp/inprog.txt)" -ne "$(wc -l < /tmp/inprog_raw.txt)"; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Duplicate entry found in the source trees:"
|
echo "Duplicate entry found in the source trees:"
|
||||||
comm -3 /tmp/inprog_raw.txt /tmp/inprog.txt
|
comm -3 /tmp/inprog_raw.txt /tmp/inprog.txt
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test "$(comm -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -ne 0; then
|
if test "$(comm -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -ne 0; then
|
||||||
echo "${ERR_COLOR}"
|
echo "${ERR_COLOR}"
|
||||||
echo "Not all blocks were found on both sides:"
|
echo "Not all blocks were found on both sides:"
|
||||||
echo "Documentation | Programcode:"
|
echo "Documentation | Programcode:"
|
||||||
comm -3 /tmp/indoc.txt /tmp/inprog.txt
|
comm -3 /tmp/indoc.txt /tmp/inprog.txt
|
||||||
if test "$(comm -2 -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -gt 0; then
|
if test "$(comm -2 -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -gt 0; then
|
||||||
echo "Documentation: "
|
echo "Documentation: "
|
||||||
for grepit in $(comm -2 -3 /tmp/indoc.txt /tmp/inprog.txt); do
|
for grepit in $(comm -2 -3 /tmp/indoc.txt /tmp/inprog.txt); do
|
||||||
grep "$grepit" /tmp/rawindoc.txt
|
grep "$grepit" /tmp/rawindoc.txt
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
if test "$(comm -1 -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -gt 0; then
|
if test "$(comm -1 -3 /tmp/indoc.txt /tmp/inprog.txt |wc -l)" -gt 0; then
|
||||||
echo "Program code:"
|
echo "Program code:"
|
||||||
for grepit in $(comm -1 -3 /tmp/indoc.txt /tmp/inprog.txt); do
|
for grepit in $(comm -1 -3 /tmp/indoc.txt /tmp/inprog.txt); do
|
||||||
grep "$grepit" /tmp/rawinprog.txt | sed "s;/// @startDocuBlock;\t\t;"
|
grep "$grepit" /tmp/rawinprog.txt | sed "s;/// @startDocuBlock;\t\t;"
|
||||||
done
|
done
|
||||||
fi
|
fi
|
||||||
echo "${RESET}"
|
echo "${RESET}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -594,15 +620,15 @@ function build-books()
|
||||||
rm -rf /tmp/tags
|
rm -rf /tmp/tags
|
||||||
set -e
|
set -e
|
||||||
for book in ${ALLBOOKS}; do
|
for book in ${ALLBOOKS}; do
|
||||||
clean-intermediate "${book}"
|
clean-intermediate "${book}"
|
||||||
done
|
done
|
||||||
|
|
||||||
for book in ${ALLBOOKS}; do
|
for book in ${ALLBOOKS}; do
|
||||||
build-book-keep-md "${book}"
|
build-book-keep-md "${book}"
|
||||||
done
|
done
|
||||||
|
|
||||||
for book in ${ALLBOOKS}; do
|
for book in ${ALLBOOKS}; do
|
||||||
ppbook-check-html-link "${book}"
|
ppbook-check-html-link "${book}"
|
||||||
done
|
done
|
||||||
|
|
||||||
check-docublocks
|
check-docublocks
|
||||||
|
@ -618,29 +644,29 @@ function build-dist-books()
|
||||||
rm -rf books ppbooks
|
rm -rf books ppbooks
|
||||||
PIDFILE=/tmp/xvfb_20_0.pid
|
PIDFILE=/tmp/xvfb_20_0.pid
|
||||||
if test -z "${DISPLAY}"; then
|
if test -z "${DISPLAY}"; then
|
||||||
DISPLAY=:20.0
|
DISPLAY=:20.0
|
||||||
start_X11_display "${PIDFILE}" "${DISP}"
|
start_X11_display "${PIDFILE}" "${DISP}"
|
||||||
trap 'stop_X11_display "${PIDFILE}"' 0
|
trap 'stop_X11_display "${PIDFILE}"' 0
|
||||||
fi
|
fi
|
||||||
export DISPLAY
|
export DISPLAY
|
||||||
|
|
||||||
WD=$(pwd)
|
WD=$(pwd)
|
||||||
build-books
|
build-books
|
||||||
mkdir -p "${OUTPUT_DIR}"
|
mkdir -p "${OUTPUT_DIR}"
|
||||||
(
|
(
|
||||||
mv books "ArangoDB-${newVersionNumber}"
|
mv books "ArangoDB-${newVersionNumber}"
|
||||||
pwd
|
pwd
|
||||||
tar -czf "${OUTPUT_DIR}/ArangoDB-${newVersionNumber}.tar.gz" "ArangoDB-${newVersionNumber}"
|
tar -czf "${OUTPUT_DIR}/ArangoDB-${newVersionNumber}.tar.gz" "ArangoDB-${newVersionNumber}"
|
||||||
mv "ArangoDB-${newVersionNumber}" books
|
mv "ArangoDB-${newVersionNumber}" books
|
||||||
)
|
)
|
||||||
for book in $ALLBOOKS; do
|
for book in $ALLBOOKS; do
|
||||||
cd "$WD"; build-book-dist "${book}"
|
cd "$WD"; build-book-dist "${book}"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
function printHelp()
|
function printHelp()
|
||||||
{
|
{
|
||||||
cat <<EOF
|
cat <<EOF
|
||||||
Usage: VERB arguments
|
Usage: VERB arguments
|
||||||
Available Verbs:
|
Available Verbs:
|
||||||
build-dist-books - build all books in all representations (HTML(+tarball)/PDF/...) - takes some time.
|
build-dist-books - build all books in all representations (HTML(+tarball)/PDF/...) - takes some time.
|
||||||
|
@ -669,36 +695,36 @@ fi
|
||||||
|
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--name)
|
--name)
|
||||||
shift
|
|
||||||
NAME=$1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--filter)
|
|
||||||
shift
|
|
||||||
FILTER=$1
|
|
||||||
export FILTER
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--outputDir)
|
|
||||||
shift
|
|
||||||
OUTPUT_DIR=$1
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--cookBook)
|
|
||||||
shift
|
|
||||||
shift
|
|
||||||
;;
|
|
||||||
--nodeModulesDir)
|
|
||||||
shift
|
|
||||||
NODE_MODULES_DIR=$1
|
|
||||||
export NODE_MODULES_DIR
|
|
||||||
shift
|
shift
|
||||||
;;
|
NAME=$1
|
||||||
*)
|
shift
|
||||||
printHelp
|
;;
|
||||||
exit 1
|
--filter)
|
||||||
;;
|
shift
|
||||||
|
FILTER=$1
|
||||||
|
export FILTER
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--outputDir)
|
||||||
|
shift
|
||||||
|
OUTPUT_DIR=$1
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--cookBook)
|
||||||
|
shift
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
--nodeModulesDir)
|
||||||
|
shift
|
||||||
|
NODE_MODULES_DIR=$1
|
||||||
|
export NODE_MODULES_DIR
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
printHelp
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
@ -706,34 +732,34 @@ done
|
||||||
|
|
||||||
case "$VERB" in
|
case "$VERB" in
|
||||||
build-books)
|
build-books)
|
||||||
build-books
|
build-books
|
||||||
;;
|
;;
|
||||||
build-book)
|
build-book)
|
||||||
if test -z "$NAME"; then
|
if test -z "$NAME"; then
|
||||||
echo "you need to specify the name!"
|
echo "you need to specify the name!"
|
||||||
printHelp
|
printHelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
build-book "$NAME"
|
build-book "$NAME"
|
||||||
;;
|
;;
|
||||||
build-dist-books)
|
build-dist-books)
|
||||||
build-dist-books
|
build-dist-books
|
||||||
;;
|
;;
|
||||||
build-book-keep-md)
|
build-book-keep-md)
|
||||||
if test -z "$NAME"; then
|
if test -z "$NAME"; then
|
||||||
echo "you need to specify the name!"
|
echo "you need to specify the name!"
|
||||||
printHelp
|
printHelp
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
build-book-keep-md "$NAME"
|
build-book-keep-md "$NAME"
|
||||||
;;
|
;;
|
||||||
clean)
|
clean)
|
||||||
clean
|
clean "$@"
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
printHelp
|
printHelp
|
||||||
exit 1
|
exit 1
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "${OK_COLOR}Well done!${RESET}"
|
echo "${OK_COLOR}Well done!${RESET}"
|
||||||
|
|
|
@ -0,0 +1,7 @@
|
||||||
|
GSEARCH_ID_HTTP "010085642145132923492:fixi4yzeiz8"
|
||||||
|
GSEARCH_ID_AQL "010085642145132923492:6ymjhhr677k"
|
||||||
|
GSEARCH_ID_Manual "010085642145132923492:djexw6vlsgo"
|
||||||
|
GSEARCH_ID_Cookbook "010085642145132923492:nknyifjn7tu"
|
||||||
|
GCHANGE_FREQ "daily"
|
||||||
|
GPRIORITY "0.3"
|
||||||
|
BROWSEABLE_VERSIONS "'devel', '3.2', '3.1', '3.0', '2.8'"
|
Loading…
Reference in New Issue