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 -- 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.
