has asciidoc preprocessor macros?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
aiq
Reply | Threaded
Open this post in threaded view
|

has asciidoc preprocessor macros?

aiq
Hey exist in asciidoc itself a way to create preprocessor macros?

The macros in asciidoc allow me generate custom commands for the different output formats. My goal is the creation of valid asciidoc.

for example:

preprocessormacro: #define pair() %1 and  %2

use: i think pair("a", "b") are the same

result: i think a and b are the same

I hope you get the idea. Attributes, specialwords and replacements don't fulfill this requirement. Or am i wrong?

Thanks for any kind of help.
Reply | Threaded
Open this post in threaded view
|

Re: has asciidoc preprocessor macros?

mojavelinux
Administrator
Asciidoctor allows you to preprocess the entire source document. This is the opportunity to look for and process any preprocessor directives.

For an example, see the following extensions from the lab:


When we talk about the preprocessor, we should refer to these as directives instead of macros. That helps avoid confusion from syntax that is processed during parsing.

Cheers,

-Dan

On Fri, May 29, 2015 at 7:39 AM, aiq [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hey exist in asciidoc itself a way to create preprocessor macros?

The macros in asciidoc allow me generate custom commands for the different output formats. My goal is the creation of valid asciidoc.

for example:

preprocessormacro: #define pair() %1 and  %2

use: i think pair("a", "b") are the same

result: i think a and b are the same

I hope you get the idea. Attributes, specialwords and replacements don't fulfill this requirement. Or am i wrong?

Thanks for any kind of help.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/has-asciidoc-preprocessor-macros-tp3282.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML



--