AsciidoctorJ InlineMacroProcessor bibref

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

AsciidoctorJ InlineMacroProcessor bibref

Mamamio
Hi!

I am trying to create  a :bibref link in a InlineMacroProcessor to create a <<pp>> reference. I do the following:

    public Object process(ContentNode parent, String target, Map<String, Object> attributes)
    {
        Map<String, Object> options = new HashMap<String, Object>();
        options.put("type", ":bibref");
        options.put("target", "#" + target);
        return createPhraseNode(parent, "anchor", target, attributes, options);
    }

I also tried :link and :ref without luck. :link works in HTML but not in PDF.

Thanks for any help!
Reply | Threaded
Open this post in threaded view
|

Re: AsciidoctorJ InlineMacroProcessor bibref

Mamamio
Hi again!
Does anybody know if the ":bibref" target type is still implemented? Is there any alternative available?
Thanks for any help!
Reply | Threaded
Open this post in threaded view
|

Re: AsciidoctorJ InlineMacroProcessor bibref

mojavelinux
Administrator
In reply to this post by Mamamio
I'm pretty sure this isn't going to work. Bibliography references are not handled as nodes in the tree. They are scanned based on fixed locations in the document and added to the catalog. Off the top of my head, I think you can register one in the catalog directly. However, since an inline macro is handled during the conversation phase, this will only affect references that follow it. To register it sooner, you'd need to use a tree processor.

Best Regards,

-Dan

On Sat, Jan 30, 2021 at 12:14 PM Mamamio [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi!

I am trying to create  a :bibref link in a InlineMacroProcessor to create a <<pp>> reference. I do the following:

    public Object process(ContentNode parent, String target, Map<String, Object> attributes)
    {
        Map<String, Object> options = new HashMap<String, Object>();
        options.put("type", ":bibref");
        options.put("target", "#" + target);
        return createPhraseNode(parent, "anchor", target, attributes, options);
    }

I also tried :link and :ref without luck. :link works in HTML but not in PDF.

Thanks for any help!


If you reply to this email, your message will be added to the discussion below:
https://discuss.asciidoctor.org/AsciidoctorJ-InlineMacroProcessor-bibref-tp8476.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen (he, him, his) | @mojavelinux | https://twitter.com/mojavelinux