You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2015/11/22 06:59:31 UTC

[16/22] incubator-tinkerpop git commit: adjustments in the AsciiDoc preprocessor in order to make it work using the new directory structure

adjustments in the AsciiDoc preprocessor in order to make it work using the new directory structure


Project: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/commit/28e0b280
Tree: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/tree/28e0b280
Diff: http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/diff/28e0b280

Branch: refs/heads/master
Commit: 28e0b280b598264483207693162dc42b23cf8b04
Parents: bc46d64
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Fri Nov 20 19:31:43 2015 +0100
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Nov 20 19:31:43 2015 +0100

----------------------------------------------------------------------
 docs/preprocessor/preprocess-file.sh         |  5 ++--
 docs/preprocessor/preprocess.sh              | 36 +++++++++++++----------
 docs/src/dev/developer/contributing.asciidoc |  9 ++++++
 3 files changed, 33 insertions(+), 17 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/28e0b280/docs/preprocessor/preprocess-file.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess-file.sh b/docs/preprocessor/preprocess-file.sh
index b9d7f4e..a8bd3e3 100755
--- a/docs/preprocessor/preprocess-file.sh
+++ b/docs/preprocessor/preprocess-file.sh
@@ -24,8 +24,9 @@ CONSOLE_HOME=$1
 AWK_SCRIPTS="${TP_HOME}/docs/preprocessor/awk"
 
 input=$2
-name=`basename ${input}`
-output="${TP_HOME}/target/postprocess-asciidoc/${name}"
+output=`sed 's@/docs/src/@/target/postprocess-asciidoc/@' <<< "${input}"`
+
+mkdir -p `dirname ${output}`
 
 if hash stdbuf 2> /dev/null; then
   lb="stdbuf -oL"

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/28e0b280/docs/preprocessor/preprocess.sh
----------------------------------------------------------------------
diff --git a/docs/preprocessor/preprocess.sh b/docs/preprocessor/preprocess.sh
index 5d66c17..62a8b23 100755
--- a/docs/preprocessor/preprocess.sh
+++ b/docs/preprocessor/preprocess.sh
@@ -36,11 +36,6 @@ do
   fi
 done
 
-nc -z localhost 2181 || (
-  echo "ZooKeeper is not running, be sure to start it before processing the docs."
-  exit 1
-)
-
 if [ -e /tmp/neo4j ]; then
   echo "The directory '/tmp/neo4j' is required by the pre-processor, be sure to delete it before processing the docs."
   exit 1
@@ -121,16 +116,27 @@ echo
 echo "============================"
 echo "+   Processing AsciiDocs   +"
 echo "============================"
-find "${TP_HOME}/docs/src/" -name "*.asciidoc" |
-     xargs -n1 basename |
-     xargs -n1 -I {} echo "echo -ne {}' '; (grep -n {} ${TP_HOME}/docs/src/index.asciidoc || echo 0) | cut -d ':' -f1" | /bin/bash | sort -nk2 | cut -d ' ' -f1 |
-     xargs -n1 -I {} echo "${TP_HOME}/docs/src/{}" |
-     xargs -n1 ${TP_HOME}/docs/preprocessor/preprocess-file.sh "${CONSOLE_HOME}"
-
-ps=(${PIPESTATUS[@]})
-for i in {0..7}; do
-  ec=${ps[i]}
-  [ ${ec} -eq 0 ] || break
+
+ec=0
+process_subdirs=1
+find "${TP_HOME}/docs/src/" -name index.asciidoc | xargs -n1 dirname | while read subdir ; do
+  if [ ${process_subdirs} -eq 1 ]; then
+    find "${subdir}" -name "*.asciidoc" |
+         xargs -n1 basename |
+         xargs -n1 -I {} echo "echo -ne {}' '; (grep -n {} ${subdir}/index.asciidoc || echo 0) | cut -d ':' -f1" | /bin/bash | sort -nk2 | cut -d ' ' -f1 |
+         xargs -n1 -I {} echo "${subdir}/{}" |
+         xargs -n1 ${TP_HOME}/docs/preprocessor/preprocess-file.sh "${CONSOLE_HOME}"
+
+    ps=(${PIPESTATUS[@]})
+    for i in {0..7}; do
+      ec=${ps[i]}
+      [ ${ec} -eq 0 ] || break
+    done
+
+    if [ ${ec} -ne 0 ]; then
+      process_subdirs=0
+    fi
+  fi
 done
 
 tput smam

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/28e0b280/docs/src/dev/developer/contributing.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/developer/contributing.asciidoc b/docs/src/dev/developer/contributing.asciidoc
index 38da30d..deaccfa 100644
--- a/docs/src/dev/developer/contributing.asciidoc
+++ b/docs/src/dev/developer/contributing.asciidoc
@@ -360,3 +360,12 @@ Everything else should be listed and present under the appropriate license secti
 
 There is also a good chance that the TinkerPop binary NOTICE should be updated. Check if the newly added dependency
 contains a NOTICE of its own. If so, include that NOTICE in the TinkerPop NOTICE.
+
+[[documentation]]
+Documentation
+~~~~~~~~~~~~~
+
+The TinkerPop docs are splitted into several subdirectories, each having its own index.asciidoc file. If a new AsciiDoc
+file is added, then it should also be included in the index.asciidoc file, otherwise the preprocessor will ignore it.
+Likewise, if a whole new section (subdirectory) is added, it must include an index.asciidoc file in order to be
+recognized by the AsciiDoc preprocessor.