[Sciviews-commits] r506 - komodo/SciViews-K/udl pkg/svSweave/inst/asciidoc pkg/svSweave/inst/asciidoc/filters/source pkg/svSweave/inst/asciidoc/javascripts

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Thu Jan 3 23:57:27 CET 2013


Author: phgrosjean
Date: 2013-01-03 23:57:27 +0100 (Thu, 03 Jan 2013)
New Revision: 506

Modified:
   komodo/SciViews-K/udl/wikilex.udl
   pkg/svSweave/inst/asciidoc/asciidoc.conf
   pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf
   pkg/svSweave/inst/asciidoc/javascripts/ASCIIMathML.js
Log:
Further fine-tuning of Rdoc syntax in svSweave package and Rwiki higlighter in SciViews-K

Modified: komodo/SciViews-K/udl/wikilex.udl
===================================================================
--- komodo/SciViews-K/udl/wikilex.udl	2013-01-02 18:54:24 UTC (rev 505)
+++ komodo/SciViews-K/udl/wikilex.udl	2013-01-03 22:57:27 UTC (rev 506)
@@ -45,6 +45,7 @@
 '##': paint(upto, M_CDATA), paint(include, M_COMMENT), => in_wiki_have_comment
 
 # This is for the item list
+'- ': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
 '* ': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
 '** ': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
 '*** ': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
@@ -77,33 +78,40 @@
 'CAUTION:': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
 'TIP:': paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_on_line
 
-# Everything between [] on the beginning of a line, or with name:: is tag
+# Everything between [] on the beginning of a line, or with name;; name:: name::: name:::: is tag
 /\[.*\]$/: paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_start_of_line
-/[a-zA-Z][a-zA-Z _0-9]+::$/: paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_start_of_line
+/[a-zA-Z][a-zA-Z _0-9]+;;$/: paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_start_of_line
+/[a-zA-Z][a-zA-Z _0-9]+:::?:?$/: paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_start_of_line
 
 /./: redo, => in_wiki_default_on_line
 
 state in_wiki_finish_header:
 /$/ : paint(upto, M_PI), paint(include, M_PI), => in_wiki_default_start_of_line
 #/\s+/ : #stay
-'##': paint(upto, M_PI), paint(include, M_COMMENT), => in_wiki_have_comment
+#'##': paint(upto, M_PI), paint(include, M_COMMENT), => in_wiki_have_comment
 #/./: redo, => in_wiki_default_on_line
 
 state in_wiki_default_on_line:
-'##': paint(upto, M_CDATA), paint(include, M_COMMENT), => in_wiki_have_comment
+#'##': paint(upto, M_CDATA), paint(include, M_COMMENT), => in_wiki_have_comment
 # Line break with +
 / \+$/: paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_default_start_of_line
 /$/: => in_wiki_default_start_of_line
+# We don't want to transit to italic stage for URLs like http://xxx
+"://": #stay
 "//" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_italic
 "**" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_bold
-"++" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_monospaced
+## TODO: use a different language here... may be latex or latexequation?
+"+++$$" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_equation
+"$$" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_code
+"+++" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_passthrough
+"~~" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_monospaced
 
-"'''''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q5
-"'''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q3
-"''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q2
+#"'''''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q5
+#"'''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q3
+#"''" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_q2
 
-"~~" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_tilde2
-"^^" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_caret
+"__" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_subscript
+"^^" : paint(upto, M_CDATA), paint(include, M_TAGNAME), => in_wiki_superscript
 
 '{{{' : paint(upto, M_CDATA), => in_wiki_brace_3
 /!'+/: #stay
@@ -154,33 +162,47 @@
 
 #{{{ in-line things
 state in_wiki_italic:
+# We don't want to transit from italic stage for URLs like http://xxx
+"://": #stay
 /!\/+/: #stay
 ## TODO: allow for other in-line things inside this!
 "//" : paint(upto, M_ATTRNAME), paint(include, M_TAGNAME), => in_wiki_default_on_line
 
 state in_wiki_bold:
-/!\*+/: #stay
+/!\**/: #stay
 "**" : paint(upto, M_TAGNAME), paint(include, M_TAGNAME), => in_wiki_default_on_line
 
+state in_wiki_equation:
+/!\$$+++/: #stay
+"$$+++" : paint(upto, M_TAGNAME), paint(include, M_TAGNAME), => in_wiki_default_on_line
+
+state in_wiki_code:
+/!\$$/: #stay
+"$$" : paint(upto, CSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+
+state in_wiki_passthrough:
+/!\+++/: #stay
+"+++" : paint(upto, SSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+
 state in_wiki_monospaced:
-/!\++/: #stay
-"++" : paint(upto, CSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+/!\~~/: #stay
+"~~" : paint(upto, CSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
 
-state in_wiki_q5:
-/!'+/: #stay
-"'''''" : paint(upto, M_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
-state in_wiki_q3:
-/!'+/: #stay
-"'''" : paint(upto, SSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
-state in_wiki_q2:
-/!'+/: #stay
-"''" : paint(upto, CSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+#state in_wiki_q5:
+#/!'+/: #stay
+#"'''''" : paint(upto, M_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+#state in_wiki_q3:
+#/!'+/: #stay
+#"'''" : paint(upto, SSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+#state in_wiki_q2:
+#/!'+/: #stay
+#"''" : paint(upto, CSL_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
 
-state in_wiki_tilde2:
-/!~+/: #stay
-"~~" : paint(upto, M_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
-state in_wiki_caret:
-/!^+/: #stay
+state in_wiki_subscript:
+/!__/: #stay
+"__" : paint(upto, M_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
+state in_wiki_superscript:
+/!^^/: #stay
 "^^" : paint(upto, M_STRING), paint(include, M_TAGNAME), => in_wiki_default_on_line
 #}}}
 

Modified: pkg/svSweave/inst/asciidoc/asciidoc.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/asciidoc.conf	2013-01-02 18:54:24 UTC (rev 505)
+++ pkg/svSweave/inst/asciidoc/asciidoc.conf	2013-01-03 22:57:27 UTC (rev 506)
@@ -7,8 +7,8 @@
 #
 
 [miscellaneous]
-tabsize=8
-textwidth=70
+tabsize=4
+textwidth=80
 newline=\r\n
 
 [attributes]
@@ -73,26 +73,27 @@
 [quotes]
 # The order is important, quotes are processed in conf file order.
 **=#strong
-**=strong
+#**=strong
 ``|''=doublequoted
-'=emphasis
+#'=emphasis
+### TODO: eliminate this?!
 `|'=singlequoted
-ifdef::no-inline-literal[]
-`=monospaced
-endif::no-inline-literal[]
+#ifdef::no-inline-literal[]
+#`=monospaced
+#endif::no-inline-literal[]
 # +++ and $$ quoting is applied to the +++ and $$ inline passthrough
 # macros to allow quoted attributes to be used.
 # This trick only works with inline passthrough macros.
 +++=#unquoted
-$$=#unquoted
-++=#monospaced
-++=monospaced
+#$$=#unquoted
+$$=monospaced
+~~=#monospaced
 //=#emphasis
-//=emphasis
-\##=#unquoted
-\#=unquoted
+#//=emphasis
+##\##=#unquoted
+##\#=unquoted
 ^^=#superscript
-~~=#subscript
+__=#subscript
 
 [specialwords]
 emphasizedwords=

Modified: pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf	2013-01-02 18:54:24 UTC (rev 505)
+++ pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf	2013-01-03 22:57:27 UTC (rev 506)
@@ -88,6 +88,14 @@
 source-style=template="source-highlight-block",presubs=(),postsubs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab")
 endif::basebackend-docbook[]
 
+## Added by PhG to bypass a problem with latex backend
+ifdef::basebackend-latex[]
+[source-filter-style]
+source-style=template="source-highlight-block",presubs=(),postsubs=("specialcharacters","callouts"),posattrs=("style","language","src_numbered","src_tab")
+endif::basebackend-latex[]
+
+
+
 #########################
 # Source paragraph styles
 #########################

Modified: pkg/svSweave/inst/asciidoc/javascripts/ASCIIMathML.js
===================================================================
--- pkg/svSweave/inst/asciidoc/javascripts/ASCIIMathML.js	2013-01-02 18:54:24 UTC (rev 505)
+++ pkg/svSweave/inst/asciidoc/javascripts/ASCIIMathML.js	2013-01-03 22:57:27 UTC (rev 506)
@@ -34,8 +34,10 @@
 var displaystyle = true;      // puts limits above and below large operators
 var showasciiformulaonhover = true; // helps students learn ASCIIMath
 var decimalsign = ".";        // change to "," if you like, beware of `(1,2)`!
-var AMdelimiter1 = "`", AMescape1 = "\\\\`"; // can use other characters
-var AMdelimiter2 = "$", AMescape2 = "\\\\\\$", AMdelimiter2regexp = "\\$";
+var AMdelimiter1 = "``", AMescape1 = "\\\\``"; // can use other characters
+// PhG: was "`"
+var AMdelimiter2 = "$$", AMescape2 = "\\\\\\$\\$", AMdelimiter2regexp = "\\$\\$";
+// PhG: was "$"
 var doubleblankmathdelimiter = false; // if true,  x+1  is equal to `x+1`
                                       // for IE this works only in <!--   -->
 //var separatetokens;// has been removed (email me if this is a problem)



More information about the Sciviews-commits mailing list