Giter Site home page Giter Site logo

Comments (7)

aubertc avatar aubertc commented on August 16, 2024

Ok, I guess everything is "hard-coded" in https://github.com/jgm/skylighting/blob/master/src/Skylighting/Format/HTML.hs
cf. https://github.com/jgm/skylighting/blob/master/src/Skylighting/Format/HTML.hs#L155 and https://github.com/jgm/skylighting/blob/master/src/Skylighting/Format/HTML.hs#L193

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

Hi @aubertc . The problem is that since I've last updated the Sass/CSS file for Skylighting (pandoc v2.0.2), there have been some changes in pandoc internals, which affected both the html tags and the css:

jgm/pandoc/issues/4128

So, if you are using pandoc >= v2.0.4, the Sass/CSS files of pandoc goodies won't be matching the actual html tags and css of the new styles system.

I haven't yet updated them because I wanted to wait and see if more changes where introduced. So, for a weeks the files in this project will not be updated.

But I have updated the Sass files in a personal project that I'm using with pandoc v2.0.4, so you can reference it for the new styles system:

https://github.com/tajmone/pb-archives-test/blob/source/_assets/theme/_sass/syntax-highlighting/_skylighting-default.scss

... this Sass file should be always updated to the last pandoc stable release; and in any case it always mentions the version of pandoc it was designed to work with when last edited.

In the comments I also mention the changes introduced by pandoc:

NOTE: pandoc 2.0.4 introduced some changes in the source code highlight tags:
	  -- source lines now use <a> tag instead of <div> tag:
	  	 before: <div class="sourceLine">
	  	 now:	 <a class="sourceLine">

... this change in the use of html tags (<a> tag instead of <div>) is probably what is breaking your CSS!

You'll find other useful comments in that source file.

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

If I remember correctly, line numbers underlining was introduced with pandoc v2.0.4. I haven't had a chance to look in to Haskell source to see how this works in built-in/JSON files, but (as mentioned above), I've handled it only via CSS/Sass files so far.

The actual Haskell source that handles parsing JSON styles is found here:

https://github.com/jgm/skylighting/blob/master/src/Skylighting/Types.hs#L342

I don't see any reference to line numbers decoration attributes, so my guess is that you'll need to override this with some custom CSS and that it can't be changed via JSON style files.

The above link is to skylighting source, which adhers to the KDE styles format, but I'm not sure if pandoc adds some extra options on top of that which are not part of the KDE standard.

If you think that JSON styles should allow to control the linenumbers decoration attribute, without resorting to custom CSS, it might be worth opening a pandoc issue and requesting this feature.

I personally preferr to use custom CSS to control how pandoc highlights code blocks, especially since I like to use different color themes for each language, so that in long documents each code block can be spotted easily from it's colors. Currently, styling through JSON files affect all code blocks, and can't be specified on a per-language basis — it would be nice to be able to load multiple style files, specifying which language each one should be associated to.

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

I've updated the extracted CSS stylesheet files to those used by pandoc v2.0.5:

https://github.com/tajmone/pandoc-goodies/tree/master/skylighting-css/built-in-styles

And added warnings for all the obsolete Sass/CSS files in this project (pending updates).

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

Updated documentation and boilerplate theme in Skylighting JSON Themes to reflect changes of pandoc v2.0.5:

https://github.com/tajmone/pandoc-goodies/tree/master/skylighting-themes

from pandoc-goodies.

aubertc avatar aubertc commented on August 16, 2024

Thanks a lot for this useful and documented answer!

I haven't yet updated them because I wanted to wait and see if more changes where introduced. So, for a weeks the files in this project will not be updated.

Great, I'll keep an eye on that.

from pandoc-goodies.

tajmone avatar tajmone commented on August 16, 2024

@aubertc ,

I've recently updated all pandoc JSON and CSS themes.

I'm closing this issue now. Feel free to reopen it if you have any further questions.

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.