You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by dk...@apache.org on 2016/09/03 07:04:43 UTC

tinkerpop git commit: Callouts in docs are now processed language-specific. Python uses '#' to comment them out, all other languages will currently fall back to '//'.

Repository: tinkerpop
Updated Branches:
  refs/heads/master b9030962b -> 27fd4deca


Callouts in docs are now processed language-specific. Python uses '#' to comment them out, all other languages will currently fall back to '//'.


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

Branch: refs/heads/master
Commit: 27fd4decadbcf3241ce163bf7f897ebe23052b46
Parents: b903096
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Sat Sep 3 09:02:48 2016 +0200
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Sat Sep 3 09:02:48 2016 +0200

----------------------------------------------------------------------
 docs/preprocessor/awk/prepare.awk | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27fd4dec/docs/preprocessor/awk/prepare.awk
----------------------------------------------------------------------
diff --git a/docs/preprocessor/awk/prepare.awk b/docs/preprocessor/awk/prepare.awk
index d880270..415a6b5 100644
--- a/docs/preprocessor/awk/prepare.awk
+++ b/docs/preprocessor/awk/prepare.awk
@@ -20,6 +20,7 @@
 #
 BEGIN {
   p = 0
+  c = "//"
 }
 
 function escape_string(string) {
@@ -32,7 +33,7 @@ function print_string(string) {
 }
 
 function transform_callouts(code) {
-  return gensub(/\s*((<[0-9]+>\s*)*<[0-9]+>)\s*$/, " //// \\1", "g", code)
+  return gensub(/\s*((<[0-9]+>\s*)*<[0-9]+>)\s*$/, " " c c " \\1", "g", code)
 }
 
 function remove_callouts(code) {
@@ -66,6 +67,18 @@ function remove_callouts(code) {
 
 /^\[gremlin-/ {
   inCodeSection = 1
+  split($0, a, "-")
+  b = gensub(/]'/, "", "g", a[2])
+  split(b, l, ",")
+  lang = l[1]
+  switch (lang) {
+    case "python":
+      c = "#"
+      break
+    default:
+      c = "//"
+      break
+  }
 }
 
 END {