Commit graph

137 commits

Author SHA1 Message Date
John MacFarlane
536b6bf538 Implemented SoftBreak and new --wrap option.
Added threefold wrapping option.

* Command line option: deprecated `--no-wrap`, added
  `--wrap=[auto|none|preserve]`
* Added WrapOption, exported from Text.Pandoc.Options
* Changed type of writerWrapText in WriterOptions from
  Bool to WrapOption.
* Modified Text.Pandoc.Shared functions for SoftBreak.
* Supported SoftBreak in writers.
* Updated tests.
* Updated README.

Closes #1701.
2015-12-11 23:55:08 -08:00
John MacFarlane
f0670cccbb hlint refactorings. 2015-11-22 07:27:35 -08:00
John MacFarlane
244cd5644b Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into mb21-new-image-attributes
* Bumped version to 1.16.
* Added Attr field to Link and Image.
* Added `common_link_attributes` extension.
* Updated readers for link attributes.
* Updated writers for link attributes.
* Updated tests
* Updated stack.yaml to build against unreleased versions of
  pandoc-types and texmath.
* Fixed various compiler warnings.

Closes #261.

TODO:

* Relative (percentage) image widths in docx writer.
* ODT/OpenDocument writer (untested, same issue about percentage widths).
* Update pandoc-citeproc.
2015-11-19 23:14:23 -08:00
John MacFarlane
ed1173ace6 Rationalized behavior of --no-tex-ligatures and --smart.
This change makes `--no-tex-ligatures` affect the LaTeX reader
as well as the LaTeX and ConTeXt writers.  If it is used,
the LaTeX reader will parse characters `` ` ``, `'`, and `-`
literally, rather than parsing ligatures for quotation marks
and dashes.  And the LaTeX writer will print unicode quotation
mark and dash characters literally, rather than converting
them to the standard ASCII ligatures.

Note that `--smart` has no affect on the LaTeX reader.

`--smart` is still the default for all input formats when
LaTeX or ConTeXt is the output format, *unless* `--no-tex-ligatures`
is used.

Some examples to illustrate the logic:

```
% echo "'hi'" | pandoc -t latex
`hi'
% echo "'hi'" | pandoc -t latex --no-tex-ligatures
'hi'
% echo "'hi'" | pandoc -t latex --no-tex-ligatures --smart
‘hi’
% echo "'hi'" | pandoc -f latex --no-tex-ligatures
<p>'hi'</p>
% echo "'hi'" | pandoc -f latex
<p>’hi’</p>
```

Closes #2541.
2015-11-19 20:30:41 -08:00
Andrew Dunning
ec0a22746b Allow .adoc file extension for AsciiDoc.
`.adoc` is the extension recommended at <http://asciidoctor.org/docs/asciidoc-writers-guide/>.
2015-11-16 13:37:13 -05:00
John MacFarlane
e44149931e Improved implicit pandoc-citeproc inclusion.
The filter pandoc-citeproc is automatically used when
`--bibliography` is specified on the command line, unless
`--natbib` or `--biblatex` is used.

However, previously this only worked if `--bibliography`
was spelled out in full, and not if `--biblio` was used.
This patch fixes that problem.
2015-11-16 09:46:11 -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
8193ebcd99 Allow use of ConTeXt to generate PDFs.
pandoc my.md -t context -o my.pdf

will now create a PDF using ConTeXt rather than LaTeX.

Closes #2463.
2015-10-20 08:16:17 -07:00
John MacFarlane
82b3e0ab97 Use custom Prelude to avoid compiler warnings.
- The (non-exported) prelude is in prelude/Prelude.hs.
- It exports Monoid and Applicative, like base 4.8 prelude,
  but works with older base versions.
- It exports (<>) for mappend.
- It hides 'catch' on older base versions.

This allows us to remove many imports of Data.Monoid
and Control.Applicative, and remove Text.Pandoc.Compat.Monoid.

It should allow us to use -Wall again for ghc 7.10.
2015-10-14 09:09:10 -07:00
John MacFarlane
169cdf3fa2 Removed unneeded import. 2015-10-10 14:35:26 -07:00
Alex Vong
d7a19c22be Move the variable pandocVersion from src/Text/Pandoc.hs to
`src/Text/Pandoc/Shared.hs`, so that all Writers can access this variable
without importing `src/Text/Pandoc.hs`, preventing circular import.

* pandoc.hs: Import pandocVersion from `Text.Pandoc.Shared`.
* src/Text/Pandoc.hs: Remove the definition of pandocVersion
 and relevant import.
* src/Text/Pandoc/Shared.hs: Add the definition of pandocVersion
 and relevant import.
2015-10-01 02:24:34 +08:00
Emily Eisenberg
149f0f6a4b Update KaTeX JS and CSS versions.
Update the default KaTeX JS/CSS links to the current version. KaTeX v0.5.1 has far more functions and symbols than v0.1.0, so it seems like a better default. I think technically this might break compatibility because we released a breaking change due to the greediness of the `\color` function, but this probably has very little impact.
2015-09-26 21:15:13 -07:00
John MacFarlane
73824908aa Added --bash-completion option.
This generates a bash completion script.

To use:

     eval "$(pandoc --bash-completion)"
2015-08-13 15:27:47 -07:00
John MacFarlane
5df099957e Text.Pandoc.Options: modifications for image attributes.
* Added `Ext_common_link_attributes` constructor to `Extension`
  (for link and image attributes).
* Added this to `pandocExtensions` and `phpMarkdownExtraExtensions`.
* Added `writerDpi` to `WriterOptions`.
* pandoc.hs:  Added `--dpi` option.
* Updated README for `--dpi` and `common_link_attributes` extension.

Patch due to mb21, with some modifications: `writerDpi` is now an
`Int` rather than a `Double`.
2015-07-27 21:52:43 +02:00
MarLinn
f068093555 Added odt reader
Fully implemented features:

* Paragraphs
* Headers
* Basic styling
* Unordered lists
* Ordered lists
* External Links
* Internal Links
* Footnotes, Endnotes
* Blockquotes

Partly implemented features:

* Citations
  Very basic, but pandoc can't do much more
* Tables
  No headers, no sizing, limited styling
2015-07-23 15:37:01 -07:00
John MacFarlane
5f0b875565 Better error messages for filters:
- Inform user if filter requires an interpreter that isn't
  found in the path.
- Inform user if filter returns an error status.
2015-07-02 12:28:46 -07:00
John MacFarlane
a04c15a422 New method for building man pages.
+ Removed `--man1`, `--man5` options (breaking change).
+ Removed `Text.Pandoc.ManPages` module (breaking API change).
+ Version bump to 1.15 because of the breaking changes, even
  though they involve features that have only been in pandoc
  for a day.
+ Makefile target for `man/man1/pandoc.1`.  This uses pandoc to
  create the man page from README using a custom template and filters.
+ Added `man/` directory with template and filters needed to build
  man page.
+ We no longer have two man pages: pandoc.1 and pandoc_markdown.5.
  Now there is just pandoc.1, which has all the content from README.
  This change was needed because of the extensive cross-references
  between parts of the README.
+ Removed old `data/pandoc.1.template` and
  `data/pandoc_markdown.5.template`.
2015-07-01 11:27:15 -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
Pablo Rodríguez
c18e93ca6e replace old url with pandoc.org 2015-06-09 22:22:58 +02:00
John MacFarlane
dc0e5c34b7 Amends last commit: don't use https for google charts.
They don't have a certificate.
2015-06-09 12:37:35 -07:00
John MacFarlane
8c47bd63e8 Use https: for mathjax/katex/google-charts CDNs.
Closes #1920.
2015-06-09 12:19:06 -07:00
John MacFarlane
a131441da4 Only make implicit -F pandoc-citeproc when --bibliography option used.
Not when `bibliography` field in metadata is specified.

Closes #1849.
2015-05-11 21:31:03 -07:00
John MacFarlane
c6debff1f8 Removed references to biblio-files in pandoc.hs and README. 2015-05-11 21:19:15 -07:00
John MacFarlane
7920a1a469 Revert "EPUB writer: stylesheet changes. Closes #2040."
This reverts commit 1c2951dfd9.

See #2040.

The semantics was too squishy.  `--css` takes a URL, but
for EPUB we need files that we can read.  I prefer keeping
the old system for now, with `--epub-stylesheet`.
2015-05-09 00:07:27 -07:00
John MacFarlane
1c2951dfd9 EPUB writer: stylesheet changes. Closes #2040.
* Allow `--css` to be used to specify stylesheets.
* Deprecated `--epub-stylesheet` and made it a synoynym of
  `--css`.
* If a code block with class "css" is given as contents of the
  `stylesheet` metadata field, use its literal code as contents of
  the epub stylesheet.  Otherwise, treat it as a filename and
  read the file.
* Note: `--css` and `stylesheet` in metadata are not compatible.
  `stylesheet` takes precedence.
2015-05-08 23:47:50 -07:00
John MacFarlane
1868cb5e42 Updated copyright notices to -2015. Closes #2111. 2015-04-26 10:18:29 -07:00
John MacFarlane
6a3a04c428 Merge branch 'errortype' of https://github.com/mpickering/pandoc into mpickering-errortype
Conflicts:
	benchmark/benchmark-pandoc.hs
	src/Text/Pandoc/Readers/Markdown.hs
	src/Text/Pandoc/Readers/Org.hs
	src/Text/Pandoc/Readers/RST.hs
	tests/Tests/Readers/LaTeX.hs
2015-03-28 12:12:48 -07:00
John MacFarlane
62e802ae1e Merge pull request #1976 from wcaleb/json-help-message
Clarify JSON input and output in usage message
2015-03-07 10:08:13 -08:00
Sumit Sahrawat
ad9e4cde9d Fix issue #969, #1779 by providing --latex-engine-opt 2015-03-04 15:25:56 +05:30
Caleb McDaniel
6b6c9e8c66 Clarify JSON input and output in usage message 2015-02-27 11:29:33 -06:00
Matthew Pickering
70e0c4d41b Update executable file 2015-02-18 21:09:07 +00:00
Matthew Pickering
da93181d06 Better warning when trying to read multiple binary files 2015-01-19 02:44:04 +00:00
John MacFarlane
e3422dc438 Added --verbose flag for debugging output in PDF production.
Closes #1840.
Closes #1653.
2014-12-26 11:19:55 -07:00
John MacFarlane
88812c41ce Recognize .icml extension and use icml writer. See #1707. 2014-10-20 15:01:13 -07:00
John MacFarlane
6eda32871f Give better error messages when someone tries to convert pdf, doc, odt.
Closes #1683.
2014-10-19 16:59:59 -07:00
mpickering
515a120d04 Add support for KaTeX HTML math
Closes #1626
2014-09-25 18:32:42 +01:00
John MacFarlane
b9d524c703 Use protocol-relative URL for mathjax.
See jgm/pandoc-templates#67.
2014-08-31 11:18:43 -07:00
John MacFarlane
b36600092c Removed extra blank line after version. 2014-08-30 08:16:00 -07:00
John MacFarlane
58cbd20b1f Removed check for PATH variable in running filters.
This cause problems on Windows 8, where the variable is called
`Path`.

Instead, simply trap the exception that will be raised by
`findExecutable` if path is not set.

This should fix #1542.
2014-08-17 10:33:18 -07:00
John MacFarlane
482f7f8e15 pandoc: Don't strip path off of sourceURL.
We need this information for relative URLs!

This should resolve the continuing problem noted in #750.
2014-08-06 14:36:46 -07:00
John MacFarlane
2de2842bdd Merge pull request #1486 from Aelve/minor
Very minor cleanup and readability changes
2014-08-04 22:07:02 -07:00
Artyom Kazak
675b15458a Slightly fix readability of main program file. 2014-08-04 19:58:25 +04:00
John MacFarlane
4630cff2a6 Merge branch 'epubend' of https://github.com/mpickering/pandoc into mpickering-epubend
Conflicts:
	pandoc.cabal
2014-08-04 07:36:18 -07:00
John MacFarlane
ce8922437d Text.Pandoc.SelfContained changes.
* mkSelfContained now takes just two arguments, WriterOptions and
  the string.
* It no longer looks in data files.  This only made sense when we
  had copies of slidy and S5 code there.
* Shared.fetchItem' is used instead of the nearly duplicate getItem.
2014-08-02 16:07:19 -07:00
John MacFarlane
f075b0e5d9 pandoc.hs: More code reorganization. 2014-07-31 16:27:06 -07:00
Matthew Pickering
8460ea417f EPUB Reader: Integrated into program 2014-07-31 21:39:50 +01:00
John MacFarlane
0565a81676 pandoc.hs: Rewrote some of the logic for clarity. 2014-07-31 12:51:01 -07:00
John MacFarlane
6dd2418476 New module, Text.Pandoc.MediaBag.
Moved `MediaBag` definition and functions from Shared:
`lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`.
Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag`
is a Monoid.
2014-07-31 12:00:21 -07:00
John MacFarlane
00662faefb Made MediaBag a newtype, and added mime type information to media.
Shared now exports functions for interacting with a MediaBag:

- `emptyMediaBag`
- `lookuMedia`
- `insertMedia`
- `mediaDirectory`
- `extractMediaBag`
2014-07-31 11:05:35 -07:00