summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn MacFarlane <fiddlosopher@gmail.com>2011-12-22 13:21:44 -0800
committerJohn MacFarlane <fiddlosopher@gmail.com>2011-12-22 13:24:43 -0800
commitfca95bf43c16f19466df26c7875a5c8be144b77e (patch)
tree950a13926dc260b2e53ea80ea73d04a408bed41f
parentf61e09cb9a67e13deee5c48ac815e03f79989817 (diff)
Removed highlighting flag. Highlighting support is now standard.
-rw-r--r--INSTALL18
-rw-r--r--README7
-rw-r--r--pandoc.cabal17
-rw-r--r--src/Tests/Old.hs6
-rw-r--r--src/Text/Pandoc/Highlighting.hs17
-rw-r--r--src/pandoc.hs7
-rw-r--r--tests/lhs-test.nohl.html24
-rw-r--r--tests/lhs-test.nohl.html+lhs24
8 files changed, 10 insertions, 110 deletions
diff --git a/INSTALL b/INSTALL
index 9c16ddc0a..20b89750b 100644
--- a/INSTALL
+++ b/INSTALL
@@ -15,11 +15,6 @@ the [cabal-install] build tool.
cabal install pandoc
- If you want support for source code syntax highlighting, set
- the `highlighting` flag:
-
- cabal install -fhighlighting pandoc
-
This procedure will install the released version of pandoc,
which will be downloaded automatically from HackageDB.
If you want to install a modified or development version
@@ -28,15 +23,6 @@ the [cabal-install] build tool.
cabal install
- If you are on OSX, you may encounter an error installing highlighting-kate,
-
- ld: scattered reloc r_address too large
-
- The workaround is this:
-
- cabal install highlighting-kate --disable-library-for-ghci
- cabal install pandoc -fhighlighting -f-wrappers
-
3. Make sure the `$CABALDIR/bin` directory is in your path. You should
now be able to run `pandoc`:
@@ -60,8 +46,7 @@ quick install, but this information may be of use to packagers.
For more details, see the [Cabal User's Guide].
1. Install dependencies: in addition to the [Haskell platform],
-you will need [zip-archive] and (if you want syntax highlighting)
-[highlighting-kate].
+you will need [zip-archive], [blaze-html], and [highlighting-kate].
2. Configure:
@@ -114,5 +99,6 @@ you will need [zip-archive] and (if you want syntax highlighting)
[zip-archive]: http://hackage.haskell.org/package/zip-archive
[highlighting-kate]: http://hackage.haskell.org/package/highlighting-kate
+[blaze-html]: http://hackage.haskell.org/package/blaze-html
[Cabal User's Guide]: http://www.haskell.org/cabal/release/latest/doc/users-guide/builders.html#setup-configure-paths
diff --git a/README b/README
index 6b27d59e9..7790c4c8d 100644
--- a/README
+++ b/README
@@ -842,12 +842,9 @@ this syntax:
Some output formats can use this information to do syntax highlighting.
Currently, the only output format that uses this information is HTML.
-
-If pandoc has been compiled with syntax highlighting support, then the
+If highlighting is supported for your output format and language, then the
code block above will appear highlighted, with numbered lines. (To see
-which languages are supported, do `pandoc --version`.)
-
-If pandoc has not been compiled with syntax highlighting support, the
+which languages are supported, do `pandoc --version`.) Otherwise, the
code block above will appear as follows:
<pre class="haskell">
diff --git a/pandoc.cabal b/pandoc.cabal
index 78037a445..d6eb33d41 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -179,9 +179,6 @@ Source-repository head
Flag threaded
Description: Compile markdown2pdf with -threaded option.
Default: True
-Flag highlighting
- Description: Compile in support for syntax highlighting of code blocks.
- Default: False
Flag executable
Description: Build the pandoc executable.
Default: True
@@ -225,14 +222,12 @@ Library
dlist >= 0.4 && < 0.6,
tagsoup >= 0.12.5 && < 0.13,
base64-bytestring >= 0.1 && < 0.2,
- zlib >= 0.5 && <= 0.6
+ zlib >= 0.5 && <= 0.6,
+ highlighting-kate >= 0.4 && < 0.5
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
else
Build-depends: base >= 3 && < 4
- if flag(highlighting)
- Build-depends: highlighting-kate >= 0.4 && < 0.5
- cpp-options: -D_HIGHLIGHTING
if impl(ghc >= 6.12)
Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
else
@@ -313,14 +308,12 @@ Executable pandoc
dlist >= 0.4 && < 0.6,
tagsoup >= 0.12.5 && < 0.13,
base64-bytestring >= 0.1 && < 0.2,
- zlib >= 0.5 && <= 0.6
+ zlib >= 0.5 && <= 0.6,
+ highlighting-kate >= 0.4 && < 0.5
if impl(ghc >= 6.10)
Build-depends: base >= 4 && < 5, syb >= 0.1 && < 0.4
else
Build-depends: base >= 3 && < 4
- if flag(highlighting)
- Build-depends: highlighting-kate >= 0.4 && < 0.5
- cpp-options: -D_HIGHLIGHTING
if impl(ghc >= 6.12)
Ghc-Options: -O2 -Wall -fno-warn-unused-do-bind
else
@@ -353,8 +346,6 @@ Executable markdown2pdf
Executable test-pandoc
Hs-Source-Dirs: src
Main-Is: test-pandoc.hs
- if flag(highlighting)
- cpp-options: -D_HIGHLIGHTING
if impl(ghc >= 7)
cpp-options: -D_LIT=lit
else
diff --git a/src/Tests/Old.hs b/src/Tests/Old.hs
index 71a198ca1..1ec32a30d 100644
--- a/src/Tests/Old.hs
+++ b/src/Tests/Old.hs
@@ -13,7 +13,6 @@ import Data.Algorithm.Diff
import Text.Pandoc.Shared ( normalize, defaultWriterOptions )
import Text.Pandoc.Writers.Native ( writeNative )
import Text.Pandoc.Readers.Native ( readNative )
-import Text.Pandoc.Highlighting ( languages )
import Prelude hiding ( readFile )
import qualified Data.ByteString.Lazy as B
import Data.ByteString.Lazy.UTF8 (toString)
@@ -121,10 +120,7 @@ lhsWriterTests format
]
where
t n f = test n ["--columns=78", "-r", "native", "-s", "-w", f]
- "lhs-test.native" ("lhs-test" <.> ext f)
- ext f = if null languages && format == "html"
- then "nohl" <.> f
- else f
+ "lhs-test.native" ("lhs-test" <.> f)
lhsReaderTest :: String -> Test
lhsReaderTest format =
diff --git a/src/Text/Pandoc/Highlighting.hs b/src/Text/Pandoc/Highlighting.hs
index 282c13930..60e900333 100644
--- a/src/Text/Pandoc/Highlighting.hs
+++ b/src/Text/Pandoc/Highlighting.hs
@@ -36,7 +36,6 @@ module Text.Pandoc.Highlighting ( languages
) where
import Text.Blaze
import Text.Pandoc.Definition
-#ifdef _HIGHLIGHTING
import Text.Highlighting.Kate ( SourceLine, languages, highlightAs, formatAsHtml,
TokenType(..), formatAsLaTeX, FormatOption (..), defaultHighlightingCss, languagesByExtension )
import Data.List (find)
@@ -82,19 +81,3 @@ highlightLaTeX :: Bool -- ^ True if inline
-> Maybe String -- ^ Maybe formatted LaTeX
highlightLaTeX = highlight formatAsLaTeX
-#else
-defaultHighlightingCss :: String
-defaultHighlightingCss = ""
-
-languages :: [String]
-languages = []
-
-languagesByExtension :: String -> [String]
-languagesByExtension _ = []
-
-highlightHtml :: Bool -> Attr -> String -> Maybe Html
-highlightHtml _ _ _ = Left "Pandoc was not compiled with support for highlighting"
-
-highlightLaTeX :: Bool -> Attr -> String -> Maybe String
-highlightLaTeX _ _ _ = Left "Pandoc was not compiled with support for highlighting"
-#endif
diff --git a/src/pandoc.hs b/src/pandoc.hs
index f855e2d3f..3ef82accc 100644
--- a/src/pandoc.hs
+++ b/src/pandoc.hs
@@ -33,9 +33,7 @@ import Text.Pandoc
import Text.Pandoc.Shared ( tabFilter, ObfuscationMethod (..), readDataFile,
headerShift, findDataFile, normalize )
import Text.Pandoc.SelfContained ( makeSelfContained )
-#ifdef _HIGHLIGHTING
import Text.Pandoc.Highlighting ( languages )
-#endif
import System.Environment ( getArgs, getProgName )
import System.Exit ( exitWith, ExitCode (..) )
import System.FilePath
@@ -65,11 +63,8 @@ copyrightMessage = "\nCopyright (C) 2006-2011 John MacFarlane\n" ++
compileInfo :: String
compileInfo =
"\nCompiled with citeproc support." ++
-#ifdef _HIGHLIGHTING
"\nCompiled with syntax highlighting support for:\n" ++
- wrapWords 78 languages ++
-#endif
- ""
+ wrapWords 78 languages
-- | Converts a list of strings into a single string with the items printed as
-- comma separated words in lines with a maximum line length.
diff --git a/tests/lhs-test.nohl.html b/tests/lhs-test.nohl.html
deleted file mode 100644
index ebe437b18..000000000
--- a/tests/lhs-test.nohl.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta name="generator" content="pandoc" />
- <title></title>
-</head>
-<body>
-<h1 id="lhs-test">lhs test</h1>
-<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>
-<pre class="sourceCode haskell"><code>unsplit :: (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d
-unsplit = arr . uncurry
- -- arr (\op (x,y) -&gt; x `op` y)
-</code></pre>
-<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p>
-<pre><code>f *** g = first f &gt;&gt;&gt; second g
-</code></pre>
-<p>Block quote:</p>
-<blockquote>
-<p>foo bar</p>
-</blockquote>
-</body>
-</html>
diff --git a/tests/lhs-test.nohl.html+lhs b/tests/lhs-test.nohl.html+lhs
deleted file mode 100644
index c6205530d..000000000
--- a/tests/lhs-test.nohl.html+lhs
+++ /dev/null
@@ -1,24 +0,0 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
-<head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <meta http-equiv="Content-Style-Type" content="text/css" />
- <meta name="generator" content="pandoc" />
- <title></title>
-</head>
-<body>
-<h1 id="lhs-test">lhs test</h1>
-<p><code>unsplit</code> is an arrow that takes a pair of values and combines them to return a single value:</p>
-<pre class="sourceCode literate haskell"><code>&gt; unsplit :: (Arrow a) =&gt; (b -&gt; c -&gt; d) -&gt; a (b, c) d
-&gt; unsplit = arr . uncurry
-&gt; -- arr (\op (x,y) -&gt; x `op` y)
-</code></pre>
-<p><code>(***)</code> combines two arrows into a new arrow by running the two arrows on a pair of values (one arrow on the first item of the pair and one arrow on the second item of the pair).</p>
-<pre><code>f *** g = first f &gt;&gt;&gt; second g
-</code></pre>
-<p>Block quote:</p>
-<blockquote>
-<p>foo bar</p>
-</blockquote>
-</body>
-</html>