Commit graph

188 commits

Author SHA1 Message Date
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
5e57beac8d Re-export pandocVersions from Text.Pandoc.
The actual definition has been moved to Text.Pandoc.Shared,
but to avoid breaking changes we reexport it here.
2015-10-10 13:42:02 -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
Juliusz Gonera
f1c87ed164 Org reader: add auto identifiers if not present on headers
Refs #2354

This should also fix the table of contents (--toc) when generating a html file
from org input
2015-08-15 07:57:48 +02:00
John MacFarlane
06d69fe215 Text.Pandoc: disable auto_identifiers for epub.
The epub writer inserts its own auto identifiers;
this is more complex due to splitting into "chapter" files.
2015-08-08 21:05:43 -07:00
John MacFarlane
9deb335ca5 ICML writer: changed type of writeICML.
API change:  It is now `WriterOptions -> Pandoc -> IO String`.

Also handle new image attributes.

(mb21)
2015-08-05 16:08:46 +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
fce3ebb8e0 Plain writer: don't use symbols for super/subscript.
Simplified code by using plainExtensions from Options.

Closes #2237.
2015-06-27 20:19:04 -07:00
John MacFarlane
1868cb5e42 Updated copyright notices to -2015. Closes #2111. 2015-04-26 10:18:29 -07:00
John MacFarlane
ccb828894b Added CommonMark writer.
Added `Text.Pandoc.Writers.CommonMark`, exporting
`writeCommonMark`.
2015-03-29 23:42:42 -07:00
John MacFarlane
8c6ad05ad3 Updated code example in Text.Pandoc. 2015-03-28 13:37:18 -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
e0d234e54d Added CommonMark reader using cmark (libcmark bindings).
- Added commonmark as an input format.
- Added `Text.Pandoc.Readers.CommonMark.readCommonMark`.
- For now, we use the markdown writer to generate benchmark
  text for the CommonMark reader.  We can change this when we
  get a writer.
2015-03-17 16:15:57 -07:00
Matthew Pickering
ad39bc7009 Move utility error functions to Text.Pandoc.Shared 2015-02-18 21:09:07 +00:00
Matthew Pickering
be943a561f Update Pandoc.hs 2015-02-18 21:09:07 +00:00
Daniel Bergey
15816853a3 expose warnings from RST reader; refactor
This commit moves some code which was only used for the Markdown Reader
into a generic form which can be used for any Reader.  Otherwise, it
takes naming and interface cues from the preexisting Markdown code.
2014-12-12 14:45:44 +00:00
Alexander Sulfrian
c3780992ab TWiki Reader: add new new twiki reader 2014-10-30 19:54:48 +01:00
John MacFarlane
e917bcc124 Make raw_tex extension non-default for textile reader, writer.
Enable `raw_tex` extension in textile writer.

Closes #1532.
2014-08-14 09:49:31 -07:00
John MacFarlane
19daf6cf0a Added native_divs and native_spans extensions.
This allows users to turn off the default pandoc behavior of
parsing contents of div and span tags in markdown and HTML
as native pandoc Div blocks and Span inlines.

Setting of default epub extensions has been moved from the EPUB
reader to Text.Pandoc.
2014-08-08 21:05:34 -07:00
Matthew Pickering
8460ea417f EPUB Reader: Integrated into program 2014-07-31 21:39:50 +01: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
67c5c7a575 Moved MediaBag back from Shared to Options, to avoid module cycle. 2014-07-30 13:46:48 -07:00
John MacFarlane
555f9b746d Moved MediaBag from Shared to Options.
This will allow us to put a MediaBag in WriterOptions.
2014-07-30 13:00:54 -07:00
Jesse Rosenthal
a79ea18503 Pandoc.hs: change BSReader to output MediaBag as well as pandoc. 2014-07-30 12:47:49 -04:00
Matthew Pickering
43304d6bd6 Txt2Tags Reader: Added recognition of macros 2014-07-27 00:12:56 +01:00
Matthew Pickering
ab3589ff0b Txt2Tags Reader: Integrated into pandoc 2014-07-27 00:12:56 +01:00
John MacFarlane
4676bfdf82 Removed space at ends of lines in source. 2014-07-12 22:57:22 -07:00
Clare Macrae
717e16660d Merge remote-tracking branch 'jgm/master' into dokuwiki 2014-06-29 19:22:31 +01:00
John MacFarlane
35e57db5c2 Finished first draft of Haddock writer. 2014-06-18 17:09:36 -07:00
John MacFarlane
bbe99003f8 Naming: Use Docx instead of DocX.
For consistency with the existing writer.
2014-06-16 22:44:40 -07:00
mpickering
3bc818d2d3 Integrated the docx reader into the main pandoc program.
Changes also include generalising the types of reader allowed. The
mechanism now mimics the more general output mechanism.
2014-06-16 07:18:40 -04:00
Albert Krewinkel
ceeb701c25 Org reader: support Pandocs citation extension
Citations are defined via the "normal citation" syntax used in markdown,
with the sole difference that newlines are not allowed between "[...]".
This is for consistency, as org-mode generally disallows newlines
between square brackets.

The extension is turned on by default and can be turned off via the
default syntax-extension mechanism, i.e. by specifying "org-citation" as
the input format.
Move `citeKey` from Readers.Markdown into Parsing

The function can be used by other readers, so it is made accessible for
all parsers.
2014-05-14 15:00:26 +02:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
c8f97d3d41 Fix #1267.
We now check the writerName for a lua script in pandoc.hs, so that
lowercasing and format parsing aren't done.  Note this behavior
change: getWriter in Text.Pandoc no longer returns a custom writer on
input "foo.lua".
2014-04-27 20:56:50 -07:00
John MacFarlane
ae86e24ff6 Merge branch 'master' of https://github.com/mb21/pandoc into mb21-master 2014-03-04 10:15:43 -08:00
Albert Krewinkel
24b2ac43b0 Add a simple Emacs Org-mode reader
The basic structure of org-mode documents is recognized; however,
org-mode features like todo markers, tags etc. are not supported yet.
2014-03-04 10:40:40 +01:00
mb21
80511f1b34 InDesign ICML Writer 2014-02-28 13:35:35 +01:00
John MacFarlane
4a14467055 Text.Pandoc: Don't default to pandocExtensions for all writers.
In particular, we don't want to default to math parsing for the
HTML writer.
2013-12-06 17:31:47 -08:00
John MacFarlane
99bb066bb9 Pass writename as argument to filters.
This way filters can figure out what the target format is
and react appropriately.

Example:

    #!/usr/bin/env runghc
    import Text.Pandoc.JSON
    import Data.Char

    main = toJSONFilter cap
      where cap (Just "html") (Str xs) = Str $ map toUpper xs
            cap _ x = x

This capitalizes text only for html output.
2013-08-08 15:15:58 -07:00
John MacFarlane
97b2be599e Text.Pandoc: Don't reexport ToJSONFilter.
It's better just to import this from Text.Pandoc.JSON.
That way, compiled filters will be smaller in size.
2013-08-03 17:02:35 -07:00
John MacFarlane
1567d291a3 Text.Pandoc.JSON: Use To/FromJSON instances from pandoc-types.
* These use GHC generics rather than syb, and are faster.
* toJsonFilter is now a deprecated synonym of toJSONFilter from
  Text.Pandoc.JSON.
* The deprecated jsonFilter function has been removed.
2013-08-03 16:39:43 -07:00
John MacFarlane
5592666ca4 Text.Pandoc: Added readJSON, writeJSON to the API.
Closes #817.
2013-07-23 22:31:50 -07:00
Clare Macrae
7eded47bcd Initial work to create dokuwiki writer (#386)
In this first version, all dokuwiki files are straight copies of the
media wiki counterparts.
2013-07-14 13:40:27 +01:00
John MacFarlane
f869f7e08d Use new flexible metadata type.
* Depend on pandoc 1.12.
* Added yaml dependency.
* `Text.Pandoc.XML`: Removed `stripTags`.  (API change.)
* `Text.Pandoc.Shared`:  Added `metaToJSON`.
  This will be used in writers to create a JSON object for use
  in the templates from the pandoc metadata.
* Revised readers and writers to use the new Meta type.
* `Text.Pandoc.Options`: Added `Ext_yaml_title_block`.
* Markdown reader:  Added support for YAML metadata block.
  Note that it must come at the beginning of the document.
* `Text.Pandoc.Parsing.ParserState`:  Replace `stateTitle`,
  `stateAuthors`, `stateDate` with `stateMeta`.
* RST reader:  Improved metadata.
  Treat initial field list as metadata when standalone specified.
  Previously ALL fields "title", "author", "date" in field lists
  were treated as metadata, even if not at the beginning.
  Use `subtitle` metadata field for subtitle.
* `Text.Pandoc.Templates`:  Export `renderTemplate'` that takes a string
  instead of a compiled template..
* OPML template:  Use 'for' loop for authors.
* Org template: '#+TITLE:' is inserted before the title.
  Previously the writer did this.
2013-06-24 20:29:41 -07:00
John MacFarlane
5f4a32e465 Use aeson for json.
Benchmarked:  about twice as slow as json!
2013-06-24 20:27:37 -07:00
John MacFarlane
80ab208b3d Removed obsolete comment. 2013-05-09 09:50:15 -07:00
John MacFarlane
4fa2a94759 Added Text.Pandoc.Writers.Custom, --print-custom-lua-writer.
pandoc -t data/sample.lua

will load the script sample.lua and use it as a custom writer.
data/sample.lua is provided as an example.

Added `--print-custom-lua-writer` option to print the sample
script.
2013-04-14 00:31:39 -05:00
David Lazar
18459b95ba Add reader for Haddock markup based on Haddock's own lexer/parser. 2013-03-28 14:53:10 -07:00
John MacFarlane
da1e38893a Reveal.js improvements.
Changed name to revealjs (from reveal_js).
Set revealjs-url template variable to 'reveal.js' by default.
2013-03-23 21:48:34 -04:00