jgm / skylighting

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

Add no-highlight option #48

Closed dbaynard closed 5 years ago

dbaynard commented 6 years ago

skylighting does two tasks:

  1. Formats code
  2. Highlights code

At the moment, skylighting does not highlight code without formatting; this causes problems e.g. jgm/pandoc#4688 as the skylighting formatting functionality must be duplicated.

The skylighting api should make it possible to format code without highlighting.

jgm commented 6 years ago

One approach would be to add a default.xml syntax description that basically does not highlighting, derive a syntax from it, and use this as the default.

This would require no other changes to the API, at the cost of being a bit slower I suppose.

dbaynard notifications@github.com writes:

skylighting does two tasks:

  1. Formats code
  2. Highlights code

At the moment, skylighting does not highlight code without formatting; this causes problems e.g. jgm/pandoc#4688 as the skylighting formatting functionality must be duplicated.

The skylighting api should make it possible to format code without highlighting.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jgm/skylighting/issues/48

jgm commented 6 years ago

I've just pushed a commit adding 'default' syntax.

John MacFarlane jgm@berkeley.edu writes:

One approach would be to add a default.xml syntax description that basically does not highlighting, derive a syntax from it, and use this as the default.

This would require no other changes to the API, at the cost of being a bit slower I suppose.

dbaynard notifications@github.com writes:

skylighting does two tasks:

  1. Formats code
  2. Highlights code

At the moment, skylighting does not highlight code without formatting; this causes problems e.g. jgm/pandoc#4688 as the skylighting formatting functionality must be duplicated.

The skylighting api should make it possible to format code without highlighting.

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/jgm/skylighting/issues/48

dbaynard commented 6 years ago

Is it worth adding something like the following:

extensions="*.txt" mimetype="text/plain" 

here?

https://github.com/jgm/skylighting/blob/3238154b390da1fe62a89ab1b3820c1dedd9366b/skylighting-core/xml/default.xml#L3