GithubHelp home page GithubHelp logo

Comments (13)

mojavelinux avatar mojavelinux commented on August 19, 2024

Note, the haml templates are behind the slim templates and will soon be removed once we verify we've ported any missing bits.

I'm not surprised that callouts don't work since it requires dedicated logic in the template to get them right which may have not been done. Do you want to attempt to port the logic from the haml (if worth salvaging) and fixing it up so they look good when using the slim templates?

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

I'll try my best! :)
Can take some time though.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

We'll be here to help! @obilodeau might be able to pitch in as well, but the more hackers, the merrier!

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

Well, it's rather the other way around at first look.
The haml template has no logic for that, but the slim template takes special care of it.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

Check the deck.js backend. I know that it has support for such things...and a very similar output is needed.

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

Does not seem to be a problem in the templates.
With this example:

[source]
----
<xml> <!--1-->
----

the result in the HTML file is <div class="listingblock"><div class="content"><pre class="highlight"><code>&lt;xml&gt; <b>(1)</b> which is correct.
But when I open the file in the browser the content flickers and opening the DOM shows this:

<div class="listing block">
  <div class="content">
    <pre class="highlight">
      <code class="apache">
        <span class="tag">&lt;xml&gt;</span>
          <span class="tag">&lt;b&gt;</span>(1)<span class="tag">&lt;/b&gt;</span>
...

When I remove the source name from the block the error does not occur anymore, that is the <b> and </b> disappear and the number is rendered bold like it should be.

So I assume that the error is in the rather old version of highlight.js that is packaged with reveal.js.

So I downloaded a current version of highlight.js, replaced it in reveal.js/plugin/highlight and the error disappeared completely also when using the source name!

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

Closing as the issue is not related to the template.
Instead reveal.js should update its version of highlight.js if possible.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

So I downloaded a current version of highlight.js, replaced it in reveal.js/plugin/highlight and the error disappeared completely also when using the source name!

Excellent! Would you be willing to add this note to the README of this repository under the reveal.js location?

when I open the file in the browser the content flickers and opening the DOM shows this:

The use of client-side source highlighters are always a little shaky when callouts are present in the source. That's because callouts are technically invalid characters in the source that the source highlighter is attempting to process. Sometimes, we get lucky and it works, as it sounds like is the case with the newer highlight.js.

In general, I recommend using a server-side source highlighter (e.g., coderay or pygments) when possible. This gives us the opportunity to insert the callouts after source highlighting is complete...thus giving us 100% accuracy. Just something to note.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

Thanks for digging into this @robertpanzer!

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

Sure, can do!
Would it be worth trying to enable Coderay in the templates?
Because as far as I could see loading highlight.js is currently burnt in.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

Yes, it would be nice to have at least CodeRay (or one of the others like Prism or Rouge) as an option. Having said that, the CodeRay work will mostly be done in Asciidoctor core (as you can see here: https://github.com/asciidoctor/asciidoctor/blob/master/lib/asciidoctor/substitutors.rb#L1433). The template just needs to add a default highlighting theme (like the one in Asciidoctor core here: https://github.com/asciidoctor/asciidoctor/blob/master/data/stylesheets/coderay-asciidoctor.css)

from asciidoctor-backends.

robertpanzer avatar robertpanzer commented on August 19, 2024

Fixed with fcf0a57
Added note for highlight.js to README.
Added support for using coderay and pygments as source-highlighters.

from asciidoctor-backends.

mojavelinux avatar mojavelinux commented on August 19, 2024

\o/

Thanks @robertpanzer!

from asciidoctor-backends.

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.