How Atlas does it: http://chimera.labs.oreilly.com/books/1230000000065/ch04.html#code_snippets_section
Em segunda-feira, 11 de abril de 2011 02h21min24s UTC-3, Stuart Rackham escreveu: > > On 09/03/11 06:58, Anders Nawroth wrote: > > Hi! > > > > I wonder how I could integrate something along the lines of > codeextractor into > > asciidoc. I'd really like the inclusion of code snippets to be handled > inside > > the asciidoc execution, and not by pre-parsing the files before running > asciidoc. > > > > Right now I'm using a syntax similar to this one: > > > > ["snippet", source="Source.java", tag="tag1"] > > ---- > > ---- > > > > What annoys me is the empty block, but I couldn't get it to work without > it. Any > > ideas how this could be done in a better way? > > > > I'd prefer a syntax close to the include:: macro, but couldn't find out > if/how > > that could be done. > > AsciiDoc filters are designed to filter paragraph or block elements, > unfortunately macros don't have the ability to execute filter code. > > Cheers, Stuart > > > > > > > > /anders > > > > > > 2010-12-23 14:01, Ed Keith skrev: > >> --- On Thu, 12/23/10, wimalopaan<[email protected] <javascript:>> > wrote: > >> > >>> From: wimalopaan<[email protected] <javascript:>> > >>> Subject: Extracting code snippets from source files and include them > >>> To: "asciidoc"<[email protected] <javascript:>> > >>> Date: Thursday, December 23, 2010, 12:39 AM > >>> Hi, > >>> > >>> is there a possibiliy to extract code snippets from > >>> external source > >>> files and include them in asciidoc documents - perhaps like > >>> the boost > >>> quickbook snippets? > >>> > >>> The following source file > >>> ------- > >>> #include<iostream> > >>> //[main > >>> int main() { > >>> } > >>> //] > >>> ------- > >>> > >>> imported in quickbook and selection of the snippet [main] > >>> will only > >>> render the function main (with the special comments > >>> removed). > >>> > >>> Any hints? Thanks! > >>> > >> > >> I wrote a tool to do this. It can be found at > >> https://developer.berlios.de/projects/codeextactor/ > >> > >> Hope it helps, > >> > >> -EdK > >> > >> Ed Keith > >> [email protected] <javascript:> > >> > >> Blog: edkeith.blogspot.com > >> > >> > >> > >> > >> > >> > > > > -- 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. For more options, visit https://groups.google.com/groups/opt_out.
