Hi Stephen,

The %!postvoodoo does not execute system commands, as you tried to do.

It's very similar to the %!postproc filter: accepts two arguments,
doing search and replace on the output. The only difference is that
you can replace multiple lines at once, since the entire output is
handled as a single string.

Usage:

%!postvoodoo:   search_regex   replace_text

More info, from the txt2tags source code:

        Your entire output document will be put in a single string, to your
        search/replace pleasure. Line breaks are single \n's in all platforms.
        You can change multiple lines at once, or even delete them. This is the
        last txt2tags processing in your file. All %!postproc's were already
        applied. It's the same as:

            $ txt2tags myfile.t2t | postvoodoo

        Your regex will be compiled with no modifiers. The default behavior is:

            ^ and $ match begin/end of entire string
            . doesn't match \n
            \w is not locale aware
            \w is not Unicode aware

        You can use (?...) in the beginning of your regex to change behavior:

            (?s)    the dot . will match \n, so .* will get everything
            (?m)    the ^ and $ match begin/end of EACH inner line
            (?u)    the \w, \d, \s and friends will be Unicode aware

        You can also use (?smu) or any combination of those.
        Learn more in http://docs.python.org/library/re.html




On Fri, Jun 22, 2012 at 2:44 AM, Stephen Gibson
<stephen.gib...@anu.edu.au> wrote:
> Hi,
>       Are there any examples of the use of postvoodoo? All my efforts
> to use this command have been futile.
>
> e.g. the following voodoo to increase the LaTeX item indent does nothing.
>
> Steve.
> txt2tags version 2.6.967
>
> Title
> author
> %%date(%c)
> %!postvoodoo: 'sed
> s/\\begin{compactitem}/\\begin{compactitem}\\setlength{\\itemindent}{50pt}/'
>
>
> =This is a test=
>  - An item
>  - another
>  - final
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> txt2tags-list mailing list
> https://lists.sourceforge.net/lists/listinfo/txt2tags-list



-- 
Aurelio | www.aurelio.net | @oreio

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
txt2tags-list mailing list
https://lists.sourceforge.net/lists/listinfo/txt2tags-list

Reply via email to