aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile53
-rw-r--r--Setup.hs48
m---------data/templates13
-rw-r--r--pandoc.cabal269
-rw-r--r--src/Text/Pandoc/Shared.hs17
-rw-r--r--tests/Tests/Old.hs30
-rw-r--r--tests/Tests/Readers/Docx.hs122
-rw-r--r--tests/Tests/Readers/EPUB.hs2
-rw-r--r--tests/docx/already_auto_ident.docx (renamed from tests/docx.already_auto_ident.docx)bin8463 -> 8463 bytes
-rw-r--r--tests/docx/already_auto_ident.native (renamed from tests/docx.already_auto_ident.native)0
-rw-r--r--tests/docx/block_quotes.docx (renamed from tests/docx.block_quotes.docx)bin41855 -> 41855 bytes
-rw-r--r--tests/docx/block_quotes_parse_indent.native (renamed from tests/docx.block_quotes_parse_indent.native)0
-rw-r--r--tests/docx/codeblock.docx (renamed from tests/docx.codeblock.docx)bin8465 -> 8465 bytes
-rw-r--r--tests/docx/codeblock.native (renamed from tests/docx.codeblock.native)0
-rw-r--r--tests/docx/deep_normalize.docx (renamed from tests/docx.deep_normalize.docx)bin29246 -> 29246 bytes
-rw-r--r--tests/docx/deep_normalize.native (renamed from tests/docx.deep_normalize.native)0
-rw-r--r--tests/docx/definition_list.docx (renamed from tests/docx.definition_list.docx)bin8455 -> 8455 bytes
-rw-r--r--tests/docx/definition_list.native (renamed from tests/docx.definition_list.native)0
-rw-r--r--tests/docx/drop_cap.docx (renamed from tests/docx.drop_cap.docx)bin26931 -> 26931 bytes
-rw-r--r--tests/docx/drop_cap.native (renamed from tests/docx.drop_cap.native)0
-rw-r--r--tests/docx/hanging_indent.docx (renamed from tests/docx.hanging_indent.docx)bin29924 -> 29924 bytes
-rw-r--r--tests/docx/hanging_indent.native (renamed from tests/docx.hanging_indent.native)0
-rw-r--r--tests/docx/headers.docx (renamed from tests/docx.headers.docx)bin30298 -> 30298 bytes
-rw-r--r--tests/docx/headers.native (renamed from tests/docx.headers.native)0
-rw-r--r--tests/docx/image.docx (renamed from tests/docx.image.docx)bin36942 -> 36942 bytes
-rw-r--r--tests/docx/image_no_embed.native (renamed from tests/docx.image_no_embed.native)0
-rw-r--r--tests/docx/inline_code.docx (renamed from tests/docx.inline_code.docx)bin8379 -> 8379 bytes
-rw-r--r--tests/docx/inline_code.native (renamed from tests/docx.inline_code.native)0
-rw-r--r--tests/docx/inline_formatting.docx (renamed from tests/docx.inline_formatting.docx)bin32322 -> 32322 bytes
-rw-r--r--tests/docx/inline_formatting.native (renamed from tests/docx.inline_formatting.native)0
-rw-r--r--tests/docx/inline_images.docx (renamed from tests/docx.inline_images.docx)bin37784 -> 37784 bytes
-rw-r--r--tests/docx/inline_images.native (renamed from tests/docx.inline_images.native)0
-rw-r--r--tests/docx/links.docx (renamed from tests/docx.links.docx)bin41751 -> 41751 bytes
-rw-r--r--tests/docx/links.native (renamed from tests/docx.links.native)0
-rw-r--r--tests/docx/lists.docx (renamed from tests/docx.lists.docx)bin31775 -> 31775 bytes
-rw-r--r--tests/docx/lists.native (renamed from tests/docx.lists.native)0
-rw-r--r--tests/docx/metadata.docx (renamed from tests/docx.metadata.docx)bin39538 -> 39538 bytes
-rw-r--r--tests/docx/metadata.native (renamed from tests/docx.metadata.native)0
-rw-r--r--tests/docx/metadata_after_normal.docx (renamed from tests/docx.metadata_after_normal.docx)bin56276 -> 56276 bytes
-rw-r--r--tests/docx/metadata_after_normal.native (renamed from tests/docx.metadata_after_normal.native)0
-rw-r--r--tests/docx/normalize.docx (renamed from tests/docx.normalize.docx)bin25791 -> 25791 bytes
-rw-r--r--tests/docx/normalize.native (renamed from tests/docx.normalize.native)0
-rw-r--r--tests/docx/notes.docx (renamed from tests/docx.notes.docx)bin30734 -> 30734 bytes
-rw-r--r--tests/docx/notes.native (renamed from tests/docx.notes.native)0
-rw-r--r--tests/docx/tables.docx (renamed from tests/docx.tables.docx)bin42792 -> 42792 bytes
-rw-r--r--tests/docx/tables.native (renamed from tests/docx.tables.native)0
-rw-r--r--tests/docx/tabs.docx (renamed from tests/docx.tabs.docx)bin12919 -> 12919 bytes
-rw-r--r--tests/docx/tabs.native (renamed from tests/docx.tabs.native)0
-rw-r--r--tests/docx/track_changes_deletion.docx (renamed from tests/docx.track_changes_deletion.docx)bin13350 -> 13350 bytes
-rw-r--r--tests/docx/track_changes_deletion_accept.native (renamed from tests/docx.track_changes_deletion_accept.native)0
-rw-r--r--tests/docx/track_changes_deletion_all.native (renamed from tests/docx.track_changes_deletion_all.native)0
-rw-r--r--tests/docx/track_changes_deletion_reject.native (renamed from tests/docx.track_changes_deletion_reject.native)0
-rw-r--r--tests/docx/track_changes_insertion.docx (renamed from tests/docx.track_changes_insertion.docx)bin12956 -> 12956 bytes
-rw-r--r--tests/docx/track_changes_insertion_accept.native (renamed from tests/docx.track_changes_insertion_accept.native)0
-rw-r--r--tests/docx/track_changes_insertion_all.native (renamed from tests/docx.track_changes_insertion_all.native)0
-rw-r--r--tests/docx/track_changes_insertion_reject.native (renamed from tests/docx.track_changes_insertion_reject.native)0
-rw-r--r--tests/docx/trailing_spaces_in_formatting.docx (renamed from tests/docx.trailing_spaces_in_formatting.docx)bin12916 -> 12916 bytes
-rw-r--r--tests/docx/trailing_spaces_in_formatting.native (renamed from tests/docx.trailing_spaces_in_formatting.native)0
-rw-r--r--tests/docx/unicode.docx (renamed from tests/docx.unicode.docx)bin11506 -> 11506 bytes
-rw-r--r--tests/docx/unicode.native (renamed from tests/docx.unicode.native)0
-rw-r--r--tests/dokuwiki-writer.dokuwiki3
-rw-r--r--tests/dokuwiki-writer.native2
-rw-r--r--tests/dokuwiki_inline_formatting.dokuwiki (renamed from tests/dokuwiki.inline_formatting.dokuwiki)4
-rw-r--r--tests/dokuwiki_inline_formatting.native (renamed from tests/dokuwiki.inline_formatting.native)4
-rw-r--r--tests/epub/features.epub (renamed from tests/epub.features.epub)bin67495 -> 67495 bytes
-rw-r--r--tests/epub/features.native (renamed from tests/epub.features.native)0
-rw-r--r--tests/epub/formatting.epub (renamed from tests/epub.formatting.epub)bin13460 -> 13460 bytes
-rw-r--r--tests/epub/formatting.native (renamed from tests/epub.formatting.native)0
-rw-r--r--tests/epub/wasteland.epub (renamed from tests/epub.wasteland.epub)bin101870 -> 101870 bytes
-rw-r--r--tests/epub/wasteland.native (renamed from tests/epub.wasteland.native)0
-rw-r--r--tests/fb2/basic.fb2 (renamed from tests/fb2.basic.fb2)0
-rw-r--r--tests/fb2/basic.markdown (renamed from tests/fb2.basic.markdown)0
-rw-r--r--tests/fb2/images-embedded.fb2 (renamed from tests/fb2.images-embedded.fb2)0
-rw-r--r--tests/fb2/images-embedded.html (renamed from tests/fb2.images-embedded.html)0
-rw-r--r--tests/fb2/images.fb2 (renamed from tests/fb2.images.fb2)0
-rw-r--r--tests/fb2/images.markdown (renamed from tests/fb2.images.markdown)4
-rw-r--r--tests/fb2/math.fb2 (renamed from tests/fb2.math.fb2)0
-rw-r--r--tests/fb2/math.markdown (renamed from tests/fb2.math.markdown)0
-rw-r--r--tests/fb2/test-small.png (renamed from tests/fb2.test-small.png)bin4090 -> 4090 bytes
-rw-r--r--tests/fb2/test.jpg (renamed from tests/fb2.test.jpg)bin153610 -> 153610 bytes
-rw-r--r--tests/fb2/titles.fb2 (renamed from tests/fb2.titles.fb2)0
-rw-r--r--tests/fb2/titles.markdown (renamed from tests/fb2.titles.markdown)0
-rw-r--r--tests/s5-basic.html (renamed from tests/s5.basic.html)0
-rw-r--r--tests/s5-fancy.html (renamed from tests/s5.fancy.html)0
-rw-r--r--tests/s5-fragment.html (renamed from tests/s5.fragment.html)0
-rw-r--r--tests/s5-inserts.html (renamed from tests/s5.inserts.html)0
-rw-r--r--tests/test-pandoc.hs7
87 files changed, 286 insertions, 292 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000..0bfea6f7b
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,53 @@
+version=$(shell grep '^Version:' pandoc.cabal | awk '{print $$2;}')
+makemanpages=$(shell find dist -type f -name make-pandoc-man-pages)
+ifeq "${makemanpages}" ""
+ makemanpages=@echo "You need to 'cabal configure -fmake-pandoc-man-pages && cabal build'" && exit 1
+endif
+setup=$(shell find dist -type f -name setup)
+MANPAGES=man/man1/pandoc.1 man/man5/pandoc_markdown.5
+CABALARGS=-fmake-pandoc-man-pages --enable-tests --enable-benchmarks
+
+all: build test
+
+deps:
+ cabal install ${OPTIONS} ${CABALARGS} --only-dependencies
+
+build:
+ cabal configure ${OPTIONS} ${CABALARGS}
+ cabal build
+
+test:
+ cabal test
+
+bench:
+ cabal bench
+
+install:
+ cabal install
+
+haddock:
+ cabal haddock
+
+sdist: man haddock
+ # note: cabal sdist doesn't work well with preprocessors for some cabal versions
+ ${setup} sdist
+
+# sanity check on sdist
+dist: sdist
+ rm -rf "pandoc-${version}"
+ tar xvzf dist/pandoc-${version}.tar.gz
+ cd pandoc-${version}
+ cabal configure ${CABALARGS} && cabal build && cabal test && cd .. && rm -rf "pandoc-${version}"
+
+man: ${MANPAGES}
+
+%.1: %.1.template
+ ${makemanpages}
+
+%.5: %.5.template
+ ${makemanpages}
+
+clean:
+ -rm ${MANPAGES}
+
+.PHONY: all man clean test build bench haddock sdist
diff --git a/Setup.hs b/Setup.hs
index 55a7c2178..7777a5133 100644
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,4 +1,3 @@
-{-# LANGUAGE CPP #-}
{-
Copyright (C) 2006-2014 John MacFarlane <jgm@berkeley.edu>
@@ -19,60 +18,24 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
import Distribution.Simple
import Distribution.Simple.PreProcess
-import Distribution.Simple.Setup
- (copyDest, copyVerbosity, fromFlag, installVerbosity, BuildFlags(..),
- TestFlags(..))
import Distribution.PackageDescription (PackageDescription(..), Executable(..))
-import Distribution.Simple.LocalBuildInfo
- (LocalBuildInfo(..), absoluteInstallDirs)
-import Distribution.Verbosity ( Verbosity, silent )
-import Distribution.Simple.InstallDirs (mandir, CopyDest (NoCopyDest), toPathTemplate)
-import Distribution.Simple.Utils (installOrdinaryFiles, info)
-import Distribution.Simple.Test (test)
import System.Process ( rawSystem )
import System.FilePath ( (</>) )
import System.Directory ( findExecutable )
-import System.Exit
+import Distribution.Simple.Utils (info)
main :: IO ()
-main = do
- defaultMainWithHooks $ simpleUserHooks {
- postBuild = makeManPages
- , postCopy = \ _ flags pkg lbi ->
- installManpages pkg lbi (fromFlag $ copyVerbosity flags)
- (fromFlag $ copyDest flags)
- , postInst = \ _ flags pkg lbi ->
- installManpages pkg lbi (fromFlag $ installVerbosity flags) NoCopyDest
+main = defaultMainWithHooks $ simpleUserHooks {
+ -- enable hsb2hs preprocessor for .hsb files
+ hookedPreProcessors = [ppBlobSuffixHandler]
+ -- ensure that make-pandoc-man-pages doesn't get installed to bindir
, copyHook = \pkgdescr ->
(copyHook simpleUserHooks) pkgdescr{ executables =
[x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
, instHook = \pkgdescr ->
(instHook simpleUserHooks) pkgdescr{ executables =
[x | x <- executables pkgdescr, exeName x /= "make-pandoc-man-pages"] }
- , hookedPreProcessors = [ppBlobSuffixHandler]
}
- exitWith ExitSuccess
-
--- | Build man pages from markdown sources in man/
-makeManPages :: Args -> BuildFlags -> PackageDescription -> LocalBuildInfo -> IO ()
-makeManPages _ flags _ lbi = do
- let verbosity = fromFlag $ buildVerbosity flags
- let args = ["--verbose" | verbosity /= silent]
- rawSystem (buildDir lbi </> "make-pandoc-man-pages" </> "make-pandoc-man-pages")
- args >>= exitWith
-
-manpages :: [FilePath]
-manpages = ["man1" </> "pandoc.1"
- ,"man5" </> "pandoc_markdown.5"]
-
-manDir :: FilePath
-manDir = "man"
-
-installManpages :: PackageDescription -> LocalBuildInfo
- -> Verbosity -> CopyDest -> IO ()
-installManpages pkg lbi verbosity copy =
- installOrdinaryFiles verbosity (mandir (absoluteInstallDirs pkg lbi copy))
- (zip (repeat manDir) manpages)
ppBlobSuffixHandler :: PPSuffixHandler
ppBlobSuffixHandler = ("hsb", \_ _ ->
@@ -85,5 +48,4 @@ ppBlobSuffixHandler = ("hsb", \_ _ ->
Just p -> rawSystem p [infile, infile, outfile]
Nothing -> error "hsb2hs is needed to build this program: cabal install hsb2hs"
return ()
-
})
diff --git a/data/templates b/data/templates
-Subproject 3befef257ce461ae68760004df938f3ca8397b3
+Subproject 095196e8d6e873ee36846ca120bf5dfd39e30a8
diff --git a/pandoc.cabal b/pandoc.cabal
index 80fd994e6..3486ad48c 100644
--- a/pandoc.cabal
+++ b/pandoc.cabal
@@ -40,44 +40,45 @@ Description: Pandoc is a Haskell library for converting from one markup
only adding a reader or writer.
Data-Files:
-- templates
- data/templates/default.html,
- data/templates/default.html5,
- data/templates/default.docbook,
- data/templates/default.beamer,
- data/templates/default.opendocument,
- data/templates/default.icml,
- data/templates/default.opml,
- data/templates/default.latex,
- data/templates/default.context,
- data/templates/default.texinfo,
- data/templates/default.man,
- data/templates/default.markdown,
- data/templates/default.rst,
- data/templates/default.plain,
- data/templates/default.mediawiki,
- data/templates/default.rtf,
- data/templates/default.s5,
- data/templates/default.slidy,
- data/templates/default.slideous,
- data/templates/default.revealjs,
- data/templates/default.dzslides,
- data/templates/default.asciidoc,
- data/templates/default.haddock,
- data/templates/default.textile,
- data/templates/default.org,
- data/templates/default.epub,
- data/templates/default.epub3,
+ data/templates/default.html
+ data/templates/default.html5
+ data/templates/default.docbook
+ data/templates/default.beamer
+ data/templates/default.opendocument
+ data/templates/default.icml
+ data/templates/default.opml
+ data/templates/default.latex
+ data/templates/default.context
+ data/templates/default.texinfo
+ data/templates/default.man
+ data/templates/default.markdown
+ data/templates/default.rst
+ data/templates/default.plain
+ data/templates/default.mediawiki
+ data/templates/default.dokuwiki
+ data/templates/default.rtf
+ data/templates/default.s5
+ data/templates/default.slidy
+ data/templates/default.slideous
+ data/templates/default.revealjs
+ data/templates/default.dzslides
+ data/templates/default.asciidoc
+ data/templates/default.haddock
+ data/templates/default.textile
+ data/templates/default.org
+ data/templates/default.epub
+ data/templates/default.epub3
-- data for ODT writer
- data/reference.odt,
+ data/reference.odt
-- data for docx writer
- data/reference.docx,
+ data/reference.docx
-- stylesheet for EPUB writer
- data/epub.css,
+ data/epub.css
-- data for LaTeXMathML writer
- data/LaTeXMathML.js,
- data/MathMLinHTML.js,
+ data/LaTeXMathML.js
+ data/MathMLinHTML.js
-- data for dzslides writer
- data/dzslides/template.html,
+ data/dzslides/template.html
-- sample lua custom writer
data/sample.lua
-- documentation
@@ -86,119 +87,94 @@ Extra-Source-Files:
-- documentation
INSTALL, BUGS, CONTRIBUTING.md, changelog
-- code to create pandoc.1 man page
- man/man1/pandoc.1.template,
- man/man5/pandoc_markdown.5.template,
+ Makefile
+ man/man1/pandoc.1.template
+ man/man5/pandoc_markdown.5.template
-- generated man pages (produced post-build)
- man/man1/pandoc.1,
- man/man5/pandoc_markdown.5,
+ man/man1/pandoc.1
+ man/man5/pandoc_markdown.5
-- tests
- tests/bodybg.gif,
+ tests/bodybg.gif
+ tests/*.native
tests/docbook-reader.docbook
- tests/html-reader.html,
- tests/opml-reader.opml,
- tests/haddock-reader.haddock,
- tests/insert,
- tests/lalune.jpg,
- tests/movie.jpg,
- tests/latex-reader.latex,
- tests/textile-reader.textile,
- tests/markdown-reader-more.txt,
- tests/markdown-citations.txt,
- tests/textile-reader.textile,
- tests/mediawiki-reader.wiki,
- tests/rst-reader.rst,
- tests/s5.basic.html,
- tests/s5.fancy.html,
- tests/s5.fragment.html,
- tests/s5.inserts.html,
- tests/tables.context,
- tests/tables.docbook,
- tests/tables.html,
- tests/tables.latex,
- tests/tables.man,
- tests/tables.plain,
- tests/tables.markdown,
- tests/tables.mediawiki,
- tests/tables.textile,
- tests/tables.opendocument,
- tests/tables.org,
- tests/tables.asciidoc,
- tests/tables.haddock,
- tests/tables.texinfo,
- tests/tables.rst,
- tests/tables.rtf,
- tests/tables.txt,
- tests/tables.fb2,
- tests/testsuite.txt,
- tests/writer.latex,
- tests/writer.context,
- tests/writer.docbook,
- tests/writer.html,
- tests/writer.man,
- tests/writer.markdown,
- tests/writer.plain,
- tests/writer.mediawiki,
- tests/writer.textile,
- tests/writer.opendocument,
- tests/writer.org,
- tests/writer.asciidoc,
- tests/writer.haddock,
- tests/writer.rst,
- tests/writer.rtf,
- tests/writer.texinfo,
- tests/writer.fb2,
- tests/writer.opml,
- tests/lhs-test.markdown,
- tests/lhs-test.markdown+lhs,
- tests/lhs-test.rst,
- tests/lhs-test.rst+lhs,
- tests/lhs-test.latex,
- tests/lhs-test.latex+lhs,
- tests/lhs-test.html,
- tests/lhs-test.html+lhs,
- tests/lhs-test.fragment.html+lhs,
- tests/pipe-tables.txt,
- tests/*.epub
- tests/fb2.basic.markdown,
- tests/fb2.basic.fb2,
- tests/fb2.titles.markdown,
- tests/fb2.titles.fb2,
- tests/fb2.images.markdown,
- tests/fb2.images.fb2,
- tests/fb2.images-embedded.html,
- tests/fb2.images-embedded.fb2,
- tests/fb2.math.markdown,
- tests/fb2.math.fb2,
- tests/fb2.test-small.png,
- tests/fb2.test.jpg,
- tests/docx.already_auto_ident.docx,
- tests/docx.block_quotes.docx,
- tests/docx.codeblock.docx,
- tests/docx.deep_normalize.docx,
- tests/docx.definition_list.docx,
- tests/docx.drop_cap.docx,
- tests/docx.hanging_indent.docx,
- tests/docx.headers.docx,
- tests/docx.image.docx,
- tests/docx.inline_images.docx,
- tests/docx.inline_code.docx,
- tests/docx.inline_formatting.docx,
- tests/docx.links.docx,
- tests/docx.lists.docx,
- tests/docx.metadata.docx,
- tests/docx.metadata_after_normal.docx,
- tests/docx.normalize.docx,
- tests/docx.notes.docx,
- tests/docx.tables.docx,
- tests/docx.tabs.docx,
- tests/docx.track_changes_deletion.docx,
- tests/docx.track_changes_insertion.docx,
- tests/docx.trailing_spaces_in_formatting.docx,
- tests/docx.unicode.docx,
- tests/*.native,
+ tests/html-reader.html
+ tests/opml-reader.opml
+ tests/haddock-reader.haddock
+ tests/insert
+ tests/lalune.jpg
+ tests/movie.jpg
+ tests/latex-reader.latex
+ tests/textile-reader.textile
+ tests/markdown-reader-more.txt
+ tests/markdown-citations.txt
+ tests/textile-reader.textile
+ tests/mediawiki-reader.wiki
+ tests/rst-reader.rst
+ tests/s5-basic.html
+ tests/s5-fancy.html
+ tests/s5-fragment.html
+ tests/s5-inserts.html
+ tests/tables.context
+ tests/tables.docbook
+ tests/tables.html
+ tests/tables.latex
+ tests/tables.man
+ tests/tables.plain
+ tests/tables.markdown
+ tests/tables.mediawiki
+ tests/tables.textile
+ tests/tables.opendocument
+ tests/tables.org
+ tests/tables.asciidoc
+ tests/tables.haddock
+ tests/tables.texinfo
+ tests/tables.rst
+ tests/tables.rtf
+ tests/tables.txt
+ tests/tables.fb2
+ tests/testsuite.txt
+ tests/writer.latex
+ tests/writer.context
+ tests/writer.docbook
+ tests/writer.html
+ tests/writer.man
+ tests/writer.markdown
+ tests/writer.plain
+ tests/writer.mediawiki
+ tests/writer.textile
+ tests/writer.opendocument
+ tests/writer.org
+ tests/writer.asciidoc
+ tests/writer.haddock
+ tests/writer.rst
+ tests/writer.icml
+ tests/writer.rtf
+ tests/writer.texinfo
+ tests/writer.fb2
+ tests/writer.opml
+ tests/writer.dokuwiki
+ tests/dokuwiki_inline_formatting.dokuwiki
+ tests/lhs-test.markdown
+ tests/lhs-test.markdown+lhs
+ tests/lhs-test.rst
+ tests/lhs-test.rst+lhs
+ tests/lhs-test.latex
+ tests/lhs-test.latex+lhs
+ tests/lhs-test.html
+ tests/lhs-test.html+lhs
+ tests/lhs-test.fragment.html+lhs
+ tests/pipe-tables.txt
+ tests/fb2/*.markdown
+ tests/fb2/*.fb2
+ tests/fb2/images-embedded.html
+ tests/fb2/images-embedded.fb2
+ tests/fb2/test-small.png
+ tests/fb2/test.jpg
+ tests/docx/*.docx
+ tests/docx/*.native
+ tests/epub/*.epub
+ tests/epub/*.native
tests/txt2tags.t2t
-Extra-Tmp-Files: man/man1/pandoc.1,
- man/man5/pandoc_markdown.5
Source-repository head
type: git
@@ -212,6 +188,10 @@ Flag https
Description: Enable support for downloading of resources over https.
Default: True
+Flag make-pandoc-man-pages
+ Description: Build program to regenerate pandoc man pages from README.
+ Default: False
+
Library
Build-Depends: base >= 4.2 && <5,
syb >= 0.1 && < 0.5,
@@ -383,6 +363,10 @@ Executable make-pandoc-man-pages
old-time >= 1.0 && < 1.2,
time >= 1.2 && < 1.5
Default-Language: Haskell98
+ if flag(make-pandoc-man-pages)
+ Buildable: True
+ else
+ Buildable: False
Test-Suite test-pandoc
Type: exitcode-stdio-1.0
@@ -422,6 +406,7 @@ Test-Suite test-pandoc
Tests.Readers.EPUB
Tests.Writers.Native
Tests.Writers.ConTeXt
+ Tests.Writers.Docbook
Tests.Writers.HTML
Tests.Writers.Markdown
Tests.Writers.Plain
diff --git a/src/Text/Pandoc/Shared.hs b/src/Text/Pandoc/Shared.hs
index a91ca9115..3adf2a1f6 100644
--- a/src/Text/Pandoc/Shared.hs
+++ b/src/Text/Pandoc/Shared.hs
@@ -129,7 +129,6 @@ import qualified Data.Text as T (toUpper, pack, unpack)
#ifdef EMBED_DATA_FILES
import Text.Pandoc.Data (dataFiles)
-import System.FilePath ( joinPath, splitDirectories )
#else
import Paths_pandoc (getDataFileName)
#endif
@@ -858,15 +857,13 @@ warn msg = do
-- | Remove intermediate "." and ".." directories from a path.
--
--- @
--- collapseFilePath "./foo" == "foo"
--- collapseFilePath "/bar/../baz" == "/baz"
--- collapseFilePath "/../baz" == "/../baz"
--- collapseFilePath "parent/foo/baz/../bar" == "parent/foo/bar"
--- collapseFilePath "parent/foo/baz/../../bar" == "parent/bar"
--- collapseFilePath "parent/foo/.." == "parent"
--- collapseFilePath "/parent/foo/../../bar" == "/bar"
--- @
+-- > collapseFilePath "./foo" == "foo"
+-- > collapseFilePath "/bar/../baz" == "/baz"
+-- > collapseFilePath "/../baz" == "/../baz"
+-- > collapseFilePath "parent/foo/baz/../bar" == "parent/foo/bar"
+-- > collapseFilePath "parent/foo/baz/../../bar" == "parent/bar"
+-- > collapseFilePath "parent/foo/.." == "parent"
+-- > collapseFilePath "/parent/foo/../../bar" == "/bar"
collapseFilePath :: FilePath -> FilePath
collapseFilePath = joinPath . reverse . foldl go [] . splitDirectories
where
diff --git a/tests/Tests/Old.hs b/tests/Tests/Old.hs
index 8ecbdbbba..300430e79 100644
--- a/tests/Tests/Old.hs
+++ b/tests/Tests/Old.hs
@@ -6,7 +6,7 @@ import Test.HUnit ( assertBool )
import System.Environment.Executable (getExecutablePath)
import System.IO ( openTempFile, stderr )
import System.Process ( runProcess, waitForProcess )
-import System.FilePath ( (</>), (<.>), takeDirectory )
+import System.FilePath ( (</>), (<.>), takeDirectory, splitDirectories, joinPath )
import System.Directory
import System.Exit
import Data.Algorithm.Diff
@@ -111,12 +111,12 @@ tests = [ testGroup "markdown"
"testsuite.native" "testsuite.native"
]
, testGroup "fb2"
- [ fb2WriterTest "basic" [] "fb2.basic.markdown" "fb2.basic.fb2"
- , fb2WriterTest "titles" [] "fb2.titles.markdown" "fb2.titles.fb2"
- , fb2WriterTest "images" [] "fb2.images.markdown" "fb2.images.fb2"
- , fb2WriterTest "images-embedded" [] "fb2.images-embedded.html" "fb2.images-embedded.fb2"
+ [ fb2WriterTest "basic" [] "fb2/basic.markdown" "fb2/basic.fb2"
+ , fb2WriterTest "titles" [] "fb2/titles.markdown" "fb2/titles.fb2"
+ , fb2WriterTest "images" [] "fb2/images.markdown" "fb2/images.fb2"
+ , fb2WriterTest "images-embedded" [] "fb2/images-embedded.html" "fb2/images-embedded.fb2"
+ , fb2WriterTest "math" [] "fb2/math.markdown" "fb2/math.fb2"
, fb2WriterTest "tables" [] "tables.native" "tables.fb2"
- , fb2WriterTest "math" [] "fb2.math.markdown" "fb2.math.fb2"
, fb2WriterTest "testsuite" [] "testsuite.native" "writer.fb2"
]
, testGroup "mediawiki"
@@ -126,10 +126,8 @@ tests = [ testGroup "markdown"
]
, testGroup "dokuwiki"
[ testGroup "writer" $ writerTests "dokuwiki"
- , test "writer-more" ["-r", "native", "-w", "dokuwiki", "-s"]
- "dokuwiki-writer.native" "dokuwiki-writer.dokuwiki"
- , test "writer-inline_formatting" ["-r", "native", "-w", "dokuwiki", "-s"]
- "dokuwiki.inline_formatting.native" "dokuwiki.inline_formatting.dokuwiki"
+ , test "inline_formatting" ["-r", "native", "-w", "dokuwiki", "-s"]
+ "dokuwiki_inline_formatting.native" "dokuwiki_inline_formatting.dokuwiki"
]
, testGroup "opml"
[ test "basic" ["-r", "native", "-w", "opml", "--columns=78", "-s"]
@@ -147,11 +145,11 @@ tests = [ testGroup "markdown"
"txt2tags.t2t" "txt2tags.native" ]
, testGroup "epub" [
test "features" ["-r", "epub", "-w", "native"]
- "epub.features.epub" "epub.features.native"
+ "epub/features.epub" "epub/features.native"
, test "wasteland" ["-r", "epub", "-w", "native"]
- "epub.wasteland.epub" "epub.wasteland.native"
+ "epub/wasteland.epub" "epub/wasteland.native"
, test "formatting" ["-r", "epub", "-w", "native"]
- "epub.formatting.epub" "epub.formatting.native"
+ "epub/formatting.epub" "epub/formatting.native"
]
, testGroup "other writers" $ map (\f -> testGroup f $ writerTests f)
[ "opendocument" , "context" , "texinfo", "icml"
@@ -194,7 +192,7 @@ s5WriterTest :: String -> [String] -> String -> Test
s5WriterTest modifier opts format
= test (format ++ " writer (" ++ modifier ++ ")")
(["-r", "native", "-w", format] ++ opts)
- "s5.native" ("s5." ++ modifier <.> "html")
+ "s5.native" ("s5-" ++ modifier <.> "html")
fb2WriterTest :: String -> [String] -> String -> String -> Test
fb2WriterTest title opts inputfile normfile =
@@ -234,7 +232,9 @@ testWithNormalize normalizer testname opts inp norm = testCase testname $ do
found <- doesFileExist (testExeDir </> "pandoc")
return $ if found
then testExeDir </> "pandoc"
- else testExeDir </> ".." </> "pandoc" </> "pandoc"
+ else case splitDirectories testExeDir of
+ [] -> error "test-pandoc: empty testExeDir"
+ xs -> joinPath (init xs) </> "pandoc" </> "pandoc"
(outputPath, hOut) <- openTempFile "" "pandoc-test"
let inpPath = inp
let normPath = norm
diff --git a/tests/Tests/Readers/Docx.hs b/tests/Tests/Readers/Docx.hs
index 65fdd4a55..0e0f6c2c5 100644
--- a/tests/Tests/Readers/Docx.hs
+++ b/tests/Tests/Readers/Docx.hs
@@ -100,135 +100,135 @@ tests :: [Test]
tests = [ testGroup "inlines"
[ testCompare
"font formatting"
- "docx.inline_formatting.docx"
- "docx.inline_formatting.native"
+ "docx/inline_formatting.docx"
+ "docx/inline_formatting.native"
, testCompare
"hyperlinks"
- "docx.links.docx"
- "docx.links.native"
+ "docx/links.docx"
+ "docx/links.native"
, testCompare
"inline image"
- "docx.image.docx"
- "docx.image_no_embed.native"
+ "docx/image.docx"
+ "docx/image_no_embed.native"
, testCompare
"inline image in links"
- "docx.inline_images.docx"
- "docx.inline_images.native"
+ "docx/inline_images.docx"
+ "docx/inline_images.native"
, testCompare
"handling unicode input"
- "docx.unicode.docx"
- "docx.unicode.native"
+ "docx/unicode.docx"
+ "docx/unicode.native"
, testCompare
"literal tabs"
- "docx.tabs.docx"
- "docx.tabs.native"
+ "docx/tabs.docx"
+ "docx/tabs.native"
, testCompare
"normalizing inlines"
- "docx.normalize.docx"
- "docx.normalize.native"
+ "docx/normalize.docx"
+ "docx/normalize.native"
, testCompare
"normalizing inlines deep inside blocks"
- "docx.deep_normalize.docx"
- "docx.deep_normalize.native"
+ "docx/deep_normalize.docx"
+ "docx/deep_normalize.native"
, testCompare
"move trailing spaces outside of formatting"
- "docx.trailing_spaces_in_formatting.docx"
- "docx.trailing_spaces_in_formatting.native"
+ "docx/trailing_spaces_in_formatting.docx"
+ "docx/trailing_spaces_in_formatting.native"
, testCompare
"inline code (with VerbatimChar style)"
- "docx.inline_code.docx"
- "docx.inline_code.native"
+ "docx/inline_code.docx"
+ "docx/inline_code.native"
]
, testGroup "blocks"
[ testCompare
"headers"
- "docx.headers.docx"
- "docx.headers.native"
+ "docx/headers.docx"
+ "docx/headers.native"
, testCompare
"headers already having auto identifiers"
- "docx.already_auto_ident.docx"
- "docx.already_auto_ident.native"
+ "docx/already_auto_ident.docx"
+ "docx/already_auto_ident.native"
, testCompare
"lists"
- "docx.lists.docx"
- "docx.lists.native"
+ "docx/lists.docx"
+ "docx/lists.native"
, testCompare
"definition lists"
- "docx.definition_list.docx"
- "docx.definition_list.native"
+ "docx/definition_list.docx"
+ "docx/definition_list.native"
, testCompare
"footnotes and endnotes"
- "docx.notes.docx"
- "docx.notes.native"
+ "docx/notes.docx"
+ "docx/notes.native"
, testCompare
"blockquotes (parsing indent as blockquote)"
- "docx.block_quotes.docx"
- "docx.block_quotes_parse_indent.native"
+ "docx/block_quotes.docx"
+ "docx/block_quotes_parse_indent.native"
, testCompare
"hanging indents"
- "docx.hanging_indent.docx"
- "docx.hanging_indent.native"
+ "docx/hanging_indent.docx"
+ "docx/hanging_indent.native"
, testCompare
"tables"
- "docx.tables.docx"
- "docx.tables.native"
+ "docx/tables.docx"
+ "docx/tables.native"
, testCompare
"code block"
- "docx.codeblock.docx"
- "docx.codeblock.native"
+ "docx/codeblock.docx"
+ "docx/codeblock.native"
, testCompare
"dropcap paragraphs"
- "docx.drop_cap.docx"
- "docx.drop_cap.native"
+ "docx/drop_cap.docx"
+ "docx/drop_cap.native"
]
, testGroup "track changes"
[ testCompare
"insertion (default)"
- "docx.track_changes_insertion.docx"
- "docx.track_changes_insertion_accept.native"
+ "docx/track_changes_insertion.docx"
+ "docx/track_changes_insertion_accept.native"
, testCompareWithOpts def{readerTrackChanges=AcceptChanges}
"insert insertion (accept)"
- "docx.track_changes_insertion.docx"
- "docx.track_changes_insertion_accept.native"
+ "docx/track_changes_insertion.docx"
+ "docx/track_changes_insertion_accept.native"
, testCompareWithOpts def{readerTrackChanges=RejectChanges}
"remove insertion (reject)"
- "docx.track_changes_insertion.docx"
- "docx.track_changes_insertion_reject.native"
+ "docx/track_changes_insertion.docx"
+ "docx/track_changes_insertion_reject.native"
, testCompare
"deletion (default)"
- "docx.track_changes_deletion.docx"
- "docx.track_changes_deletion_accept.native"
+ "docx/track_changes_deletion.docx"
+ "docx/track_changes_deletion_accept.native"
, testCompareWithOpts def{readerTrackChanges=AcceptChanges}
"remove deletion (accept)"
- "docx.track_changes_deletion.docx"
- "docx.track_changes_deletion_accept.native"
+ "docx/track_changes_deletion.docx"
+ "docx/track_changes_deletion_accept.native"
, testCompareWithOpts def{readerTrackChanges=RejectChanges}
"insert deletion (reject)"
- "docx.track_changes_deletion.docx"
- "docx.track_changes_deletion_reject.native"
+ "docx/track_changes_deletion.docx"
+ "docx/track_changes_deletion_reject.native"
, testCompareWithOpts def{readerTrackChanges=AllChanges}
"keep insertion (all)"
- "docx.track_changes_deletion.docx"
- "docx.track_changes_deletion_all.native"
+ "docx/track_changes_deletion.docx"
+ "docx/track_changes_deletion_all.native"
, testCompareWithOpts def{readerTrackChanges=AllChanges}
"keep deletion (all)"
- "docx.track_changes_deletion.docx"
- "docx.track_changes_deletion_all.native"
+ "docx/track_changes_deletion.docx"
+ "docx/track_changes_deletion_all.native"
]
, testGroup "media"
[ testMediaBag
"image extraction"
- "docx.image.docx"
+ "docx/image.docx"
]
, testGroup "metadata"
[ testCompareWithOpts def{readerStandalone=True}
"metadata fields"
- "docx.metadata.docx"
- "docx.metadata.native"
+ "docx/metadata.docx"
+ "docx/metadata.native"
, testCompareWithOpts def{readerStandalone=True}
"stop recording metadata with normal text"
- "docx.metadata_after_normal.docx"
- "docx.metadata_after_normal.native"
+ "docx/metadata_after_normal.docx"
+ "docx/metadata_after_normal.native"
]
]
diff --git a/tests/Tests/Readers/EPUB.hs b/tests/Tests/Readers/EPUB.hs
index 01b68082b..f27ea979f 100644
--- a/tests/Tests/Readers/EPUB.hs
+++ b/tests/Tests/Readers/EPUB.hs
@@ -28,6 +28,6 @@ tests :: [Test]
tests =
[ testGroup "EPUB Mediabag"
[ testCase "features bag"
- (testMediaBag "epub.features.epub" featuresBag)
+ (testMediaBag "epub/features.epub" featuresBag)
]
]
diff --git a/tests/docx.already_auto_ident.docx b/tests/docx/already_auto_ident.docx
index ec2b348d7..ec2b348d7 100644
--- a/tests/docx.already_auto_ident.docx
+++ b/tests/docx/already_auto_ident.docx
Binary files differ
diff --git a/tests/docx.already_auto_ident.native b/tests/docx/already_auto_ident.native
index 054bfe34a..054bfe34a 100644
--- a/tests/docx.already_auto_ident.native
+++ b/tests/docx/already_auto_ident.native
diff --git a/tests/docx.block_quotes.docx b/tests/docx/block_quotes.docx
index 729ae1f43..729ae1f43 100644
--- a/tests/docx.block_quotes.docx
+++ b/tests/docx/block_quotes.docx
Binary files differ
diff --git a/tests/docx.block_quotes_parse_indent.native b/tests/docx/block_quotes_parse_indent.native
index 842b3606a..842b3606a 100644
--- a/tests/docx.block_quotes_parse_indent.native
+++ b/tests/docx/block_quotes_parse_indent.native
diff --git a/tests/docx.codeblock.docx b/tests/docx/codeblock.docx
index 8ec00953c..8ec00953c 100644
--- a/tests/docx.codeblock.docx
+++ b/tests/docx/codeblock.docx
Binary files differ
diff --git a/tests/docx.codeblock.native b/tests/docx/codeblock.native
index 441e33511..441e33511 100644
--- a/tests/docx.codeblock.native
+++ b/tests/docx/codeblock.native
diff --git a/tests/docx.deep_normalize.docx b/tests/docx/deep_normalize.docx
index 7626d59ce..7626d59ce 100644
--- a/tests/docx.deep_normalize.docx
+++ b/tests/docx/deep_normalize.docx
Binary files differ
diff --git a/tests/docx.deep_normalize.native b/tests/docx/deep_normalize.native
index 9b2089ec8..9b2089ec8 100644
--- a/tests/docx.deep_normalize.native
+++ b/tests/docx/deep_normalize.native
diff --git a/tests/docx.definition_list.docx b/tests/docx/definition_list.docx
index a19edda45..a19edda45 100644
--- a/tests/docx.definition_list.docx
+++ b/tests/docx/definition_list.docx
Binary files differ
diff --git a/tests/docx.definition_list.native b/tests/docx/definition_list.native
index 2e08ff1ac..2e08ff1ac 100644
--- a/tests/docx.definition_list.native
+++ b/tests/docx/definition_list.native
diff --git a/tests/docx.drop_cap.docx b/tests/docx/drop_cap.docx
index 19fab4a52..19fab4a52 100644
--- a/tests/docx.drop_cap.docx
+++ b/tests/docx/drop_cap.docx
Binary files differ
diff --git a/tests/docx.drop_cap.native b/tests/docx/drop_cap.native
index d361cfb0b..d361cfb0b 100644
--- a/tests/docx.drop_cap.native
+++ b/tests/docx/drop_cap.native
diff --git a/tests/docx.hanging_indent.docx b/tests/docx/hanging_indent.docx
index 6f62dc731..6f62dc731 100644
--- a/tests/docx.hanging_indent.docx
+++ b/tests/docx/hanging_indent.docx
Binary files differ
diff --git a/tests/docx.hanging_indent.native b/tests/docx/hanging_indent.native
index 138a6967f..138a6967f 100644
--- a/tests/docx.hanging_indent.native
+++ b/tests/docx/hanging_indent.native
diff --git a/tests/docx.headers.docx b/tests/docx/headers.docx
index 630b6bfc5..630b6bfc5 100644
--- a/tests/docx.headers.docx
+++ b/tests/docx/headers.docx
Binary files differ
diff --git a/tests/docx.headers.native b/tests/docx/headers.native
index 03f967728..03f967728 100644
--- a/tests/docx.headers.native
+++ b/tests/docx/headers.native
diff --git a/tests/docx.image.docx b/tests/docx/image.docx
index 06e4efd1a..06e4efd1a 100644
--- a/tests/docx.image.docx
+++ b/tests/docx/image.docx
Binary files differ
diff --git a/tests/docx.image_no_embed.native b/tests/docx/image_no_embed.native
index 95c73610e..95c73610e 100644
--- a/tests/docx.image_no_embed.native
+++ b/tests/docx/image_no_embed.native
diff --git a/tests/docx.inline_code.docx b/tests/docx/inline_code.docx
index 75c5ea3cb..75c5ea3cb 100644
--- a/tests/docx.inline_code.docx
+++ b/tests/docx/inline_code.docx
Binary files differ
diff --git a/tests/docx.inline_code.native b/tests/docx/inline_code.native
index 11cf2777c..11cf2777c 100644
--- a/tests/docx.inline_code.native
+++ b/tests/docx/inline_code.native
diff --git a/tests/docx.inline_formatting.docx b/tests/docx/inline_formatting.docx
index eccf26425..eccf26425 100644
--- a/tests/docx.inline_formatting.docx
+++ b/tests/docx/inline_formatting.docx
Binary files differ
diff --git a/tests/docx.inline_formatting.native b/tests/docx/inline_formatting.native
index 22d8f79e8..22d8f79e8 100644
--- a/tests/docx.inline_formatting.native
+++ b/tests/docx/inline_formatting.native
diff --git a/tests/docx.inline_images.docx b/tests/docx/inline_images.docx
index 6288f66ff..6288f66ff 100644
--- a/tests/docx.inline_images.docx
+++ b/tests/docx/inline_images.docx
Binary files differ
diff --git a/tests/docx.inline_images.native b/tests/docx/inline_images.native
index f962f5c09..f962f5c09 100644
--- a/tests/docx.inline_images.native
+++ b/tests/docx/inline_images.native
diff --git a/tests/docx.links.docx b/tests/docx/links.docx
index 10ec62fd7..10ec62fd7 100644
--- a/tests/docx.links.docx
+++ b/tests/docx/links.docx
Binary files differ
diff --git a/tests/docx.links.native b/tests/docx/links.native
index c741fe875..c741fe875 100644
--- a/tests/docx.links.native
+++ b/tests/docx/links.native
diff --git a/tests/docx.lists.docx b/tests/docx/lists.docx
index bf7fd8ae4..bf7fd8ae4 100644
--- a/tests/docx.lists.docx
+++ b/tests/docx/lists.docx
Binary files differ
diff --git a/tests/docx.lists.native b/tests/docx/lists.native
index af922b335..af922b335 100644
--- a/tests/docx.lists.native
+++ b/tests/docx/lists.native
diff --git a/tests/docx.metadata.docx b/tests/docx/metadata.docx
index ccf50b475..ccf50b475 100644
--- a/tests/docx.metadata.docx
+++ b/tests/docx/metadata.docx
Binary files differ
diff --git a/tests/docx.metadata.native b/tests/docx/metadata.native
index ed7ba63cf..ed7ba63cf 100644
--- a/tests/docx.metadata.native
+++ b/tests/docx/metadata.native
diff --git a/tests/docx.metadata_after_normal.docx b/tests/docx/metadata_after_normal.docx
index b94a016cb..b94a016cb 100644
--- a/tests/docx.metadata_after_normal.docx
+++ b/tests/docx/metadata_after_normal.docx
Binary files differ
diff --git a/tests/docx.metadata_after_normal.native b/tests/docx/metadata_after_normal.native
index f0e31f8da..f0e31f8da 100644
--- a/tests/docx.metadata_after_normal.native
+++ b/tests/docx/metadata_after_normal.native
diff --git a/tests/docx.normalize.docx b/tests/docx/normalize.docx
index b4fc55818..b4fc55818 100644
--- a/tests/docx.normalize.docx
+++ b/tests/docx/normalize.docx
Binary files differ
diff --git a/tests/docx.normalize.native b/tests/docx/normalize.native
index aeba672c4..aeba672c4 100644
--- a/tests/docx.normalize.native
+++ b/tests/docx/normalize.native
diff --git a/tests/docx.notes.docx b/tests/docx/notes.docx
index eb6fa12d4..eb6fa12d4 100644
--- a/tests/docx.notes.docx
+++ b/tests/docx/notes.docx
Binary files differ
diff --git a/tests/docx.notes.native b/tests/docx/notes.native
index ec1b414b6..ec1b414b6 100644
--- a/tests/docx.notes.native
+++ b/tests/docx/notes.native
diff --git a/tests/docx.tables.docx b/tests/docx/tables.docx
index 7dcff8d35..7dcff8d35 100644
--- a/tests/docx.tables.docx
+++ b/tests/docx/tables.docx
Binary files differ
diff --git a/tests/docx.tables.native b/tests/docx/tables.native
index 2564afcec..2564afcec 100644
--- a/tests/docx.tables.native
+++ b/tests/docx/tables.native
diff --git a/tests/docx.tabs.docx b/tests/docx/tabs.docx
index 6ff5f4bb1..6ff5f4bb1 100644
--- a/tests/docx.tabs.docx
+++ b/tests/docx/tabs.docx
Binary files differ
diff --git a/tests/docx.tabs.native b/tests/docx/tabs.native
index 05461f20b..05461f20b 100644
--- a/tests/docx.tabs.native
+++ b/tests/docx/tabs.native
diff --git a/tests/docx.track_changes_deletion.docx b/tests/docx/track_changes_deletion.docx
index 5cfdbeed8..5cfdbeed8 100644
--- a/tests/docx.track_changes_deletion.docx
+++ b/tests/docx/track_changes_deletion.docx
Binary files differ
diff --git a/tests/docx.track_changes_deletion_accept.native b/tests/docx/track_changes_deletion_accept.native
index 205c67810..205c67810 100644
--- a/tests/docx.track_changes_deletion_accept.native
+++ b/tests/docx/track_changes_deletion_accept.native
diff --git a/tests/docx.track_changes_deletion_all.native b/tests/docx/track_changes_deletion_all.native
index 7f4ed2a90..7f4ed2a90 100644
--- a/tests/docx.track_changes_deletion_all.native
+++ b/tests/docx/track_changes_deletion_all.native
diff --git a/tests/docx.track_changes_deletion_reject.native b/tests/docx/track_changes_deletion_reject.native
index 04283bee5..04283bee5 100644
--- a/tests/docx.track_changes_deletion_reject.native
+++ b/tests/docx/track_changes_deletion_reject.native
diff --git a/tests/docx.track_changes_insertion.docx b/tests/docx/track_changes_insertion.docx
index fbdc9003e..fbdc9003e 100644
--- a/tests/docx.track_changes_insertion.docx
+++ b/tests/docx/track_changes_insertion.docx
Binary files differ
diff --git a/tests/docx.track_changes_insertion_accept.native b/tests/docx/track_changes_insertion_accept.native
index ca2e46df0..ca2e46df0 100644
--- a/tests/docx.track_changes_insertion_accept.native
+++ b/tests/docx/track_changes_insertion_accept.native
diff --git a/tests/docx.track_changes_insertion_all.native b/tests/docx/track_changes_insertion_all.native
index 12664e425..12664e425 100644
--- a/tests/docx.track_changes_insertion_all.native
+++ b/tests/docx/track_changes_insertion_all.native
diff --git a/tests/docx.track_changes_insertion_reject.native b/tests/docx/track_changes_insertion_reject.native
index def000abd..def000abd 100644
--- a/tests/docx.track_changes_insertion_reject.native
+++ b/tests/docx/track_changes_insertion_reject.native
diff --git a/tests/docx.trailing_spaces_in_formatting.docx b/tests/docx/trailing_spaces_in_formatting.docx
index ebe7404a9..ebe7404a9 100644
--- a/tests/docx.trailing_spaces_in_formatting.docx
+++ b/tests/docx/trailing_spaces_in_formatting.docx
Binary files differ
diff --git a/tests/docx.trailing_spaces_in_formatting.native b/tests/docx/trailing_spaces_in_formatting.native
index 46ea9bca8..46ea9bca8 100644
--- a/tests/docx.trailing_spaces_in_formatting.native
+++ b/tests/docx/trailing_spaces_in_formatting.native
diff --git a/tests/docx.unicode.docx b/tests/docx/unicode.docx
index cf902c6c6..cf902c6c6 100644
--- a/tests/docx.unicode.docx
+++ b/tests/docx/unicode.docx
Binary files differ
diff --git a/tests/docx.unicode.native b/tests/docx/unicode.native
index aee7ef74b..aee7ef74b 100644
--- a/tests/docx.unicode.native
+++ b/tests/docx/unicode.native
diff --git a/tests/dokuwiki-writer.dokuwiki b/tests/dokuwiki-writer.dokuwiki
deleted file mode 100644
index 6ddacc480..000000000
--- a/tests/dokuwiki-writer.dokuwiki
+++ /dev/null
@@ -1,3 +0,0 @@
-hello %%//%% world %%**%% from %%__%% me
-
-''%%hello // world ** from __ me%%''
diff --git a/tests/dokuwiki-writer.native b/tests/dokuwiki-writer.native
deleted file mode 100644
index fc24451bc..000000000
--- a/tests/dokuwiki-writer.native
+++ /dev/null
@@ -1,2 +0,0 @@
-[Para [Str "hello",Space,Str "//",Space,Str "world",Space,Str "**",Space,Str "from",Space,Str "__",Space,Str "me"]
-,Para [Code ("",[],[]) "hello // world ** from __ me"]]
diff --git a/tests/dokuwiki.inline_formatting.dokuwiki b/tests/dokuwiki_inline_formatting.dokuwiki
index e02596e6c..dd5cb52b4 100644
--- a/tests/dokuwiki.inline_formatting.dokuwiki
+++ b/tests/dokuwiki_inline_formatting.dokuwiki
@@ -7,3 +7,7 @@ Some people use single underlines for //emphasis//.
Above the line is <sup>superscript</sup> and below the line is <sub>subscript</sub>.
A line\\ break.
+
+hello %%//%% world %%**%% from %%__%% me
+
+''%%hello // world ** from __ me%%''
diff --git a/tests/dokuwiki.inline_formatting.native b/tests/dokuwiki_inline_formatting.native
index dc8a3d19a..63e85889f 100644
--- a/tests/dokuwiki.inline_formatting.native
+++ b/tests/dokuwiki_inline_formatting.native
@@ -2,4 +2,6 @@
,Para [Str "This",Space,Str "is",Space,SmallCaps [Str "Small",Space,Str "Caps"],Str ",",Space,Str "and",Space,Str "this",Space,Str "is",Space,Strikeout [Str "strikethrough"],Str "."]
,Para [Str "Some",Space,Str "people",Space,Str "use",Space,Span ("",[],[("underline","single")]) [Str "single",Space,Str "underlines",Space,Str "for",Space,Emph [Str "emphasis"]],Str "."]
,Para [Str "Above",Space,Str "the",Space,Str "line",Space,Str "is",Space,Superscript [Str "superscript"],Space,Str "and",Space,Str "below",Space,Str "the",Space,Str "line",Space,Str "is",Space,Subscript [Str "subscript"],Str "."]
-,Para [Str "A",Space,Str "line",LineBreak,Str "break."]]
+,Para [Str "A",Space,Str "line",LineBreak,Str "break."]
+,Para [Str "hello",Space,Str "//",Space,Str "world",Space,Str "**",Space,Str "from",Space,Str "__",Space,Str "me"]
+,Para [Code ("",[],[]) "hello // world ** from __ me"]]
diff --git a/tests/epub.features.epub b/tests/epub/features.epub
index 8dcae384b..8dcae384b 100644
--- a/tests/epub.features.epub
+++ b/tests/epub/features.epub
Binary files differ
diff --git a/tests/epub.features.native b/tests/epub/features.native
index f01070383..f01070383 100644
--- a/tests/epub.features.native
+++ b/tests/epub/features.native
diff --git a/tests/epub.formatting.epub b/tests/epub/formatting.epub
index f3f9b5b93..f3f9b5b93 100644
--- a/tests/epub.formatting.epub
+++ b/tests/epub/formatting.epub
Binary files differ
diff --git a/tests/epub.formatting.native b/tests/epub/formatting.native
index bdf86fa20..bdf86fa20 100644
--- a/tests/epub.formatting.native
+++ b/tests/epub/formatting.native
diff --git a/tests/epub.wasteland.epub b/tests/epub/wasteland.epub
index e4e52db7f..e4e52db7f 100644
--- a/tests/epub.wasteland.epub
+++ b/tests/epub/wasteland.epub
Binary files differ
diff --git a/tests/epub.wasteland.native b/tests/epub/wasteland.native
index 96418226e..96418226e 100644
--- a/tests/epub.wasteland.native
+++ b/tests/epub/wasteland.native
diff --git a/tests/fb2.basic.fb2 b/tests/fb2/basic.fb2
index 14b03fbea..14b03fbea 100644
--- a/tests/fb2.basic.fb2
+++ b/tests/fb2/basic.fb2
diff --git a/tests/fb2.basic.markdown b/tests/fb2/basic.markdown
index b798b13a4..b798b13a4 100644
--- a/tests/fb2.basic.markdown
+++ b/tests/fb2/basic.markdown
diff --git a/tests/fb2.images-embedded.fb2 b/tests/fb2/images-embedded.fb2
index 8c22efad3..8c22efad3 100644
--- a/tests/fb2.images-embedded.fb2
+++ b/tests/fb2/images-embedded.fb2
diff --git a/tests/fb2.images-embedded.html b/tests/fb2/images-embedded.html
index 19c8f7c7a..19c8f7c7a 100644
--- a/tests/fb2.images-embedded.html
+++ b/tests/fb2/images-embedded.html
diff --git a/tests/fb2.images.fb2 b/tests/fb2/images.fb2
index 8b783edf5..8b783edf5 100644
--- a/tests/fb2.images.fb2
+++ b/tests/fb2/images.fb2
diff --git a/tests/fb2.images.markdown b/tests/fb2/images.markdown
index 419be7c44..e7d3cc1e6 100644
--- a/tests/fb2.images.markdown
+++ b/tests/fb2/images.markdown
@@ -4,10 +4,10 @@ Small inline image: ![alt text a small PNG image][inline-image].
Paragraph image:
-![alt text of a big JPEG image](fb2.test.jpg "image title text")
+![alt text of a big JPEG image](fb2/test.jpg "image title text")
![alt text of a big missing image](missing.jpg)
A missing image inline: ![alt text of missing image](missing.jpg).
-[inline-image]: fb2.test-small.png
+[inline-image]: fb2/test-small.png
diff --git a/tests/fb2.math.fb2 b/tests/fb2/math.fb2
index 5a69556c1..5a69556c1 100644
--- a/tests/fb2.math.fb2
+++ b/tests/fb2/math.fb2
diff --git a/tests/fb2.math.markdown b/tests/fb2/math.markdown
index a88fb6cf1..a88fb6cf1 100644
--- a/tests/fb2.math.markdown
+++ b/tests/fb2/math.markdown
diff --git a/tests/fb2.test-small.png b/tests/fb2/test-small.png
index 16e177219..16e177219 100644
--- a/tests/fb2.test-small.png
+++ b/tests/fb2/test-small.png
Binary files differ
diff --git a/tests/fb2.test.jpg b/tests/fb2/test.jpg
index 99d57db17..99d57db17 100644
--- a/tests/fb2.test.jpg
+++ b/tests/fb2/test.jpg
Binary files differ
diff --git a/tests/fb2.titles.fb2 b/tests/fb2/titles.fb2
index d8fc1e424..d8fc1e424 100644
--- a/tests/fb2.titles.fb2
+++ b/tests/fb2/titles.fb2
diff --git a/tests/fb2.titles.markdown b/tests/fb2/titles.markdown
index cc3d0e0d0..cc3d0e0d0 100644
--- a/tests/fb2.titles.markdown
+++ b/tests/fb2/titles.markdown
diff --git a/tests/s5.basic.html b/tests/s5-basic.html
index ceb896b8e..ceb896b8e 100644
--- a/tests/s5.basic.html
+++ b/tests/s5-basic.html
diff --git a/tests/s5.fancy.html b/tests/s5-fancy.html
index 818cca04a..818cca04a 100644
--- a/tests/s5.fancy.html
+++ b/tests/s5-fancy.html
diff --git a/tests/s5.fragment.html b/tests/s5-fragment.html
index e8a888972..e8a888972 100644
--- a/tests/s5.fragment.html
+++ b/tests/s5-fragment.html
diff --git a/tests/s5.inserts.html b/tests/s5-inserts.html
index 455225f9b..455225f9b 100644
--- a/tests/s5.inserts.html
+++ b/tests/s5-inserts.html
diff --git a/tests/test-pandoc.hs b/tests/test-pandoc.hs
index 7e4f4732c..b7b1c30b1 100644
--- a/tests/test-pandoc.hs
+++ b/tests/test-pandoc.hs
@@ -23,6 +23,7 @@ import qualified Tests.Writers.AsciiDoc
import qualified Tests.Shared
import qualified Tests.Walk
import Text.Pandoc.Shared (inDirectory)
+import System.Environment (getArgs)
tests :: [Test]
tests = [ testGroup "Old" Tests.Old.tests
@@ -52,7 +53,5 @@ tests = [ testGroup "Old" Tests.Old.tests
main :: IO ()
main = do
setLocaleEncoding utf8
- -- we ignore command-line arguments, since we're having cabal pass
- -- the build directory as first argument, and we don't want test-framework
- -- to choke on that.
- inDirectory "tests" $ defaultMainWithArgs tests []
+ args <- getArgs
+ inDirectory "tests" $ defaultMainWithArgs tests args