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 2018/03/09 15:36:01 UTC

[50/50] tinkerpop git commit: transformed callouts to enable easy copy/pasting from code tabs

transformed callouts to enable easy copy/pasting from code tabs


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

Branch: refs/heads/TINKERPOP-1447
Commit: 605c0690768a4c2fcae5c3914dd59d5dac4517a1
Parents: 7629dec
Author: Daniel Kuppitz <da...@hotmail.com>
Authored: Wed Jan 3 10:13:06 2018 -0700
Committer: Daniel Kuppitz <da...@hotmail.com>
Committed: Fri Mar 9 08:34:51 2018 -0700

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


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/605c0690/docs/preprocessor/awk/tabify.awk
----------------------------------------------------------------------
diff --git a/docs/preprocessor/awk/tabify.awk b/docs/preprocessor/awk/tabify.awk
index df92734..24d42a6 100644
--- a/docs/preprocessor/awk/tabify.awk
+++ b/docs/preprocessor/awk/tabify.awk
@@ -47,6 +47,10 @@ function print_tabs(next_id, tabs, blocks) {
   print "++++\n"
 }
 
+function transform_callouts(code, c) {
+  return gensub(/\s*((<[0-9]+>\s*)*<[0-9]+>)\s*\n/, " " c c " \\1\\2\n", "g", code)
+}
+
 BEGIN {
   id_part=systime()
   status = 0
@@ -98,7 +102,15 @@ BEGIN {
         i++
       }
       tabs[i] = lang
-      blocks[i] = "[source," lang "]" code "\n" $0 "\n"
+      switch (lang) {
+        case "python":
+          c = "#"
+          break
+        default:
+          c = "//"
+          break
+      }
+      blocks[i] = "[source," lang "]" transform_callouts(code, c) "\n" $0 "\n"
     }
   } else {
     if (status == 0) print