Login  Register

Re: AsciidoctorJ InlineMacroProcessor bibref

Posted by mojavelinux on Feb 25, 2021; 9:44pm
URL: https://discuss.asciidoctor.org/AsciidoctorJ-InlineMacroProcessor-bibref-tp8476p8547.html

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