Giter Club home page Giter Club logo

Comments (19)

plaindocs avatar plaindocs commented on May 28, 2024 1

Callouts work with pygments, but not with coderay.
DEFINITELY needs to be in the docs. :-p

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

It should because we're taking a different approach. We're using characters in the M+ 1mn font set to draw the callout bullets. If that font isn't loaded properly, then that might be why it's not working. I'll add some callouts to the README so we can verify it works in the getting started section...a baseline.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

You can see here the starting character. It then counts up from there:

https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor/pdf_renderer.rb#L701

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

Actually, I figured out that the issue is that the callout code inside the listing block is just a quick hack that was only checking for the following permutation:

line of text // <1>

I've updated it to be a bit more flexible by checking for a leading # or no leading line comment character, but it's still not complete yet.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

Here's the code that needs fixing:

https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor/pdf_renderer.rb#L914

It's also reliant on the syntax highlighting being used atm.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

Part of the reason the code is a bit crufty is because I need Asciidoctor to provide an API for processing callouts in listing blocks so that Asciidoctor PDF can tap into it. That code is currently buried in Asciidoctor core.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

I noticed that I wasn't using M+ 1mn by default in Asciidoctor PDF, which is the font that is providing the callout numbers. I've switched to it for now, though I'm also going to make the callout unicode start number configurable in the theme.

from asciidoctor-pdf.

plaindocs avatar plaindocs commented on May 28, 2024

This still does not work in asciidoctor-pdf.
I get the icon after the code block, but there is no substitution inside the code block.

from asciidoctor-pdf.

yfain avatar yfain commented on May 28, 2024

Callouts are generated fine for HTML, but when I use asciidoctor-pdf, I'm getting "asciidoctor: WARNING: conversion missing in backend pdf for inline_callout" and no callouts are included in the PDF file". Is there a workaround for this problem? I'm using Asciidoctor 1.5.2.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

These are not yet implemented. It's on the roadmap for Asciidoctor PDF 1.5.0. The inline stuff like callouts and icons are one of the first things I'll get working once I pick it back up again...maybe at a hackergarten :)

from asciidoctor-pdf.

plaindocs avatar plaindocs commented on May 28, 2024

Is there a list of what is not implemented in asciidoctor-pdf?

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

It's mostly just the inline imagery because it requires special handling to make it work in Prawn. I've filed many of the issues against the 1.5.0 milestone. See https://github.com/asciidoctor/asciidoctor-pdf/milestones/v1.5.0

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

I get the icon after the code block, but there is no substitution inside the code block.

Callouts work with pygments, but not with coderay. The code used when the source highlighter is pygments just needs to be ported to the section on coderay.

See https://github.com/asciidoctor/asciidoctor-pdf/blob/master/lib/asciidoctor-pdf/converter.rb#L656-L672

We can probably do it cleaner too. That was just a quick hack.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

All cases of using callout numbers should now be covered. Of course, if you find a corner case, please speak up!

from asciidoctor-pdf.

r0ckarong avatar r0ckarong commented on May 28, 2024

Again me with the non AFM font =) Callouts are not supported and fall back to the "not" glyph in the coderay hightlighted blocks and to the correct number but in the wrong color (white).

screenshot from 2017-04-03 14-29-48

The marked character is a "1" as I would assume from the first callout but as you can see it's rendered in white and is thus invisible. The "conum_font_color" is only applied to the callout in the code example itself but not the description text bubble.

EDIT: Forget it, just have to set literal to a supported font manually then it will work.

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

EDIT: Forget it, just have to set literal to a supported font manually then it will work.

Yep. For now, I strongly recommend using the provided M+ 1mn font as it has the necessary characters. Once there is a guide available for how to rebuild the monospace font, then it will be worth the time to look for a replacement.

from asciidoctor-pdf.

RaySinnema avatar RaySinnema commented on May 28, 2024

For me, the callout numbers only work up to and including 20. In HTML there are all there, but in PDF they are not. For instance, in the image below numbers 21-24 are missing:
no_callout_numbers_over_20

from asciidoctor-pdf.

mojavelinux avatar mojavelinux commented on May 28, 2024

You are correct. There are only 20 circled numbers in Unicode, so that's how far we can go. We'd have to stop using special glyphs at that point and switch to regular numbers if we wanted to support it. However, more than 20 numbers in a callout list is really a usability issue.

from asciidoctor-pdf.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.