Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi all,
we are using blocks with ids as follows: [#blockid,role="highlightedblock"] :myattribute: myvalue -- Text in block {myattribute} -- It is possible to print out the value of a defined attribute. Is it somehow possible to print the id of the current block itself? The Id shall be shown in the HTML and PDF output. For HTML, we currently using a workaround with CSS: .highlightedblock::before {content: "[" attr(id) "]"; margin-right: 1em; font-weight: bold} This is not a very nice solution since it does not work with the PDF output. Moreover, in HTML it is not part of the DOM tree. Does somebody see any solution to solve this issue? Thanks! |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Daniel, To activate attribute references inside a verbatim block, you must apply incremental subs to the block: [subs=attributes+] The ID of the block cannot be referenced using an attribute reference. However, you may define the ID using a document attribute, then assign it to the block ID (so the other way around) :block-id: foobar [id={block-id},subs=attributes+] ---- {block-id} ---- Best Regards, -Dan On Wed, Apr 22, 2020 at 5:46 AM Daniel K [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi all, ... [show rest of quote] -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Hi Dan,
thanks for the information. Would there also be a possibility to solve this issue by writing a plugin which inserts the id into the output? Regards, Daniel |
Loading... |
Reply to author |
Edit post |
Move post |
Delete this post |
Delete this post and replies |
Change post date |
Print post |
Permalink |
Raw mail |
![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Administrator
|
Absolutely. An extension can modify the document in almost any conceivable way. I would probably use a tree processor for something like this, which can visit the source blocks and manipulate the data. Best Regards, -Dan On Thu, Apr 23, 2020 at 2:11 AM Daniel K [via Asciidoctor :: Discussion] <[hidden email]> wrote: Hi Dan, -- Dan Allen | @mojavelinux | https://twitter.com/mojavelinux |
Free forum by Nabble | Edit this page |