Am 21.12.2012 13:19, schrieb Lex Trotman:
On 21 December 2012 22:52, j. van den hoff <[email protected]> wrote:
I posted a similar question recently but either it was to stupid or unclear:

Or everybodys gone on holidays :)

Quotes are substituted before attributes but are not substituted in
attribute values at the definition so quotes inside attribute
definitions are not substituted. See
http://www.methods.co.nz/asciidoc/userguide.html#_document_processing.

I was in the same situation: I liked to have a sort of preprocessor, so I can write new asciidoc-commands with asciidoc itself and not as backend-specific stuff.

The first thing I did was a awk-script that replaces pseudo-macros like

...
#src <arg> <arg>
...

with some asciidoc commands. That works quite well, but has the drawback, that errors/warnings from asciidoc are possibly displaced if the above macro expands into multiple lines.

As I wanted to do more than this I started a real preprocessor (implemented in Qt/C++) for asciidoc. It is in a very early state - far from being usable to others than me ;-) Aside from handling macros like

source::<file>[<tag1>,<tag2>,...]
call::[<command>,<tag1>,...]
shell::[<shell command>]

(where <tag1>, ... selects tags in the souce file or the output to be extracted)

or

doc:<classname>[<package>]
class:<classname>[<srcpath>, ...]

or

checking reachability of http:<url>[] and other content-assertions it invokes asciidoc on the fly, parses and recalculates messages (even with includes).

As you can imagine its main purpose is to simplify the life with source-code documentation ;-)

Additionaly I'm planning / writing a specialized editor with autocompletion features for source-files and their tags, display of urls, verifying callouts,... as well as syntaxhighlighting for asciidoc itself and listingblocks, etc. Actually, this piece isn't usable at all.



8<-----------------------------------------------------------------
is there a way to make an attribute definition like

:km: K~m~

be expanded correctly (i.e. with a `m' subcript) if referenced somewhere
in the text via {km}?
8<-----------------------------------------------------------------

the problem is, the above attribute is expanded verbatim in the running
text, i.e. I end up
(in the html or pdf formatted document)
with a verbatim `K~m~' replacing the reference `{km}'. what I _actually_
want is an expansion
of the definition, i.e. `K' with a subscript. that's what a corresponding
`\newcommand' in latex
would do, of course.


Try making the attribute value an inline pass macro with a specified
quotes substitution as suggested in
http://www.methods.co.nz/asciidoc/userguide.html#X18 which refers to
http://www.methods.co.nz/asciidoc/userguide.html#X77.

Cheers
Lex


thanks
joerg


--
Using Opera's revolutionary email client: http://www.opera.com/mail/

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




--
Wilhelm

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

Reply via email to