Giter Site home page Giter Site logo

Line numbering? about pandoc-goodies HOT 4 OPEN

pazz avatar pazz commented on July 17, 2024
Line numbering?

from pandoc-goodies.

Comments (4)

pazz avatar pazz commented on July 17, 2024

I should say I am on pandoc version 2.17.1.1 (debian testing).

When I leave out the template option above, the html body is the same but the line numbers do show (It is magic to me where the actual numbers come from but that's unrelated :)).

I also tried with --highlight-style=tango, same thing.

from pandoc-goodies.

pazz avatar pazz commented on July 17, 2024

I wonder if this is related? It is quite old...
jgm/pandoc#4128

The line numbers seem to be there, but shifted somehow. If I disable the CSS styling (close to the pointer in the image below), they appear.
ln

Sorry for my clumsy attempts at debugging this.
Any help would be appreciated!

from pandoc-goodies.

tajmone avatar tajmone commented on July 17, 2024

It should be easy to determine whether it's a CSS related issue or a problem with the highlighter not producing the line numbers — in the former, inspection of HTML contents should reveal the line numbers, which might be hidden due to CSS problems, whereas in the latter the line numbers should not be present in the generated HTML.

I don't remember exactly whether line-numbers are added by Skylighting (the syntax highlighter library) or pandoc itself. But chances are that when using a syntax highlighter with auto-detection of the language, if the highlighter fails to detect a language (and thus to syntax highlight at all), it might be the case that line-numbers are not generated (since the highlighter might be bypassed), so in this respect different highlighters might work differently.

It might be the case that the CSS needs tweaking, although I thought I had covered line-numbering styles — I surely did for Highlight, which is the external highlighter that I use most with pandoc, rather than the built-in Skylighting.

Anyhow, if the problem is CSS related it should be easy to fix. If you have a solution, please create a pull request, otherwise allow me some time to find a free afternoon where I can look into it.

from pandoc-goodies.

pazz avatar pazz commented on July 17, 2024

Sure, no rush. I am quite sure that it is a CSS thing, because the html body is exactly the same with your or the default template (where it works as expected).
It seems that the numbers themselves fall out of some counter when the CSS is rendered (see my img, two lines above the cursor). They do not appear in the html itself, no matter the template.

from pandoc-goodies.

Related Issues (10)

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.