Questions about macros and attributes

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

Questions about macros and attributes

toyboot4e
I'm really enjoying using AsciiDoctor to write my blog and reports.
Thank you very much developing such an exciting tool!

Today, I'd like to ask some questions to understand macros and attributes.


Q1. What is the point of `macro::A[B]` syntax?

I expected that they have a common rule about the positions of `A` and `B`.
Like, `inline_macro:primary_argument[optionals]`.

But it didn't make sense in some cases. For example,

`pass:options[text]` and `image:path[attributes]`

* The former takes a primary argument (`text`) at `B`. But
* the latter takes a primary argument (`path`) at `A`.

So, is it different what `A` and `B` basically are depending on
each macro? Or is there anything that makes?


Q2. Why `image::mac.png[.text-center]` not work?

So the followings become plain texts:

----
image::mac.png[role="text-center"]

image::mac.png[.text-center]
----

While all of these become `<div class="imageblock text-center">..`:

----
[.text-center]
image::path[]

[align="center"]
image::path[]

image::path[align="center"]
----

Why `image::path[.text-center]` not work? And why are there both `.text-center`
and `align="center"`?


Thanks.