Re: How to exploit ContentPart attributes (RubyHash) from Java
Posted by
Michaël Melchiore on
Apr 05, 2019; 8:47am
URL: https://discuss.asciidoctor.org/How-to-exploit-ContentPart-attributes-RubyHash-from-Java-tp6827p6836.html
Dear Dan,
Thanks for your inputs.
How can I reference the block attributes ?
For example,
[subsystem=NewValue]
== {subsystem} requirements
This section describes the requirements allocated to {subsystem}
Kind regards,
Michaël
Le jeu. 4 avr. 2019 à 23:25, mojavelinux [via Asciidoctor :: Discussion] <
[hidden email]> a écrit :
Michaël,
I think what you're looking for are block attributes instead of document attributes. These are specified differently.
[subsystem=NewValue]
== Sample Section
Now, when you look for the attributes on a node, you will find "subsystem" among them.
Cheers,
-Dan
On Thu, Apr 4, 2019 at 10:49 AM Michaël Melchiore [via Asciidoctor :: Discussion] <
[hidden email]> wrote:
To give a bit of context, I intended to use attributes to tag special values for easy programmatic access when parsing the document.
For example, I was thinking on writing software requirement documents with AsciiDoc and use AsciidoctorJ to implement some tooling.
Each top level section of the document would be dedicated to a software requirement. I thought section attributes would be useful to capture some metadata about each requirement (allocated subsystem, target version...).
I could use the attribute in two interesting ways:
* reference in the requirement text to avoid duplicating information
* from the Java API to efficiently access the metadata value without complex and fragile requirement text parsing logic
So my use case is that one section has a set of fixed attributes each with a single value. My previous example could have lead you to believe I want to detect attribute value changes in arbitray places of the document. This is not the case, my need is much simpler and I control the layout of the document.
Michaël
--
To unsubscribe from How to exploit ContentPart attributes (RubyHash) from Java,
click here.
NAML