jgm / skylighting

A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions
194 stars 62 forks source link

Ensure line span css only applied to lines #80

Closed dbaynard closed 5 years ago

dbaynard commented 5 years ago

WIP. I haven't tested yet. Fixes #79 (eventually).

jgm commented 5 years ago

Great, let me know when this is ready to go.

dbaynard commented 5 years ago

I'm just checking pandoc with this new skylighting version, now. There's an issue with skylighting output in prince (though with chrome it works correctly) — I think the problem there is prince.

dbaynard commented 5 years ago

Any advice on building pandoc with custom skylighting?

In the past, I've just vendored my variant of the package, then bootstrapped. It would be nice if it could bootstrap direct from git as part of the build (I'd happily implement this as a custom build!).

jgm commented 5 years ago

If you just want to do it locally, then bootstrap skylighting (say in a skylighting subdirectory of pandoc). Then replace the lines in pandoc's stack.yaml that refer to skylighting and skylighting-core with

and build with stack.

David Baynard notifications@github.com writes:

Any advice on building pandoc with custom skylighting?

In the past, I've just vendored my variant of the package, then bootstrapped. It would be nice if it could bootstrap as part of the build (I'd happily implement this as a custom build!).

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/jgm/skylighting/pull/80#issuecomment-502390251

dbaynard commented 5 years ago

The custom pandoc produces the desired output, and I've confirmed the resulting html is as expected, more generally and that epub output is ok and passes the validator.

The pandoc test suite fails for lhs-test.html and lhs-test.html+lhs, because the tests expect the output to contain the old skylighting css.


Chrome (screen)

skylighting-html

Chrome (print)

chrome-print

Prince (print)

This was also broken before — I think the issue is my prince configuration.

prince-print

jgm commented 5 years ago

Thanks. I may consider changing that pandoc test to turn off highlighting; it causes problems!

dbaynard commented 5 years ago

I was hoping to have a better was to manage the CSS; it's hard to justify adding a dependency on clay given that it isn't really being maintained. It should make it easier in future to see what the sections do. If I can't come up with a good solution, I'll just add extra documentation (otherwise I'll improve and document).