Difference between assigning attributes under document or section headers?

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

Difference between assigning attributes under document or section headers?

richard

Difference between assigning attributes under document or section headers

When we assigned a passthrough macro to an attribute under the document header it rendered the macro output throughout the document. If it is assigned or reassigned under a section header only the macro text itself is rendered.

test.adoc (Source)

= Top level document header
:PASS: pass:normal[[green]#Pass#]
:FAIL: pass:normal[[red]#Fail#]

- Test A {PASS}
- Test B {FAIL}

== Section header
:FAIL: pass:normal[[aqua]#Fail#]
:ERROR: pass:normal[[yellow]#Error#]

- Test A {PASS}
- Test B {FAIL}
- Test C {ERROR}

test.html (Rendered)

Top level document header

  • Test A Pass

  • Test B Fail

Section header

  • Test A Pass

  • Test B pass:normal[[aqua]#Fail#]

  • Test C pass:normal[[yellow]#Error#]

For our use case it would be really handy to be able to define passthrough macros inside attributes under section headers.

Is the above behaviour baked in or is it possible to configure Asciidoctor to allow us to define passthrough macros in attributes under section headers and have them render?

Reply | Threaded
Open this post in threaded view
|

Re: Difference between assigning attributes under document or section headers?

abelsromero
I tested your code with asciidoctor-maven-plugin and it worked fine for me. I only configured the 'html5' backned.
I realize that using the maven plugin may not be a solution for you, but can be starting point to see if this is an issue with asciidoctorj.
To keep working on it, can you provide more information? For instance, can you confirm you're using asciidoctorj, which version, are you setting some other parameters, etc.


Here is my maven config:
                        <plugin>
                                <groupId>org.asciidoctor</groupId>
                                <artifactId>asciidoctor-maven-plugin</artifactId>
                                <version>1.5.2</version>
                                <executions>
                                        <execution>
                                                <id>output-html</id>
                                                <phase>generate-resources</phase>
                                                <goals>
                                                        <goal>process-asciidoc</goal>
                                                </goals>
                                                <configuration>
                                                        <backend>html5</backend>
                                                </configuration>
                                        </execution>
                                </executions>
                        </plugin>

PS: how do you create those nice code blocks in the forum? :O
Reply | Threaded
Open this post in threaded view
|

Re: Difference between assigning attributes under document or section headers?

richard
Thank you so much for looking into this.

I'm feeling a bit silly about this one.  Turns out I had missed the big news..... we now have Asciidoctor 1.5.2! :) Was still using Asciidoctor 1.5.0.  Upgraded to 1.5.2 and it works perfectly.  Feeling a bit humbled but also very excited to apply your fantastic new library to the rest of our project.

PS - I create the code blocks the slow painful way.... using the 'Message is in HTML Format' option and pasting in home made HTML... 'pre' tags with custom a CSS style...

<pre style="border: 1px solid #a0a0a0;width:50%;background-color:#F8F8F8;border-radius:5px;padding:10px;">
...code here....
</pre>
Reply | Threaded
Open this post in threaded view
|

Re: Difference between assigning attributes under document or section headers?

abelsromero
Good to hear it works for you too  
If you want to be up to date with releases, the best way I found is just following Dan on twitter https://twitter.com/mojavelinux.

BTW, thanks for the trick on creating code blocks and keep spreading the 'asciiword'