Comments (7)
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.
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:
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:
... 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.
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.
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.
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.
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.
@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)
- $table-of-contents$ instead of $toc$ HOT 2
- Floating Header Link in GitHub HOT 5
- Line numbering? HOT 4
- native gfm task list as lua-filter HOT 7
- how to use it for convert markdown to html? HOT 4
- GitHub.html5 and `<....` HOT 9
- Pandoc version requirement? HOT 1
- Support relative page header links HOT 8
- unexpected "-", expecting letter HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pandoc-goodies.