aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.travis.yml5
-rw-r--r--INSTALL2
-rw-r--r--Makefile2
-rw-r--r--README6
-rw-r--r--Setup.hs44
-rw-r--r--changelog13
m---------data/templates14
-rw-r--r--pandoc.cabal2
-rw-r--r--src/Text/Pandoc/PDF.hs2
-rw-r--r--src/Text/Pandoc/Writers/CommonMark.hs6
-rw-r--r--src/Text/Pandoc/Writers/HTML.hs4
-rw-r--r--tests/writer.context2
-rw-r--r--tests/writer.html2
-rw-r--r--windows/pandoc.wxs3
14 files changed, 77 insertions, 30 deletions
diff --git a/.travis.yml b/.travis.yml
index 3ddebeb07..9a67ac32b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -28,6 +28,11 @@ install:
# Here starts the actual work to be performed for the package under test; any command which exits with a non-zero exit code causes the build to fail.
script:
+ - |
+ if [ "${CABALVER}" != "1.16" ]; then
+ cabal-$CABALVER sdist --output-directory=build
+ cd build
+ fi
- cabal-$CABALVER configure --enable-tests -v2 # -v2 provides useful information for debugging
- cabal-$CABALVER build $JOPTS --ghc-options=$GHCOPTS # this builds all libraries and executables (including tests/benchmarks)
- cabal-$CABALVER test
diff --git a/INSTALL b/INSTALL
index 9156356ca..4f20c9d67 100644
--- a/INSTALL
+++ b/INSTALL
@@ -119,7 +119,7 @@ assume that the pandoc source directory is your working directory.
- `embed_data_files`: embed all data files into the binary (default no).
This is helpful if you want to create a relocatable binary.
Note: if this option is selected, you need to install the
- `hsb2hs` preprocessor: `cabal install hsb2hs` (version 0.3 or
+ `hsb2hs` preprocessor: `cabal install hsb2hs` (version 0.3.1 or
higher is required).
- `https`: enable support for downloading resources over https
diff --git a/Makefile b/Makefile
index a2ed18d55..a44085420 100644
--- a/Makefile
+++ b/Makefile
@@ -49,7 +49,7 @@ man/pandoc.1: README man/pandoc.1.template
download_stats:
curl https://api.github.com/repos/jgm/pandoc/releases | \
- jq '[.[] | .assets | .[] | {name: .name, download_count: .download_count}]'
+ jq -r '.[] | .assets | .[] | "\(.download_count)\t\(.name)"'
clean:
cabal clean
diff --git a/README b/README
index 370f425bd..096cb5ce2 100644
--- a/README
+++ b/README
@@ -395,9 +395,9 @@ General writer options
of template syntax. If no extension is specified, an extension
corresponding to the writer will be added, so that `--template=special`
looks for `special.html` for HTML output. If the template is not
- found, pandoc will search for it in the user data directory
- (see `--data-dir`). If this option is not used, a default
- template appropriate for the output format will be used (see
+ found, pandoc will search for it in the `templates` subdirectory of
+ the user data directory (see `--data-dir`). If this option is not used,
+ a default template appropriate for the output format will be used (see
`-D/--print-default-template`).
`-V` *KEY*[`=`*VAL*], `--variable=`*KEY*[`:`*VAL*]
diff --git a/Setup.hs b/Setup.hs
index ab54957f5..312e1cf47 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -18,32 +18,60 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import Distribution.Simple
import Distribution.Simple.PreProcess
-import Distribution.PackageDescription (PackageDescription(..))
+import Distribution.Simple.Setup (ConfigFlags(..))
+import Distribution.PackageDescription (PackageDescription(..), FlagName(..))
import System.Process ( rawSystem )
import System.FilePath ( (</>) )
import System.Directory ( findExecutable )
+import Distribution.Verbosity ( Verbosity )
import Distribution.Simple.Utils (info, notice, installOrdinaryFiles)
import Distribution.Simple.Setup
+import Distribution.Simple.Program (simpleProgram, Program(..))
import Distribution.Simple.LocalBuildInfo
+import Data.Version
+import System.Process (readProcess)
+import Text.ParserCombinators.ReadP (readP_to_S, skipSpaces, eof)
+import Control.Monad (when)
+import qualified Control.Exception as E
main :: IO ()
main = defaultMainWithHooks $ simpleUserHooks {
-- enable hsb2hs preprocessor for .hsb files
hookedPreProcessors = [ppBlobSuffixHandler]
+ , hookedPrograms = [(simpleProgram "hsb2hs"){
+ programFindVersion = findHsb2hsVersion }]
, postCopy = installManPage
}
+findHsb2hsVersion :: Verbosity -> FilePath -> IO (Maybe Version)
+findHsb2hsVersion verb fp = do
+ let handleExitFailure :: IOError -> IO (Maybe Version)
+ handleExitFailure _ = return Nothing
+ E.handle handleExitFailure $ do
+ outp <- readProcess fp ["--version"] ""
+ case readP_to_S (do v <- parseVersion
+ skipSpaces
+ eof
+ return v) outp of
+ ((v,""):_) -> return (Just v)
+ _ -> return Nothing
+
ppBlobSuffixHandler :: PPSuffixHandler
-ppBlobSuffixHandler = ("hsb", \_ _ ->
+ppBlobSuffixHandler = ("hsb", \_ lbi ->
PreProcessor {
platformIndependent = True,
runPreProcessor = mkSimplePreProcessor $ \infile outfile verbosity ->
- do info verbosity $ "Preprocessing " ++ infile ++ " to " ++ outfile
- hsb2hsPath <- findExecutable "hsb2hs"
- case hsb2hsPath of
- Just p -> rawSystem p [infile, infile, outfile]
- Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"
- return ()
+ do let embedData = case lookup (FlagName "embed_data_files")
+ (configConfigurationsFlags (configFlags lbi)) of
+ Just True -> True
+ _ -> False
+ when embedData $
+ do info verbosity $ "Preprocessing " ++ infile ++ " to " ++ outfile
+ hsb2hsPath <- findExecutable "hsb2hs"
+ case hsb2hsPath of
+ Just p -> rawSystem p [infile, infile, outfile]
+ Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"
+ return ()
})
installManPage :: Args -> CopyFlags
diff --git a/changelog b/changelog
index e3f6484a1..8fc8d6e6a 100644
--- a/changelog
+++ b/changelog
@@ -1,3 +1,16 @@
+pandoc (1.15.0.4)
+
+ * Added pandoc.1 man page to the repository. It is no longer
+ built as part of the cabal build process. (This proved too
+ fragile.) pandoc.1 can be regenerated (`make man/pandoc.1`)
+ when `README` is changed.
+
+ * Copying of the man page now respects `--destdir` (#2262).
+
+ * Improved error messages for filters. User is now informed if
+ the filter requires an interpreter that isn't found in the path,
+ or if the filter returns an error status.
+
pandoc (1.15.0.3)
* Ensure target directory is created when installing man page.
diff --git a/data/templates b/data/templates
-Subproject 4d9a73d767b200a0cf43eeab7fc114c106f7b37
+Subproject d171db3e6d28134e0f98ba10c60ac8c13380a48
diff --git a/pandoc.cabal b/pandoc.cabal
index 34d026827..9045647df 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -292,7 +292,7 @@ Library
cpp-options: -DHTTP_CLIENT
if flag(embed_data_files)
cpp-options: -DEMBED_DATA_FILES
- -- Build-Tools: hsb2hs -- not yet recognized by cabal
+ Build-Tools: hsb2hs >= 0.3.1
other-modules: Text.Pandoc.Data
if os(windows)
Cpp-options: -D_WINDOWS
diff --git a/src/Text/Pandoc/PDF.hs b/src/Text/Pandoc/PDF.hs
index 1711c0f36..8f92a3321 100644
--- a/src/Text/Pandoc/PDF.hs
+++ b/src/Text/Pandoc/PDF.hs
@@ -190,7 +190,7 @@ runTeXProgram verbose program args runNumber numRuns tmpDir source = do
let file' = file
#endif
let programArgs = ["-halt-on-error", "-interaction", "nonstopmode",
- "-output-directory", tmpDir', file'] ++ args
+ "-output-directory", tmpDir'] ++ args ++ [file']
env' <- getEnvironment
let sep = searchPathSeparator:[]
let texinputs = maybe (tmpDir' ++ sep) ((tmpDir' ++ sep) ++)
diff --git a/src/Text/Pandoc/Writers/CommonMark.hs b/src/Text/Pandoc/Writers/CommonMark.hs
index 706b27175..61ac0fdba 100644
--- a/src/Text/Pandoc/Writers/CommonMark.hs
+++ b/src/Text/Pandoc/Writers/CommonMark.hs
@@ -144,11 +144,11 @@ inlineToNodes (Strikeout xs) =
((node (INLINE_HTML (T.pack "<s>")) [] : inlinesToNodes xs ++
[node (INLINE_HTML (T.pack "</s>")) []]) ++ )
inlineToNodes (Superscript xs) =
- ((node (INLINE_HTML (T.pack "<sub>")) [] : inlinesToNodes xs ++
- [node (INLINE_HTML (T.pack "</sub>")) []]) ++ )
-inlineToNodes (Subscript xs) =
((node (INLINE_HTML (T.pack "<sup>")) [] : inlinesToNodes xs ++
[node (INLINE_HTML (T.pack "</sup>")) []]) ++ )
+inlineToNodes (Subscript xs) =
+ ((node (INLINE_HTML (T.pack "<sub>")) [] : inlinesToNodes xs ++
+ [node (INLINE_HTML (T.pack "</sub>")) []]) ++ )
inlineToNodes (SmallCaps xs) =
((node (INLINE_HTML (T.pack "<span style=\"font-variant:small-caps;\">")) []
: inlinesToNodes xs ++
diff --git a/src/Text/Pandoc/Writers/HTML.hs b/src/Text/Pandoc/Writers/HTML.hs
index 8de34ace8..a1594b2c4 100644
--- a/src/Text/Pandoc/Writers/HTML.hs
+++ b/src/Text/Pandoc/Writers/HTML.hs
@@ -375,8 +375,8 @@ obfuscateLink opts (renderHtml -> txt) s =
(linkText, altText) =
if txt == drop 7 s' -- autolink
then ("e", name' ++ " at " ++ domain')
- else ("'" ++ txt ++ "'", txt ++ " (" ++ name' ++ " at " ++
- domain' ++ ")")
+ else ("'" ++ obfuscateString txt ++ "'",
+ txt ++ " (" ++ name' ++ " at " ++ domain' ++ ")")
in case meth of
ReferenceObfuscation ->
-- need to use preEscapedString or &'s are escaped to &amp; in URL
diff --git a/tests/writer.context b/tests/writer.context
index 244463f93..29af26dba 100644
--- a/tests/writer.context
+++ b/tests/writer.context
@@ -25,7 +25,7 @@
\definedescription
[description]
- [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm]
+ [headstyle=bold, style=normal, location=hanging, width=broad, margin=1cm, alternative=hanging]
\setupitemize[autointro] % prevent orphan list intro
\setupitemize[indentnext=no]
diff --git a/tests/writer.html b/tests/writer.html
index 1357fa7c4..4a60a7b97 100644
--- a/tests/writer.html
+++ b/tests/writer.html
@@ -481,7 +481,7 @@ Blah
<p><script type="text/javascript">
<!--
h='&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#46;&#110;&#x65;&#116;';a='&#64;';n='&#110;&#x6f;&#98;&#x6f;&#100;&#x79;';e=n+a+h;
-document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'Email link'+'<\/'+'a'+'>');
+document.write('<a h'+'ref'+'="ma'+'ilto'+':'+e+'" clas'+'s="em' + 'ail">'+'&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;'+'<\/'+'a'+'>');
// -->
</script><noscript>&#x45;&#x6d;&#x61;&#x69;&#108;&#32;&#108;&#x69;&#110;&#x6b;&#32;&#40;&#110;&#x6f;&#98;&#x6f;&#100;&#x79;&#32;&#x61;&#116;&#32;&#110;&#x6f;&#x77;&#104;&#x65;&#114;&#x65;&#32;&#100;&#x6f;&#116;&#32;&#110;&#x65;&#116;&#x29;</noscript></p>
<p><a href="">Empty</a>.</p>
diff --git a/windows/pandoc.wxs b/windows/pandoc.wxs
index 71777a666..90c0069a5 100644
--- a/windows/pandoc.wxs
+++ b/windows/pandoc.wxs
@@ -7,7 +7,6 @@
Language="1033">
<Package InstallerVersion="200" Compressed="yes"
- InstallPrivileges="limited"
Comments="Windows Installer Package" />
<Media Id="1" Cabinet="product.cab" EmbedCab="yes" />
<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
@@ -135,6 +134,8 @@
<Property Id="ApplicationFolderName" Value="Pandoc" />
<Property Id="WixAppFolder" Value="WixPerUserFolder" />
+ <Property Id="ALLUSERS" Value="2" Secure="yes" />
+ <Property Id='MSIINSTALLPERUSER' Value='1' />
<WixVariable Id="WixUILicenseRtf" Value="..\COPYING.rtf" />