On Sat, Nov 12, 2011 at 7:30 PM, Mark <[email protected]> wrote: > Hi, > > I can't see a facility in asciidoc for including code snippets, just > entire files. > > I looked at CodeExtractor but it doesn't do what I want. > > I have a Python program (snip) that can do this but what I need to be > able to say in asciidoc is: > > run snip and filter the results through the Python syntax highlighter. > > How should I go about doing this? > > Thanks!
Hi, Follow the code example filter distributed with asciidoc but change the command it runs to yours. Cheers Lex > > PS Here's the snip program's --help: > > usage: snip filename [-i|--indent] commands > > Prints extracts from files. > > -i|--indent N indent/dedent by given number of characters > > commands are one or more of: > @regex Skip to the next line that matches the regex. > @-regex Skip to the line before the line that matches the regex. > @@ Skip the current line. > %regex Print lines up to and including the next line that matches > the regex. > %-regex Print lines up to but excluding the next line that matches > the regex. > %% Print the current line and advance to the next line. > > If the regex contains spaces then either quote the entire command or > use dot. If the regex contains characters that the shell might > interpret, quote the entire command. > If you need to skip to a leading '@', '%', or '-', use a character > class, e.g., @[@], %[%], %[-]. > > -- > You received this message because you are subscribed to the Google Groups > "asciidoc" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/asciidoc?hl=en. > > -- You received this message because you are subscribed to the Google Groups "asciidoc" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/asciidoc?hl=en.
