Commit graph

88 commits

Author SHA1 Message Date
Albert Krewinkel
0d935bd081
Update copyright notices to include 2018 2018-01-05 20:39:12 +01:00
Kolen Cheung
0b09409385 update years in copyright 2017-10-26 22:57:13 -07:00
John MacFarlane
7daea9d8c1 Removed unused imports from Setup.hs. 2017-04-03 09:50:44 +02:00
John MacFarlane
ff991d1e21 Revert "Revert "Use file-embed instead of hsb2hs to embed data files.""
This reverts commit 1fa15c225b.
2017-04-02 23:10:10 +02:00
John MacFarlane
1fa15c225b Revert "Use file-embed instead of hsb2hs to embed data files."
This reverts commit 10d91c1479.
2017-03-26 20:48:17 +02:00
John MacFarlane
d0447151cf Revert "Setup.hs - removed unneeded imports."
This reverts commit 5354b44170.
2017-03-26 20:41:49 +02:00
John MacFarlane
5354b44170 Setup.hs - removed unneeded imports. 2017-03-26 17:27:14 +02:00
John MacFarlane
10d91c1479 Use file-embed instead of hsb2hs to embed data files.
I think template haskell is robust enough now across platforms
that this will work.

Motivation: file-embed gives us better dependency tracking:  if a data
file changes, ghc/stack/cabal know to recompile the Data module.

This also removes hsb2hs as a build dependency.
2017-03-26 17:22:00 +02:00
John MacFarlane
13ff73bc70 Setup.hs - removed some unneeded imports. 2016-10-18 15:11:05 +02:00
John MacFarlane
d62b1cf180 Setup.hs: rewrite so as not to use process, directory, filepath.
Using anything outside base is dangerous, since older
versions of ghc will link against two different versions.

See e.g.
- https://groups.google.com/forum/#!topic/pandoc-discuss/0r9Hhl730LY
- https://www.reddit.com/r/haskell/comments/3634x2/cabal_is_giving_a_weird_error_when_attempting_to/
- jaspervdj/hakyll#356
2015-10-09 21:50:20 -07:00
John MacFarlane
e042f697a4 Setup.hs: better version detection in older hsb2hs.
If it returns an error with input `--version`, recover
gracefully.
2015-07-06 13:38:46 -07:00
John MacFarlane
f1103f8f69 Make cabal require hsb2hs >= 0.3.1.
This is done by adding `hookedPrograms` in `Setup.hs`,
which allows us to include `hsb2hs` in Build-Tools in cabal.
2015-07-05 13:50:10 -07:00
John MacFarlane
8763ba188c Setup.hs: Don't require hsb2hs unless embed_data_files flag specified. 2015-07-03 17:07:44 -07:00
John MacFarlane
79764df2d5 Added pandoc.1 to repository. Don't build as part of cabal build.
The process was too fragile.  It made too many assumptions about
available libraries (which failed sometimes when sandboxes were
used).  This is a low-tech solution.  The only drawback is that
`man/pandoc.1` is a generated file in the repository.  It will need
to be regenerated periodically when README changes.
2015-07-02 22:12:38 -07:00
John MacFarlane
608fc273df Make copying of man pages respect --destdir.
Closes #2262.
2015-07-02 16:21:11 -07:00
John MacFarlane
d8cfc255bd Setup.hs: ensure target directory is created when installing man page. 2015-07-02 09:31:33 -07:00
John MacFarlane
9ffd1babc7 Install man pages as part of cabal 'copy' phase. 2015-07-01 18:01:21 -07:00
John MacFarlane
28cb50503b Generate man page in cabal build process and include in data/.
The pandoc.1 man page is generated automatically after the cabal
build process.  It goes in `data/pandoc.1`.  It can be obtained
by the user who installs pandoc via cabal thus:

    pandoc --print-default-data-file pandoc.1 > pandoc.1
2015-07-01 16:29:44 -07:00
John MacFarlane
fe625e053d New method for producing man pages.
This change adds `--man1` and `--man5` options to pandoc, so
pandoc can generate its own man pages.

It removes the old overly complex method of building a separate
executable (but not installing it) just to create the man pages.

The man pages are no longer automatically created in the build
process.

The man/ directory has been removed.  The man page templates
have been moved to data/.

New unexported module:  Text.Pandoc.ManPages.

Text.Pandoc.Data now exports readmeFile, and `readDataFile`
knows how to find README.

Closes #2190.
2015-06-28 14:39:17 -07:00
John MacFarlane
b241472a90 Better fix for #2187.
* Reverted kludgy change to make-windows-installer.bat.
* Removed make-reference-fiels.hs.
* Moved the individual ingredients of reference.docx and
  reference.odt to the data directory.
* Removed reference.docx and reference.odt from data directory.
* We now build the reference archives from their ingredient pieces
  in the docx and odt writers, instead of having a reference.docx
  or reference.odt intermediary.

This should fix #2187.

It also simplifies the bulid procedure.

The one thing users may notice is different is that you can
no longer get the reference.docx or reference.odt using
`--print-default-data-file`.  Instead, simply generate a
docx or odt using pandoc with a blank or minimal input,
and use that (or a customized version) with `--reference-docx`
or `--reference-odt`.
2015-05-28 18:15:01 -07:00
John MacFarlane
1868cb5e42 Updated copyright notices to -2015. Closes #2111. 2015-04-26 10:18:29 -07:00
John MacFarlane
3f20fb3f9f Always build man pages. Removed make-pandoc-man-pages flag.
Updated INSTALL instructions.

Makefile:  removed man target, now that we generate man pages by default.
2015-03-28 15:40:50 -07:00
Nikolay Yakimov
d744b83b61 Create reference files from unpacked archives with helper program 2015-03-28 10:36:53 -07:00
John MacFarlane
0492ab868b Setup.hs: ensure make-man-pages not installed in bindir. 2014-08-13 12:20:01 -07:00
John MacFarlane
fa71a08ed3 Simplified Setup.hs.
It no longer builds and installs man pages.

All it does is hook the hsb preprocessor.

This should make the build process more robust over Cabal API
changes.  We'll add a Makefile to generate man pages.
2014-08-13 10:18:46 -07:00
John MacFarlane
1d6e1cf9f3 Removed special testHook from Setup.
This was just too fragile and dependent on a changing Cabal API
(see #1526).

Instead of passing the bulid directory to the test program, we
now let the test program find itself (using executable-path)
and then find the pandoc executable relative to itself.
2014-08-13 08:12:07 -07:00
Michael Thompson
4c6aaec565 no need to hide 'catch'
This doesn't normally cause a problem because of some ghc workaround special to this case, but I was able to trigger an error with a complicated mixture of sandboxing, directing `cabal` to a locally installed ghc, and something else. `catch` isn't actually used in the file, so it seems it might as well go.
2014-05-17 13:48:31 -04:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
9d6bca06ee Pass the buildDir as first argument to test suite.
Allows test suite to work with cabal sandboxes.
Previously we hard-coded the build directory.
2013-10-20 12:36:26 -07:00
John MacFarlane
627c54011b Revert "Setup.hs: Better way of handling man page building."
This reverts commit ed061b91c8.
2013-10-08 20:52:56 -07:00
John MacFarlane
ed061b91c8 Setup.hs: Better way of handling man page building.
Previously we tried to remove make-pandoc-man-pages from the list
of packages to be haddocked, installed, copied, etc.

It works better to set 'Buildable: False' on make-pandoc-man-pages,
then have the buildHook temporarily set Buildable to True.  This
allows make-pandoc-man-pages to be built (and used in generating
the man pages), but not installed.
2013-10-06 18:04:18 -07:00
John MacFarlane
fe337b07f7 Use hsb2hs preprocessor instead of TH for embed_data_files.
This should work on Windows, unlike the TH solution with
file-embed.
2013-01-23 19:26:39 -08:00
Clint Adams
ff0061281f Use LBI buildDir instead of hardcoded "dist" </> "build". 2012-11-07 14:57:17 -05:00
John MacFarlane
b3ad94bde9 Moved man page creation out of Setup.hs.
* MakeManPage.hs has been transformed into
  man/make-pandoc-man-pages.hs.
* There is now a cabal stanza for this, so the dependencies are
  handled by cabal.
* Special treatment in Setup.hs ensures that this never gets installed;
  it is built and used to create the man pages.
* Setup.hs cleaned up.
2012-10-15 21:26:24 -07:00
John MacFarlane
b28630f577 Removed unneeded function from Setup.hs. 2012-10-15 19:53:57 -07:00
John MacFarlane
4cc3801fb0 Whitespace 2012-10-15 19:53:52 -07:00
Ben Gamari
a96982e701 Setup: getModificationTime returns UTCTime as of GHC 7.6 2012-09-21 15:43:26 -04:00
John MacFarlane
acbb4a5e46 Integrated test suite with cabal.
To run tests, configure with --enable-tests, then 'cabal test'.
You can specify particular tests using --test-options='-t markdown'.

No output is shown unless tests fail.  In the future, we can move
to the detailed-1.0 interface.
2012-07-26 09:43:27 -07:00
John MacFarlane
308436996e Use catch from Control.Exception to avoid warnings. 2012-07-24 19:38:16 -07:00
John MacFarlane
96274b2838 Fixed permissions on installed man pages.
Thanks to Magnus Therning for the patch.
2012-03-09 13:30:14 -08:00
John MacFarlane
1d615908c2 Removed markdown2pdf and documentation. 2012-01-20 21:22:51 -08:00
John MacFarlane
8bf890d7e4 Setup: Making man pages now works with cabal-dev.
In Setup.hs we now invoke 'runghc' in a way that points
it to the correct package databases, instead of always
falling back to the default user package db.

Thanks to Antoine Latter for the patch.
2011-12-19 22:09:08 -08:00
John MacFarlane
99677ac05d Setup.hs: Added a 5 second timeout for test cases. 2011-02-04 16:53:21 -08:00
John MacFarlane
f879b99ad1 Setup.hs: Don't call MakeManPage.hs unless the man pages need making. 2011-01-31 09:34:15 -08:00
John MacFarlane
8c435578d6 Refactored man pages.
* Markdown syntax description from README now goes in pandoc_markdown.5.
* Refactored man page construction functions, putting more of
  the work in MakeManPages.hs.
2011-01-28 12:02:26 -08:00
John MacFarlane
491eb00e40 Setup.hs: Only make pandoc.1 if README modified, be more verbose. 2011-01-16 09:27:54 -08:00
John MacFarlane
5da2d1e66c Merge branch 'master' into tests 2011-01-12 08:13:11 -08:00
John MacFarlane
eb1d014859 Improvements to test suite.
+ You can now specify glob patterns after 'cabal test';
  e.g. 'cabal test latex' will only run the latex tests.

+ Instead of detecting highlighting support in Setup.hs,
  we now detect it in test-pandoc, by looking to see if
  'languages' is null.

+ We now verify the lhs readers against the lhs-test.native,
  normalizing with 'normalize'.  This makes more sense than
  verifying against HTML, which also brings in the HTML writer.

+ Added lhsn-test.nohl.{html,html+lhs}, so we can do the lhs
  tests whether or not highlighting has been installed.
2011-01-12 11:35:10 +01:00
John MacFarlane
6b1407d209 Setup.hs: -Wall clean. 2011-01-11 20:34:49 -08:00
Nathan Gass
c0700987ba Changed test-pandoc to use test-framework and HUnit. 2011-01-10 00:37:46 +01:00