tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dkupp...@apache.org
Subject [50/50] tinkerpop git commit: transformed callouts to enable easy copy/pasting from code tabs
Date Fri, 09 Mar 2018 15:36:01 GMT
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 <daniel_kuppitz@hotmail.com>
Authored: Wed Jan 3 10:13:06 2018 -0700
Committer: Daniel Kuppitz <daniel_kuppitz@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


Mime
View raw message