On 1 March 2011 16:40, Michael Wild <[email protected]> wrote: > But filters only operate on blocks, I need to operate inline. Unless, of > course, I filter almost every paragraph, and then I wouldn't have to use > AsciiDoc in the first place since then the filter would be responsible > for generating much of the backend markup. > > Michael > > On 03/01/2011 01:55 AM, Lex Trotman wrote: >> Hi, >> >> Maybe you are going about it the wrong way, to pass text through >> external commands and get the results, you should use filters, that is >> what they do. >> >> Sys macros are for running commands, not passing text to them. >> >> Cheers >> Lex >> >> On 28 February 2011 20:23, Michael Wild <[email protected]> wrote: >>> >>> >>> On Feb 26, 3:04 pm, Michael Wild <[email protected]> wrote: >>>> Hi all >>>> >>>> I need to invoke a program in a inline-macro and thought I could do this >>>> via the {sys:} system attribute. However, it seems that something really >>>> strange happens, with the {passtext} string. >>>> >>>> In the attached example, I have the custom macro echo:[<text>] which >>>> invokes the python script filter.py. That script just writes its first >>>> argument to the file "somefile", reads the file back and prints the >>>> results to stderr and stdout. >>>> >>>> Now, what happens, is that everything seems to be fine in the generated >>>> output (test.html), but the temporary file "somefile" only seems to >>>> contain nonsense. No matter what the argument to the echo:[] macro is, >>>> it only contains '0' (where I used decimal character entities). >>>> Also, the output on stderr only shows a 0. Running asciidoc in verbose >>>> mode shows the invocation of filter.py only with the 0, too. >>>> >>>> How can this be? How can the output of asciidoc be fine, when the >>>> intermediate file clearly is not. In reality my filter.py is more >>>> complicated, of course, and needs to invoke other tools on the >>>> intermediate file before creating the final output, which, of course, >>>> choke on it. >>>> >>>> Thanks for any help on this... >>>> >>>> Michael >>>> >>>> test.tgz >>>> < 1KViewDownload >>> >>> >>> OK, tracked it down. Seems like the pass-through text in macros gets >>> replaced by a place-holder in Lex.subs(), and what I saw (the >>> "0") is actually that place-holder, where the 0 is a counter. >>> So it seems like I need to pass the argument as the "target", but that >>> is also not very desirable since it doesn't seem to be very >>> idiomatic... >>> >>> Michael
In that case you should provide your echo macro and its python to make it easier to see whats wrong. Cheers Lex >>> >>> -- >>> 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.
