I'm trying to extend R <http://www.r-project.org/>'s 
knitr<http://yihui.name/knitr/>package to generate AsciiDoc.  The idea is that 
I want to be able to mix R 
source code with other text. So I want write something like this:

[r, eval=TRUE, results="show"]
////
#some R code goes here
sin(pi / 3)
////

And that gets run through knitr creating an AsciiDoc document.  Depending 
upon the options set in the attribute list, it would generate a code block 
with my source code or the results or both (or neither).

----
sin(pi / 3)
##  [1] 0.8660254
----

Ideally, the document should still be legal AsciiDoc markup before it has 
been run through knitr (as well as, obviously, afterwards).  If I create a 
document with my sample [r] comment block in it, then AsciiDoc throws a 
warning

missing style: [blockdef-comment]: r

I tried creating a config file, r.conf, with the following contents

[blockdef-r]
delimiter=^////{4,}$
options=skip
posattrs=style

(The details are copied straight from [blockdef-comment] in 
asciidoc.conf.)  Unofrtunately, this gives the same warning.  

I have two questions.

How do I get AsciDoc to recognise my new block?
and
Do I need to do anything to specify the attributes that I want it to be 
allowed to use (eval, results, etc.)?

Thanks.

-- 
You received this message because you are subscribed to the Google Groups 
"asciidoc" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/asciidoc?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to