Commit graph

42 commits

Author SHA1 Message Date
John MacFarlane
b61a51ee15 hlint suggestions. 2017-06-02 15:25:39 +02:00
Albert Krewinkel
965f1ddd4a
Update dates in copyright notices
This follows the suggestions given by the FSF for GPL licensed software.
<https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-13 23:30:13 +02:00
John MacFarlane
80d093843b Allow dynamic loading of syntax definitions.
See #3334.

* Add writerSyntaxMap to WriterOptions.
* Highlighting: added parameter for SyntaxMap to highlight.
* Implemented --syntax-definition option.

TODO:

[ ] Figure out whether we want to have the xml parsing
    depend on the dtd (it currently does, and fails unless
    the language.dtd is found in the same directory).
[ ] Add an option to read a KDE syntax highlighting theme
    as a custom style.
[ ] Add tests.
2017-03-30 22:36:36 +02:00
John MacFarlane
db37b71d9a Highlighting: highlighting now returns an Either rather than Maybe.
This allows us to display error information returned by the
skylighting library.

Display a warning if the highlighting library throws an error.
2017-03-13 11:38:19 +01:00
John MacFarlane
e256c8ce17 Stylish-haskell automatic formatting changes. 2017-03-04 13:03:41 +01:00
John MacFarlane
0bbea0cc76 Split pandoc.hs into a module, Text.Pandoc.App, and a small program.
The App module provides a function that does a pandoc conversion,
based on option settings.  The program (pandoc.hs) now does nothing
more than parse options and pass them to this function, which can
easily be used by other applications (e.g. a GUI wrapper).

The Opt structure has been further simplified.

API changes:

* New exposed module Text.Pandoc.App
* Text.Pandoc.Highlighting has been exposed.
* highlightingStyles has been moved to Text.Pandoc.Highlighting.
2017-02-05 21:58:45 +01:00
John MacFarlane
d1dd4f2e26 Removed unneeded imports. 2017-01-29 20:34:43 +01:00
John MacFarlane
a5d855d342 Update list of listings languages in Highlighting.
This allows more languages to be used when using the `--listings`
option.

Closes #3374.
2017-01-25 12:35:14 +01:00
John MacFarlane
9d781b1454 Updates to use skylighting rather than highlighting-kate.
So far this just reproduces capacity.

Later we'll be able to add features like warning
messages, dynamic loading of xml syntax definitions,
and dynamic loading of themes.
2016-12-23 18:07:49 -07:00
John MacFarlane
499985c1a3 Updated copyright dates to include 2016. 2016-03-22 17:20:39 -07:00
John MacFarlane
11c5831a1f Make language extensions trigger highlighting.
For example, `py` will now work as well as `python`.
Closes jgm/highlighting-kate#83.
2016-01-24 14:15:06 -08:00
Raniere Silva
13f74d018b Add support to GAP 2015-12-03 08:23:26 -02:00
John MacFarlane
bbb3d8d442 hlint changes 2015-11-22 07:40:26 -08:00
John MacFarlane
23b693c029 Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."
This reverts commit c423dbb5a3.
2015-11-09 10:08:22 -08:00
John MacFarlane
c423dbb5a3 Use -XNoImplicitPrelude and 'import Prelude' explicitly.
This is needed for ghci to work with pandoc, given that we
now use a custom prelude.

Closes #2503.
2015-11-08 16:56:59 -08:00
John MacFarlane
1868cb5e42 Updated copyright notices to -2015. Closes #2111. 2015-04-26 10:18:29 -07:00
John MacFarlane
b371e83d73 Highlighting: Let .numberLines work even if no language given.
Closes #1287, jgm/highlighting-kate#40.
2014-06-17 15:15:56 -07:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
8b3a81e4dd LaTeX reader: Handle language attribute for lstlistings.
Convert it to a highlighting-kate language name.
2013-03-05 22:43:27 -08:00
John MacFarlane
3b63cb0903 Hide Text.Pandoc.Highlighting.
* Moved code for translating listings language names to
  highlighting-kate names and back from LaTeX reader to Highlighting.
* Text.Pandoc.Highlighting no longer exposed (API change)
* Text.Pandoc.Highlighting exports toListingsLang, fromListingsLang
2013-03-05 22:09:42 -08:00
John MacFarlane
a740de0508 Use safeRead instead of using reads directly (various modules). 2012-08-09 08:11:28 -07:00
John MacFarlane
b2340cd874 Added 'zenburn' highlight style from highlighting-kate.
Depend on h-k 0.5.0.6.
2012-05-17 18:54:41 -07:00
John MacFarlane
3a8afc119a Depend on highlighting-kate 0.5.
This uses styleToCss instead of styleToHtml.
2012-01-25 11:29:42 -08:00
John MacFarlane
012405e8c3 Preserve attributes in highlighted HTML.
The container element will have the classes, id, and
key-value attributes you specified in the delimited code
block.

Previously these were stripped off.
2011-12-28 22:04:38 -08:00
John MacFarlane
16629bf1ce Added --highlight-style and --no-highlight options. 2011-12-27 23:46:47 -08:00
John MacFarlane
3122959064 Highlighting: Add language as class name.
This restores behavior of 1.8.2.1. Adjusted tests.
2011-12-27 22:24:31 -08:00
John MacFarlane
45958de0e1 Updated highlighting for highlighting-kate 0.4.
Text.Pandoc.Highlighting now exports just one new function,
'highlight', and reexports all the other functions from
highlighting-kate that are used in the writers.  This should
make it easy to switch highlighting engines if that is ever
desired.
2011-12-26 22:49:50 -08:00
John MacFarlane
3fa98607db LaTeX writer: Implemented syntax highlighting for CodeBlocks. 2011-12-23 18:05:14 -08:00
John MacFarlane
fca95bf43c Removed highlighting flag. Highlighting support is now standard. 2011-12-22 13:24:43 -08:00
John MacFarlane
7046cef263 Changed types of highlighting functions.
* highlightLaTeX, highlightHtml now return Maybe, not Either.
* This is because h-k's higdlightAs no longer returns an Either.
2011-12-22 00:33:38 -08:00
John MacFarlane
569fc4c67a Added highlightLaTeX stub when not compiled w/ highlighting. 2011-12-19 21:59:53 -08:00
John MacFarlane
a936e5d34f Added highlightLaTeX to Text.Pandoc.Highlighting. 2011-12-19 11:51:17 -08:00
John MacFarlane
1a22e75352 HTML writer: Retain ID attribute in highlighted code blocks. 2011-12-18 12:33:11 -08:00
John MacFarlane
f0e0e1e5d4 Highlighting: Use reads instead of read.
Fixes crash on startNum="abc".
2011-12-18 11:42:24 -08:00
John MacFarlane
89c962a18c Use blaze-html instead of xhtml for HTML generation.
* This is a breaking API change for `writeHtml`.
* It introduces a new dependency on blaze-html.
* Pandoc now depends on highlighting-kate >= 0.4, which
  also uses blaze-html.
* The --ascii option has been removed, because of differences
  in blaze-html's and xhtml's escaping.
* Pandoc will no longer transform leading newlines in code
  blocks to `<br/>` tags.
2011-12-17 22:46:03 -08:00
John MacFarlane
caa091e810 Highlighting: Fixed non-highlighting-kate version of highlightHtml. 2011-01-29 23:08:29 -08:00
John MacFarlane
9f28acba9d Fixed highlighting for inline code.
highlightHtml in Highlighting now has a boolean argument that
selects between inline and block content.

Revised tests for new highlighting-kate.
2011-01-29 16:04:07 -08:00
fiddlosopher
ca2bbafbb9 Removed redundant imports (found by ghc 6.12).
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1750 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-12-31 16:48:36 +00:00
fiddlosopher
1b3d5896c7 Removed unneeded LANGUAGE pragmas.
(CPP is enabled globally in the cabal file.)

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1747 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-12-31 16:48:14 +00:00
fiddlosopher
39f6af5de4 Modified html+lhs output to use 'haskell' highlighter.
The bird tracks are added in the highlighting module.
This makes sense, because the kate's haskell highlighter
is much better than the literateHaskell highlighter.

git-svn-id: https://pandoc.googlecode.com/svn/trunk@1620 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-11-21 04:40:59 +00:00
fiddlosopher
d3f4293725 Export languagesByExtension in Text.Pandoc.Highlighting.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1585 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-07-03 02:33:43 +00:00
fiddlosopher
42aca57dee Moved all haskell source to src subdirectory.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1528 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-01-24 20:00:26 +00:00
Renamed from Text/Pandoc/Highlighting.hs (Browse further)