Clarification : Block, Macro

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

Clarification : Block, Macro

ch007m
Hi,

The asciidoctor documentation mentions in a lot of places the word 'macro'. Example "An attribute list can apply to blocks, inline quotes text, and macros" but the 'macro' section in the documentation is empty - http://asciidoctor.org/docs/user-manual/#macros.

Question : Is there until now a difference between a block and macro ? Do we have examples ?

Regards,

Charles
Charles Moulliard
Apache Committer / Technologist Evangelist / Blogger / MiddleWare Specialist
Twitter : @cmoulliard
Reply | Threaded
Open this post in threaded view
|

Re: Clarification : Block, Macro

programandala.net
En/Je/On 2014-01-29 07:22, ch007m [via Asciidoctor :: Discussion] escribió / skribis / wrote :

>    Question : Is there until now a difference between a block
>    and macro ? Do we have examples ?

Macros are what their name suggests -- commands that create target
content from one or more parameters. There are both inline and block
macros, depending on their result (inline content or block content).

The syntax for an inline macro:

        macro_name:main_parameter[optional_parameters]

The syntax for a block macro has an additional semicolon:

        macro_name::main_parameter[optional_parameters]

For example, "link" and "http" are inline macros, while "include" is a
block macro. You can find examples in the User Manual.

On the other hand, blocks are just -- blocks of content, and they are
described in http://asciidoctor.org/docs/user-manual/#blocks[section 7
of the User Manual].

As for the missing parts in the Asciidoctor docs, you can consult the
http://asciidoc.org/userguide.html[Asciidoc User Guide].

Hope this helped.

--
Marcos Cruz
http://programandala.net