[Sciviews-commits] r486 - in pkg: SciViews SciViews/R SciViews/man svSweave svSweave/R svSweave/inst/asciidoc svSweave/inst/asciidoc/filters/graphviz svSweave/inst/asciidoc/filters/latex svSweave/inst/asciidoc/filters/music svSweave/inst/asciidoc/filters/source svSweave/inst/asciidoc/javascripts svSweave/inst/asciidoc/stylesheets svSweave/man
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Sat Nov 17 17:25:50 CET 2012
Author: phgrosjean
Date: 2012-11-17 17:25:49 +0100 (Sat, 17 Nov 2012)
New Revision: 486
Added:
pkg/svSweave/inst/asciidoc/html4.conf
pkg/svSweave/inst/asciidoc/html5.conf
pkg/svSweave/inst/asciidoc/lang-el.conf
pkg/svSweave/inst/asciidoc/latex.conf
pkg/svSweave/inst/asciidoc/stylesheets/xhtml11-quirks.css
pkg/svSweave/inst/asciidoc/text.conf
pkg/svSweave/inst/asciidoc/wordpress.conf
pkg/svSweave/inst/asciidoc/xhtml11-quirks.conf
Modified:
pkg/SciViews/NAMESPACE
pkg/SciViews/NEWS
pkg/SciViews/R/colors.R
pkg/SciViews/man/colors.Rd
pkg/svSweave/DESCRIPTION
pkg/svSweave/NAMESPACE
pkg/svSweave/NEWS
pkg/svSweave/R/tangleLyxRnw.R
pkg/svSweave/R/weaveLyxRnw.R
pkg/svSweave/inst/asciidoc/CHANGELOG.txt
pkg/svSweave/inst/asciidoc/asciidoc.conf
pkg/svSweave/inst/asciidoc/asciidoc.py
pkg/svSweave/inst/asciidoc/filters/graphviz/graphviz-filter.conf
pkg/svSweave/inst/asciidoc/filters/latex/latex-filter.conf
pkg/svSweave/inst/asciidoc/filters/music/music-filter.conf
pkg/svSweave/inst/asciidoc/filters/music/music2png.py
pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf
pkg/svSweave/inst/asciidoc/javascripts/ASCIIMathML.js
pkg/svSweave/inst/asciidoc/slidy.conf
pkg/svSweave/inst/asciidoc/stylesheets/asciidoc.css
pkg/svSweave/inst/asciidoc/stylesheets/pygments.css
pkg/svSweave/inst/asciidoc/xhtml11.conf
pkg/svSweave/man/cleanLyxRnw.Rd
pkg/svSweave/man/svSweave-package.Rd
Log:
colors added to SciViews
changes in svSweave and update to Asciidoc 8.6-8
Modified: pkg/SciViews/NAMESPACE
===================================================================
--- pkg/SciViews/NAMESPACE 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/SciViews/NAMESPACE 2012-11-17 16:25:49 UTC (rev 486)
@@ -108,6 +108,7 @@
as.correlation,
cwm.colors,
rwb.colors,
+ rwg.colors,
ryg.colors,
Pi,
E,
Modified: pkg/SciViews/NEWS
===================================================================
--- pkg/SciViews/NEWS 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/SciViews/NEWS 2012-11-17 16:25:49 UTC (rev 486)
@@ -4,7 +4,9 @@
* Several changes in character.R.
+* Added the rwg.colors() function.
+
== SciViews version 0.9-7
* Small corrections in man pages.
Modified: pkg/SciViews/R/colors.R
===================================================================
--- pkg/SciViews/R/colors.R 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/SciViews/R/colors.R 2012-11-17 16:25:49 UTC (rev 486)
@@ -11,6 +11,18 @@
return(colorRampPalette(cols)(n))
}
+## Red-white-green palette (take care for color-blind people here)!
+rwg.colors <- function (n, alpha = 1, s = 0.9, v = 0.9)
+{
+ if ((n <- as.integer(n[1L])) <= 0) return(character(0L))
+ ## Define the initial (red) and final (blue) colors with white in between
+ cols <- c(hsv(0, s, v, alpha = alpha), # Red
+ hsv(0, 0, v, alpha = alpha), # White
+ hsv(2/6, s, v, alpha = alpha)) # Green
+ ## Use a color ramp from red to white to green
+ return(colorRampPalette(cols)(n))
+}
+
## Red-yellow-green palette (take care for color-blind people here)!
ryg.colors <- function (n, alpha = 1, s = 0.9, v = 0.9)
{
@@ -27,6 +39,6 @@
cols <- c(hsv(1/2, s, v, alpha = alpha), # Cyan
hsv(0, 0, v, alpha = alpha), # White
hsv(5/6, s, v, alpha = alpha)) # Magenta
- ## Use a color ramp from red to white to blue
+ ## Use a color ramp from cyan to white to magenta
return(colorRampPalette(cols)(n))
}
Modified: pkg/SciViews/man/colors.Rd
===================================================================
--- pkg/SciViews/man/colors.Rd 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/SciViews/man/colors.Rd 2012-11-17 16:25:49 UTC (rev 486)
@@ -1,6 +1,7 @@
\name{colors}
\alias{cwm.colors}
\alias{rwb.colors}
+\alias{rwg.colors}
\alias{ryg.colors}
\title{Various color palettes}
@@ -12,6 +13,7 @@
\usage{
cwm.colors(n, alpha = 1, s = 0.9, v = 0.9)
rwb.colors(n, alpha = 1, s = 0.9, v = 0.9)
+rwg.colors(n, alpha = 1, s = 0.9, v = 0.9)
ryg.colors(n, alpha = 1, s = 0.9, v = 0.9)
}
@@ -47,8 +49,8 @@
opar <- par(mfrow = c(2, 2))
pie(rep(1, 11), col = cwm.colors(11), main = "Cyan - white - magenta")
pie(rep(1, 11), col = rwb.colors(11), main = "Red - white - blue")
-pie(rep(1, 11), col = ryg.colors(11), main = "Red - yellow - green (1)")
-pie(rep(1, 11), col = ryg.colors(11, s = 0.5, v = 1), main = "Red - yellow - green (2)")
+pie(rep(1, 11), col = rwg.colors(11), main = "Red - white - green")
+pie(rep(1, 11), col = ryg.colors(11), main = "Red - yellow - green")
par(opar)
}
Modified: pkg/svSweave/DESCRIPTION
===================================================================
--- pkg/svSweave/DESCRIPTION 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/DESCRIPTION 2012-11-17 16:25:49 UTC (rev 486)
@@ -1,13 +1,13 @@
Package: svSweave
Type: Package
-Version: 0.9-4
-Date: 2012-04-12
+Version: 0.9-5
+Date: 2012-08-15
Title: SciViews GUI API - Sweave functions
Authors at R: c(person("Philippe", "Grosjean", role = c("aut", "cre"),
email = "phgrosjean at sciviews.org"))
Author: Philippe Grosjean
Maintainer: Philippe Grosjean <phgrosjean at sciviews.org>
-Depends: R (>= 2.6.0), ascii
+Depends: R (>= 2.6.0), ascii, knitr
Imports: utils
SystemRequirements: Python (>= 2.4) to run Asciidoc (http://www.python.org/)
Description: Supporting functions for the GUI API (Sweave functions)
Modified: pkg/svSweave/NAMESPACE
===================================================================
--- pkg/svSweave/NAMESPACE 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/NAMESPACE 2012-11-17 16:25:49 UTC (rev 486)
@@ -1,6 +1,8 @@
-import(utils, ascii)
+import(utils, knitr, ascii)
export(cleanLyxRnw,
+ knitLyxRnw,
+ purlLyxRnw,
tangleLyxRnw,
weaveLyxRnw,
RasciidocToRnw,
Modified: pkg/svSweave/NEWS
===================================================================
--- pkg/svSweave/NEWS 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/NEWS 2012-11-17 16:25:49 UTC (rev 486)
@@ -1,5 +1,12 @@
= svSweave News
+== Changes in svSweave 0.9-5
+
+* Now knitr can also be used to weave your documents (knitLyxRnw/purlLyxRnw).
+
+* Asciidoc updated to version 8.6-8.
+
+
== Changes in svSweave 0.9-4
* Added a dependence to the ascii package to support Asciidoc Sweave documents.
Modified: pkg/svSweave/R/tangleLyxRnw.R
===================================================================
--- pkg/svSweave/R/tangleLyxRnw.R 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/R/tangleLyxRnw.R 2012-11-17 16:25:49 UTC (rev 486)
@@ -39,3 +39,44 @@
Stangle(file, driver = driver, syntax = syntax, annotate = annotate, ...)
}
}
+
+purlLyxRnw <- function (file, encoding = "UTF-8", width = 80,
+useFancyQuotes = TRUE, ...)
+{
+ ## Run in LyX as the Sweave -> R converter:
+ ##> R -e svSweave::tangleLyxRnw(\"$$i\"[,annotate=FALSE]) -q --vanilla
+
+ ## Switch encoding (we do work with UTF-8 by default)
+ options(encoding = encoding)
+ Sys.setlocale("LC_CTYPE", "UTF-8")
+
+ ## By default, use fancy quotes
+ options(useFancyQuotes = useFancyQuotes)
+
+ ## Set default width for text to a reasonable value
+ options(width = width)
+
+ ## Process 'file'
+ if (!file.exists(file)) {
+ stop("You must provide the name of an existing .Rnw file to process!")
+ } else {
+ ## Redirect output
+ unlink("/tmp/.lyxSweave.log")
+ on.exit({
+ ## Echo results
+ sink(type = "message")
+ sink()
+ try(cat(readLines("/tmp/.lyxSweave.log"), sep = "\n"), silent = TRUE)
+ })
+ con <- file("/tmp/.lyxSweave.log", open = "wt")
+ sink(con)
+ sink(con, type = "message")
+ cat("Tangling ", basename(file), " using knitr...\n", sep = "")
+
+ ## Clean the R noweb file
+ cleanLyxRnw(file, encoding = encoding)
+
+ ## Weave the file
+ purl(file, ...)
+ }
+}
Modified: pkg/svSweave/R/weaveLyxRnw.R
===================================================================
--- pkg/svSweave/R/weaveLyxRnw.R 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/R/weaveLyxRnw.R 2012-11-17 16:25:49 UTC (rev 486)
@@ -41,3 +41,44 @@
Sweave(file, driver = driver, syntax = syntax, ...)
}
}
+
+knitLyxRnw <- function (file, encoding = "UTF-8", width = 80,
+useFancyQuotes = TRUE, ...)
+{
+ ## Run in LyX as the Sweave -> LaTex (from Sweave|pdflatex|plain) converter:
+ ##> R -e svSweave::knitLyxRnw(\"$$i\") -q --vanilla
+
+ ## Switch encoding (we do work with UTF-8 by default)
+ options(encoding = encoding)
+ Sys.setlocale("LC_CTYPE", "UTF-8")
+
+ ## By default, use fancy quotes
+ options(useFancyQuotes = useFancyQuotes)
+
+ ## Set default width for text to a reasonable value
+ options(width = width)
+
+ ## Process 'file'
+ if (!file.exists(file)) {
+ stop("You must provide the name of an existing .Rnw file to process!")
+ } else {
+ ## Redirect output
+ unlink("/tmp/.lyxSweave.log")
+ on.exit({
+ ## Echo results
+ sink(type = "message")
+ sink()
+ try(cat(readLines("/tmp/.lyxSweave.log"), sep = "\n"), silent = TRUE)
+ })
+ con <- file("/tmp/.lyxSweave.log", open = "wt")
+ sink(con)
+ sink(con, type = "message")
+ cat("Weaving ", basename(file), " with knitr...\n", sep = "")
+
+ ## Clean the R noweb file
+ cleanLyxRnw(file, encoding = encoding)
+
+ ## Weave the file using knitr
+ knit(file, ...)
+ }
+}
Modified: pkg/svSweave/inst/asciidoc/CHANGELOG.txt
===================================================================
--- pkg/svSweave/inst/asciidoc/CHANGELOG.txt 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/CHANGELOG.txt 2012-11-17 16:25:49 UTC (rev 486)
@@ -4,6 +4,78 @@
:website: http://www.methods.co.nz/asciidoc/
+Version 8.6.8 (2012-07-17)
+--------------------------
+.Release highlights
+Added full complement of styles to 'Open Blocks' and 'Normal
+Paragraphs' -- those with a minimalist bent could construct virtually
+any document using just Title, Normal Paragraph and Open Block
+syntaxes.
+
+.Other additions and changes
+- Increased default maximum include depth from 5 to 10.
+- Emit warning if maximum include depth is exceeded.
+- Suppress repeated console messages.
+- Music filter: removed '--beams=None' option from abc2ly invocation
+ because it is broken on LilyPond 2.14 (Ubuntu 12.04).
+- Replaced obsolete '<tt>' tag with '<code>' in HTML backends.
+- Allow configuration attribute entries to create a new section
+ (previously you could only modify existing sections). See:
+ https://groups.google.com/group/asciidoc/browse_thread/thread/7be28e9714f249c7[discussion
+ list].
+- Documented `{wj}` (word-joiner) attribute and updated FAQ. See:
+ https://groups.google.com/group/asciidoc/browse_thread/thread/961a957ab5872ebf[discussion
+ list].
+- FAQ: Added 'How can I place a footnote immediately following quoted
+ text?' See
+ https://groups.google.com/group/asciidoc/browse_thread/thread/961a957ab5872ebf[discussion
+ list].
+- Added Greek language configuration file. Contributed by Michael
+ Dourmousoglou. See
+ https://groups.google.com/group/asciidoc/browse_thread/thread/9e79d8494ef8d870[discussion
+ list].
+- FAQ: Added 'Using roles to select fonts for PDF'. Submitted by Lex
+ Trotman and based on solution by Antonio Borneo. See:
+ https://groups.google.com/group/asciidoc/browse_frm/thread/64b071bb21de9cf0[discussion
+ list].
+- Apply same monospaced font size to all monospaced text.
+- Changed '0' number padding to spaces in numbered GNU
+ source-highlight outputs.
+- Allow 'highlight' source highlighter to use 'python' for Python
+ `{language}` name. r1142: Update the AsciiDoc 'source' filter to
+ allow the use of the 'highlight' source code highlighter. See
+ https://groups.google.com/group/asciidoc/browse_frm/thread/e045c9986c71d72a[discussion
+ list].
++
+NOTE: The 'pygments' attribute has been deprecated in favor of the new
+'source-highlighter' attribute.
+
+- Vim syntax highlighter: Don't confuse trailing open block delimiter
+ with section underline.
+- Added 'skip' option to paragraphs (c.f. Delimited Block 'skip'
+ option).
+
+.Bug fixes
+- *FIXED*: latex, music and graphviz filters: When the filter output
+ image is data-uri encoded write it to the indir (instead of the
+ outdir) so that encoder can find it. See
+ https://groups.google.com/group/asciidoc/browse_thread/thread/f5174f450a61f14b[discussion
+ list].
+- *FIXED*: Escape the ']' character inside inline macros. See
+ https://groups.google.com/group/asciidoc/browse_thread/thread/db3b734a6931cb74[discussion
+ list].
+- *FIXED*: source highlighter filter: Pass 'role' attribute to HTML
+ backends.
+- *FIXED*: source highlight filter: docbook backend: 'role' attribute
+ was not passed to listings without a title. Patch submitted by Lex
+ Trotman. See
+ https://groups.google.com/group/asciidoc/browse_thread/thread/13c9ee97930342b3[discussion
+ list].
+- *FIXED*: music2png.py: 'FOPException: Raster ByteInterleavedRaster'
+ error (FOP 1.0, ImageMagick 6.6.9-7).
+
+
+
Version 8.6.7 (2012-03-17)
--------------------------
.Release highlights
Modified: pkg/svSweave/inst/asciidoc/asciidoc.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/asciidoc.conf 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/asciidoc.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -21,8 +21,8 @@
encoding=UTF-8
# Uncomment to use xhtml11 quirks mode CSS.
#quirks=
-# Uncomment to use the Pygments source highlighter instead of GNU highlighter.
-#pygments=
+# HTML source code highlighter (source-highlight, pygments or highlight).
+source-highlighter=source-highlight
# Uncomment to use deprecated quote attributes.
#deprecated-quotes=
empty=
@@ -171,10 +171,15 @@
[paragraph-styles]
normal-style=template="paragraph"
+comment-style=template="paragraph",options=('skip',)
verse-style=template="verseparagraph",posattrs=("style","attribution","citetitle")
quote-style=template="quoteparagraph",posattrs=("style","attribution","citetitle")
literal-style=template="literalparagraph",subs=("verbatim",)
listing-style=template="listingparagraph",subs=("verbatim",)
+example-style=template="exampleparagraph"
+sidebar-style=template="sidebarparagraph"
+abstract-style=template="abstractparagraph"
+partintro-style=template="partintroparagraph"
NOTE-style=template="admonitionparagraph",name="note",caption="{note-caption}"
TIP-style=template="admonitionparagraph",name="tip",caption="{tip-caption}"
IMPORTANT-style=template="admonitionparagraph",name="important",caption="{important-caption}"
@@ -193,6 +198,19 @@
[listingparagraph]
template::[listingblock]
+[exampleparagraph]
+template::[exampleblock]
+
+[sidebarparagraph]
+template::[sidebarblock]
+
+[abstractparagraph]
+template::[abstractblock]
+
+[partintroparagraph]
+template::[partintroblock]
+
+
[macros]
#--------------
# Inline macros
@@ -201,7 +219,7 @@
# (?s) re flag for line spanning.
# Macros using default syntax.
-(?su)(?<!\w)[\\]?(?P<name>http|https|ftp|file|irc|mailto|callto|image|link|anchor|xref|indexterm):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+(?su)(?<!\w)[\\]?(?P<name>http|https|ftp|file|irc|mailto|callto|image|link|anchor|xref|indexterm):(?P<target>\S*?)\[(?P<attrlist>.*?)(?<!\\)\]=
# These URL types don't require any special attribute list formatting.
(?su)(?<!\S)[\\]?(?P<name>http|https|ftp|file|irc):(?P<target>//[^\s<>]*[\w/])=
@@ -217,7 +235,7 @@
# Allow footnote macros hard up against the preceding word so the footnote mark
# can be placed against the noted text without an intervening space
# (http://groups.google.com/group/asciidoc/browse_frm/thread/e1dcb7ee0efc17b5).
-(?su)[\\]?(?P<name>footnote|footnoteref):(?P<target>\S*?)\[(?P<attrlist>.*?)\]=
+(?su)[\\]?(?P<name>footnote|footnoteref):(?P<target>\S*?)\[(?P<attrlist>.*?)(?<!\\)\]=
# Anchor: [[[id]]]. Bibliographic anchor.
(?su)[\\]?\[\[\[(?P<attrlist>[\w_:][\w_:.-]*?)\]\]\]=anchor3
@@ -301,11 +319,23 @@
[blockdef-open]
# A block without opening or closing tags.
delimiter=^--$
-template=openblock
-options=sectionbody
posattrs=style
-abstract-style=template="abstractblock"
-partintro-style=template="partintroblock"
+style=default
+default-style=template="openblock",options=("sectionbody",)
+comment-style=template="openblock",options=("skip",)
+abstract-style=template="abstractblock",options=("sectionbody",)
+partintro-style=template="partintroblock",options=("sectionbody",)
+example-style=template="exampleblock",options=("sectionbody",)
+sidebar-style=template="sidebarblock",options=("sectionbody",)
+verse-style=template="verseblock",posattrs=("style","attribution","citetitle")
+quote-style=template="quoteblock",posattrs=("style","attribution","citetitle"),options=("sectionbody",)
+literal-style=template="literalparagraph",subs=("verbatim",)
+listing-style=template="listingparagraph",subs=("verbatim",)
+NOTE-style=template="admonitionblock",name="note",caption="{note-caption}",options=("sectionbody",)
+TIP-style=template="admonitionblock",name="tip",caption="{tip-caption}",options=("sectionbody",)
+IMPORTANT-style=template="admonitionblock",name="important",caption="{important-caption}",options=("sectionbody",)
+WARNING-style=template="admonitionblock",name="warning",caption="{warning-caption}",options=("sectionbody",)
+CAUTION-style=template="admonitionblock",name="caution",caption="{caution-caption}",options=("sectionbody",)
[blockdef-pass]
delimiter=^\+{4,}$
Modified: pkg/svSweave/inst/asciidoc/asciidoc.py
===================================================================
--- pkg/svSweave/inst/asciidoc/asciidoc.py 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/asciidoc.py 2012-11-17 16:25:49 UTC (rev 486)
@@ -9,7 +9,7 @@
import sys, os, re, time, traceback, tempfile, subprocess, codecs, locale, unicodedata, copy
### Used by asciidocapi.py ###
-VERSION = '8.6.7' # See CHANGLOG file for version history.
+VERSION = '8.6.8' # See CHANGLOG file for version history.
MIN_PYTHON_VERSION = '2.4' # Require this version of Python or better.
@@ -174,14 +174,18 @@
# argument. Has no effect when set to None.
self.linenos = None
self.messages = []
+ self.prev_msg = ''
def stdout(self,msg):
print msg
def stderr(self,msg=''):
+ if msg == self.prev_msg: # Suppress repeated messages.
+ return
self.messages.append(msg)
if __name__ == '__main__':
sys.stderr.write('%s: %s%s' % (self.PROG, msg, os.linesep))
+ self.prev_msg = msg
def verbose(self, msg,linenos=True):
if config.verbose:
@@ -1871,10 +1875,7 @@
config.load_miscellaneous(config.conf_attrs)
else:
# Markup template section attribute.
- if attr.name in config.sections:
- config.sections[attr.name] = [attr.value]
- else:
- message.warning('missing configuration section: %s' % attr.name)
+ config.sections[attr.name] = [attr.value]
else:
# Normal attribute.
if attr.name[-1] == '!':
@@ -2711,6 +2712,8 @@
self.merge_attributes(attrs)
reader.read() # Discard (already parsed item first line).
body = reader.read_until(paragraphs.terminators)
+ if 'skip' in self.parameters.options:
+ return
body = [self.text] + list(body)
presubs = self.parameters.presubs
postsubs = self.parameters.postsubs
@@ -4088,7 +4091,7 @@
self.parent = None # Included reader's parent reader.
self._lineno = 0 # The last line read from file object f.
self.current_depth = 0 # Current include depth.
- self.max_depth = 5 # Initial maxiumum allowed include depth.
+ self.max_depth = 10 # Initial maxiumum allowed include depth.
self.bom = None # Byte order mark (BOM).
self.infile = None # Saved document 'infile' attribute.
self.indir = None # Saved document 'indir' attribute.
@@ -4154,6 +4157,7 @@
warnings = attrs.get('warnings', True)
# Don't process include macro once the maximum depth is reached.
if self.current_depth >= self.max_depth:
+ message.warning('maximum include depth exceeded')
return result
# Perform attribute substitution on include macro file name.
fname = subs_attrs(mo.group('target'))
@@ -4194,7 +4198,7 @@
try:
val = int(attrs['tabsize'])
if not val >= 0:
- raise ValueError, "not >= 0"
+ raise ValueError, 'not >= 0'
self.tabsize = val
except ValueError:
raise EAsciiDoc, 'illegal include macro tabsize argument'
@@ -4204,11 +4208,10 @@
try:
val = int(attrs['depth'])
if not val >= 1:
- raise ValueError, "not >= 1"
+ raise ValueError, 'not >= 1'
self.max_depth = self.current_depth + val
except ValueError:
- raise EAsciiDoc, 'illegal include macro depth argument'
-
+ raise EAsciiDoc, "include macro: illegal 'depth' argument"
# Process included file.
message.verbose('include: ' + fname, linenos=False)
self.open(fname)
Modified: pkg/svSweave/inst/asciidoc/filters/graphviz/graphviz-filter.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/graphviz/graphviz-filter.conf 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/filters/graphviz/graphviz-filter.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -5,8 +5,18 @@
# Gouici Iisaka <iisaka51 at gmail dot com>
[graphviz-filter-style]
+# When the filter output image is data-uri encoded write it to the indir
+# (instead of the outdir) so that encoder can find it.
+ifndef::data-uri[]
graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -L {layout=dot} -F {format=png} -'
+endif::data-uri[]
+ifdef::data-uri[]
+graphviz-style=template="graphviz{format?-{format}}-block",subs=(),posattrs=("style","target","layout","format"),filter='graphviz2png.py {verbose?-v} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -L {layout=dot} -F {format=png} -'
+endif::data-uri[]
+[blockdef-open]
+template::[graphviz-filter-style]
+
[blockdef-listing]
template::[graphviz-filter-style]
Modified: pkg/svSweave/inst/asciidoc/filters/latex/latex-filter.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/latex/latex-filter.conf 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/filters/latex/latex-filter.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -6,8 +6,18 @@
#
[latex-filter-style]
+# When the filter output image is data-uri encoded write it to the indir
+# (instead of the outdir) so that encoder can find it.
+ifndef::data-uri[]
latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2png.py -m{verbose? -v}{dpi? -D {dpi}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -'
+endif::data-uri[]
+ifdef::data-uri[]
+latex-style=template="latex-block",subs=(),posattrs=("style","target","dpi"),filter='latex2png.py -m{verbose? -v}{dpi? -D {dpi}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -'
+endif::data-uri[]
+[blockdef-open]
+template::[latex-filter-style]
+
[blockdef-listing]
template::[latex-filter-style]
Modified: pkg/svSweave/inst/asciidoc/filters/music/music-filter.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/music/music-filter.conf 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/filters/music/music-filter.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -6,8 +6,19 @@
#
[music-filter-style]
+
+# When the filter output image is data-uri encoded write it to the indir
+# (instead of the outdir) so that encoder can find it.
+ifndef::data-uri[]
music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{outdir={indir}}/{imagesdir=}{imagesdir?/}{target}" -'
+endif::data-uri[]
+ifdef::data-uri[]
+music-style=template="music-block",subs=(),posattrs=("style","target","format"),filter='music2png.py -m{verbose? -v}{format? -f {format}} -o "{indir={outdir}}/{imagesdir=}{imagesdir?/}{target}" -'
+endif::data-uri[]
+[blockdef-open]
+template::[music-filter-style]
+
[blockdef-listing]
template::[music-filter-style]
Modified: pkg/svSweave/inst/asciidoc/filters/music/music2png.py
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/music/music2png.py 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/filters/music/music2png.py 2012-11-17 16:25:49 UTC (rev 486)
@@ -56,7 +56,7 @@
import os, sys, tempfile, md5
-VERSION = '0.1.1'
+VERSION = '0.1.2'
# Globals.
verbose = False
@@ -135,15 +135,15 @@
os.chdir(outdir)
try:
if format == 'abc':
- run('abc2ly --beams=None -o "%s" "%s"' % (ly,abc))
+ run('abc2ly -o "%s" "%s"' % (ly,abc))
run('lilypond --png -o "%s" "%s"' % (basefile,ly))
os.rename(png, outfile)
finally:
os.chdir(saved_pwd)
- # Chop the bottom 75 pixels off to get rid of the page footer.
- run('convert "%s" -gravity South -crop 1000x10000+0+75 "%s"' % (outfile, outfile))
- # Trim all blank areas from sides, top and bottom.
- run('convert "%s" -trim "%s"' % (outfile, outfile))
+ # Chop the bottom 75 pixels off to get rid of the page footer then crop the
+ # music image. The -strip option necessary because FOP does not like the
+ # custom PNG color profile used by Lilypond.
+ run('convert "%s" -strip -gravity South -chop 0x75 -trim "%s"' % (outfile, outfile))
for f in temps:
if os.path.isfile(f):
print_verbose('deleting: %s' % f)
Modified: pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf 2012-07-10 22:49:42 UTC (rev 485)
+++ pkg/svSweave/inst/asciidoc/filters/source/source-highlight-filter.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -24,18 +24,22 @@
[source-highlight-block]
<a name="{id}"></a>
<p><b>{title}</b></p>
-<table border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
+<table{role? class="{role}"} border="0" bgcolor="#e8e8e8" width="100%" cellpadding="10"><tr><td>
+{source-highlighter$highlight:}<pre><code>
|
+{source-highlighter$highlight:}</code></pre>
</td></tr></table>
endif::basebackend-html[]
ifdef::basebackend-xhtml11,basebackend-html5[]
[source-highlight-block]
-<div class="listingblock">
+<div class="listingblock{role? {role}}">
<a id="{id}"></a>
<div class="title">{caption=}{title}</div>
<div class="content">
+{source-highlighter$highlight:}<pre><code>
|
+{source-highlighter$highlight:}</code></pre>
</div></div>
endif::basebackend-xhtml11,basebackend-html5[]
@@ -43,7 +47,8 @@
ifdef::basebackend-docbook[]
[source-highlight-block]
<formalpara{id? id="{id}"}{role? role="{role}"}{reftext? xreflabel="{reftext}"}><title>{title}</title><para>
-<programlisting language="{language}" linenumbering="{src_numbered=unnumbered}"{args? {args}}>
+{title#}<programlisting language="{language}" linenumbering="{src_numbered=unnumbered}"{args? {args}}>
+{title%}<programlisting language="{language}"{role? role="{role}"} linenumbering="{src_numbered=unnumbered}"{args? {args}}>
|
</programlisting>
{title#}</para></formalpara>
@@ -52,14 +57,30 @@
# Source styles template.
ifdef::basebackend-html[]
[source-filter-style]
-ifndef::pygments[source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}"]
-ifdef::pygments[source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {src_numbered?-O linenos=table} {encoding?-O encoding={encoding}} {args=}"]
+ifeval::["{source-highlighter}"=="source-highlight"]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f xhtml -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
+endif::[]
+ifeval::["{source-highlighter}"=="highlight"]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=xhtml --syntax={language at python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} --encoding={encoding} {args=}"
+endif::[]
+ifeval::["{source-highlighter}"=="pygments"]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {src_numbered?-O linenos=table} {encoding?-O encoding={encoding}} {args=}"
+endif::[]
+# DEPRECATED: 'pygments' attribute.
+ifdef::pygments[]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered"),filter="pygmentize -f html -l {language} {src_numbered?-O linenos=table} {encoding?-O encoding={encoding}} {args=}"
+endif::[]
endif::basebackend-html[]
ifdef::basebackend-html4[]
[source-filter-style]
# html4 does not use pygments.
-source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html -s {language} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}"
+ifeval::["{source-highlighter}"=="source-highlight"]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="source-highlight -f html -s {language} {src_numbered?--line-number=' '} {src_tab?--tab={src_tab}} {args=}"
+endif::[]
+ifeval::["{source-highlighter}"=="highlight"]
+source-style=template="source-highlight-block",presubs=(),postsubs=("callouts",),posattrs=("style","language","src_numbered","src_tab"),filter="highlight --no-doc --inline-css --out-format=html --syntax={language at python:py:{language}} {src_numbered?--line-number} {src_tab?--tab={src_tab}} {args=}"
+endif::[]
endif::basebackend-html4[]
ifdef::basebackend-docbook[]
@@ -79,6 +100,9 @@
#########################
# Source block styles
#########################
+[blockdef-open]
+template::[source-filter-style]
+
[blockdef-listing]
template::[source-filter-style]
Added: pkg/svSweave/inst/asciidoc/html4.conf
===================================================================
--- pkg/svSweave/inst/asciidoc/html4.conf (rev 0)
+++ pkg/svSweave/inst/asciidoc/html4.conf 2012-11-17 16:25:49 UTC (rev 486)
@@ -0,0 +1,506 @@
+#
+# html4.conf
+#
+# Asciidoc HTML 4.01 configuration file.
+#
+
+[miscellaneous]
+outfilesuffix=.html
+
+[attributes]
+basebackend=html
+basebackend-html=
+basebackend-html4=
+
+[replacements2]
+# Line break.
+(?m)^(.*)\s\+$=\1<br>
+
+[replacements]
+ifdef::asciidoc7compatible[]
+# Superscripts.
+\^(.+?)\^=<sup>\1</sup>
+# Subscripts.
+~(.+?)~=<sub>\1</sub>
+endif::asciidoc7compatible[]
+
+[ruler-blockmacro]
+<hr>
+
+[pagebreak-blockmacro]
+<div style="page-break-after:always"></div>
+
+[pi-blockmacro]
+<?{target}{0? {0}}?>
+
+[pi-inlinemacro]
+template::[pi-blockmacro]
+
+[image-inlinemacro]
+<a href="{link}"{role? class="{role}"}>
+# src attribute must be first attribute for blogpost compatibility.
+<img src="{imagesdir=}{imagesdir?/}{target}" style="border-width: 0;" alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}{title? title="{title}"}>
+{link#}</a>
+
+[image-blockmacro]
+<div{align? align="{align}"}{role? class="{role}"}{float? style="float:{float};"}>
+<a name="{id}"></a>
+<a href="{link}">
+<img src="{imagesdir=}{imagesdir?/}{target}" style="border-width: 0;" alt="{alt={target}}"{width? width="{width}"}{height? height="{height}"}>
+{link#}</a>
+<p><b>{caption={figure-caption} {counter:figure-number}. }</b>{title}</p>
+</div>
+
+[unfloat-blockmacro]
+<br clear="all">
+
+[indexterm-inlinemacro]
+# Index term.
+{empty}
+
+[indexterm2-inlinemacro]
+# Index term.
+# Single entry index term that is visible in the primary text flow.
+{1}
+
+[footnote-inlinemacro]
+# footnote:[<text>].
+<br><i>[{0}]</i><br>
+
+[footnoteref-inlinemacro]
+# footnoteref:[<id>], create reference to footnote.
+{2%}<br><i><a href="#_footnote_{1}">[{1}]</a></i><br>
+# footnoteref:[<id>,<text>], create footnote with ID.
+{2#}<br><i><a name="_footnote_{1}">[{2}]</a></i><br>
+
+[callout-inlinemacro]
+# Callout.
+<b><{index}></b>
+
+# Comment line macros.
+[comment-inlinemacro]
+{showcomments#}<br><span style="background:yellow;">{passtext}</span><br>
+
+[comment-blockmacro]
+{showcomments#}<p><span style="background:yellow;">{passtext}</span></p>
+
+[literal-inlinemacro]
+# Inline literal.
+<code>{passtext}</code>
+
+# List tags.
+[listtags-bulleted]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ul{role? class="{role}"}>|</ul>
+item=<li>|</li>
+text=<p>|</p>
+
+[listtags-numbered]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol type="{style at arabic:1}{style at loweralpha:a}{style at upperalpha:A}{style at lowerroman:i}{style at upperroman:I}"{start? start="{start}"}{role? class="{role}"}>|</ol>
+item=<li>|</li>
+text=<p>|</p>
+
+[listtags-labeled]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<dl{role? class="{role}"}>|</dl>
+entry=
+label=
+term=<dt>{strong-option?<strong>}|{strong-option?</strong>}</dt>
+item=<dd>|</dd>
+text=<p>|</p>
+
+[listtags-horizontal]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<table cellpadding="4"{role? class="{role}"}>|</table>
+entry=<tr valign="top">|</tr>
+label=<td{labelwidth? width="{labelwidth}%"}>{strong-option?<strong>}|{strong-option?</strong>}</td>
+term=|<br>
+item=<td{itemwidth? width="{itemwidth}%"}>|</td>
+text=<p>|</p>
+
+[listtags-callout]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol{role? class="{role}"}>|</ol>
+item=<li>|</li>
+text=<p>|</p>
+
+[listtags-qanda]
+list={id?<a name="{id}"></a>}{title?<p><b>{title}</b></p>}<ol{role? class="{role}"}>|</ol>
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/sciviews -r 486
More information about the Sciviews-commits
mailing list