-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How is the underlying of line numbers controlled? #2
Comments
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 ( You'll find other useful comments in that source file. |
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. |
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). |
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 |
Thanks a lot for this useful and documented answer!
Great, I'll keep an eye on that. |
@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. |
Hi,
Thanks for your really useful guide (I'm referring to pandoc-goodies/tree/master/skylighting-themes). I have a problem I can't seem to be able to address: in every style, the line number is underlined by default. This is done through
in the
CCS
code produced by the theme I'm using. I can't seem to find a way to change this behaviour. The only two parameters referring to line numbers in thetheme
files seem to beAny idea on how to change this behavior?
The text was updated successfully, but these errors were encountered: