Commit graph

42 commits

Author SHA1 Message Date
John MacFarlane
a68805bebd Added -F as shortcut for --filter. 2013-08-25 07:47:22 -07:00
John MacFarlane
deb59b6235 Removed dependency on citeproc-hs.
Going forward we'll use pandoc-citeproc, as an external filter.

The `--bibliography`, `--csl`, and `--citation-abbreviation` fields
have been removed.  Instead one must include `bibliography`, `csl`,
or `csl-abbrevs` fields in the document's YAML metadata.  The filter
can then be used as follows:

    pandoc --filter pandoc-citeproc

The `Text.Pandoc.Biblio` module has been removed.  Henceforth,
`Text.CSL.Pandoc` from pandoc-citations can be used by library users.

The Markdown and LaTeX readers now longer format bibliographies and
citations.  That must be done using `processCites` or `processCites'`
from Text.CSL.Pandoc.

All bibliography-related fields have been removed from `ReaderOptions`
and `WriterOptions`: `writerBiblioFiles`, `readerReferences`,
`readerCitationStyle`.

API change.
2013-08-24 22:33:01 -07:00
John MacFarlane
6e222ce225 Improved error reporting on filters.
Avoid showing spurious output and avoid double error messages.
2013-08-24 12:54:39 -07:00
John MacFarlane
8926230175 Print stderr output of filters to stderr. 2013-08-14 13:02:54 -07:00
John MacFarlane
f6b5735d09 Added module for writing python scripts, with several examples.
See scripts subdirectory.
2013-08-13 23:11:33 -07:00
John MacFarlane
bd73d73a28 Removed --print-sample-lua-writer, added --print-default-data-file.
Closes #943.
2013-08-13 18:29:57 -07:00
John MacFarlane
e279175ea5 Options: Changed writerSourceDir to writerSourceURL (now a Maybe).
Previously we used to store the directory of the first input file,
even if it was local, and used this as a base directory for
finding images in ODT, EPUB, Docx, and PDF.

This has been confusing to many users.  It seems better to look for
images relative to the current working directory, even if the first
file argument is in another directory.

writerSourceURL is set to 'Just url' when the first command-line
argument is an absolute URL.  (So, relative links will be resolved
in relation to the first page.)  Otherwise, 'Nothing'.

The ODT, EPUB, Docx, and PDF writers have been modified accordingly.

Note that this change may break some existing workflows.  If you
have been assuming that relative links will be interpreted relative
to the directory of the first file argument, you'll need to
make that the current directory before running pandoc.

Closes #942.
2013-08-11 15:58:09 -07: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
2677e84663 Revert "Revert "Added --filter option.""
This reverts commit 2e5edbb278.
2013-08-08 11:09:00 -07:00
John MacFarlane
2e5edbb278 Revert "Added --filter option."
This reverts commit 85dacbb282.
2013-07-23 23:17:07 -07:00
John MacFarlane
85dacbb282 Added --filter option.
This makes it easier to use JSON filters.  Instead of
doing

    pandoc -t json | ./filter | pandoc -f json

you can just do

    pandoc --filter ./filter
2013-07-23 23:02:47 -07:00
John MacFarlane
7102254e24 PDF generation improvements.
* `Text.Pandoc.PDF` exports `makePDF` instead of `tex2pdf`.
  (API change.)
* `makePDF` walks the pandoc AST and checks for the existence of
  images in the local directory.  If they are not found, it attempts
  to find them, either in the directory containing the first source
  file, or at an absolute URL, or at a URL relative to the base URL
  of the first command line argument.
* Closes #917.
2013-07-20 12:14:43 -07:00
John MacFarlane
1de55ecbbd --toc-level no longer implies --toc.
Reason: EPUB users who don't want a visible TOC may still want
to set the TOC level for in the book navigation.
2013-07-03 12:47:35 -07:00
John MacFarlane
4edc97a921 pandoc --help now says something about pdf output.
Closes #720.
2013-04-26 21:13:42 -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
John MacFarlane
333deac26b Have --help print in and out formats in alphabetical order. 2013-04-08 09:44:23 -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
Jamie F. Olson
6b53a905c4 Added basic support for reveal.js.
Support unordered and ordered lists with "fragment" elements.

Modified by JGM to remove the --reveal_js-url command-line option.
Instead use -V reveal_js-url=... as with slidy and the other slide
formats.  Also cleaned up the list code in the HTML writer.
2013-03-21 14:54:17 -07:00
John MacFarlane
69acb47a34 Added Text.Pandoc.Writers.OPML.
TODO:

* Document in README
* Add tests
* Add template (and add template to cabal file)
2013-03-19 22:49:44 -07:00
John MacFarlane
74d53f4347 Added Text.Pandoc.Readers.OPML, exporting readOPML.
The _note attribute is supported.  This is unofficial, but
used e.g. in OmniOutliner and supported by multimarkdown.
We treat the contents as markdown blocks under a section
header.

Added to documentation and tests.
2013-03-19 20:22:14 -07:00
John MacFarlane
f8fec87f09 Fixed numbering mismatch between TOC and sections in HTML.
Also made `--number-offset` affect TOC numbering as well
as section numbering, as it should have all along.

Closes #789.
2013-03-16 14:48:37 -07:00
John MacFarlane
3b63cb0903 Hide Text.Pandoc.Highlighting.
* Moved code for translating listings language names to
  highlighting-kate names and back from LaTeX reader to Highlighting.
* Text.Pandoc.Highlighting no longer exposed (API change)
* Text.Pandoc.Highlighting exports toListingsLang, fromListingsLang
2013-03-05 22:09:42 -08:00
John MacFarlane
756c8d492a --number-from -> --number-offset
Also `writerNumberFrom` -> `writeNumberOffset`.
The offset is a list of numbers (0 by default).
These are added to the section, subsection, etc.
numbers that would have been generated automatically.
2013-02-23 18:11:05 -08:00
John MacFarlane
91f507d393 --number-from implies --number-sections. 2013-02-22 19:42:11 -08:00
John MacFarlane
8df380486c Added --number-from option and writerNumberFrom.
These still aren't hooked up to anything in the writers.
2013-02-21 21:40:06 -08:00
John MacFarlane
ec5dc431de Changes to --version.
Print default user data directory.
Put language names in lowercase and omit 'alert' and 'alert_indent'.
2013-02-07 20:06:30 -08:00
John MacFarlane
7f4e1075be Changes to --version.
Print default user data directory.
Put language names in lowercase and omit 'alert' and 'alert_indent'.
2013-02-07 19:58:28 -08:00
John MacFarlane
c5f1a8ad2d Added --default-image-extension and readerDefaultImageExtension.
Note: Currently this only affects the markdown reader.
2013-02-05 20:08:00 -08:00
John MacFarlane
ce3d60d98e Updated copyright dates. 2013-01-19 11:11:45 -08:00
John MacFarlane
8eab759a9c RTF writer: Added writeRTFWithEmbeddedImages.
* RTF writer:  Export writeRTFWithEmbeddedImages instead of
  rtfEmbedImage.
* Text.Pandoc: Use writeRTFWithEmbeddedImages for RTF.
* Moved code for embedding images in RTF out of pandoc.hs.
2013-01-18 10:33:37 -08:00
John MacFarlane
eebed6bc48 Added writerHtmlQTags and --html-q-tags option.
The previous default was to use `<q>` tags in HTML5.
But `<q>` tags are also valid HTML4, and they are not very
robust in HTML5.  Some user agents don't support them,
and some CSS resets prevent pandoc's quotes CSS from working
properly (e.g. bootstrap).  It seems a better default just
to insert quote characters, but the option is provided  for
those who have gotten used to using `<q>` tags.
2013-01-15 18:50:36 -08:00
John MacFarlane
acfe1d96ee pandoc.hs: Fix writerSourceDirectory when a URL is provided.
It should be the URL up to the path.
2013-01-11 15:44:50 -08:00
John MacFarlane
f8db21fa16 Options: Added phpMarkdownExtraExtensions.
And added markdown_phpextra input/output format.
2013-01-10 22:39:47 -08:00
John MacFarlane
c45ae571cc Changed --toc-level to --toc-depth. 2013-01-05 12:03:05 -08:00
John MacFarlane
7c10e57997 Changed --epub-toc-level to --toc-level.
Also writerEpubTOCLevel -> writerTOCLevel.
So far this is only implemented in the EPUB writer.
2013-01-05 11:36:55 -08:00
John MacFarlane
f4111ac827 Renamed local variable for consistency (EPUB->Epub). 2013-01-04 22:44:18 -08:00
John MacFarlane
e91bae4f5b Renamed writerEPUBMetadata -> writerEpubMetadata.
API change for consistency.
2013-01-04 22:41:27 -08:00
John MacFarlane
30361308e7 Added --epub-chapter-level and --epub-toc-level options.
Also added writerEpubChapterLevel and writerEpubTOCLevel fields
to WriterOptions.
2013-01-04 22:29:41 -08:00
John MacFarlane
3bea3635d6 Changed type of 'readers' in Text.Pandoc, so all readers are in IO.
Users who want pure readers can still get them; this just affects
the function getReader that looks up a reader based on the format
name.

The point of this change is to make it possible to print warnings
from the parser.
2013-01-03 22:55:55 -08:00
John MacFarlane
2014e2b4ea Fixed paths for LaTeXMathML and MathMLinHTML scripts. 2013-01-03 11:19:59 -08:00
John MacFarlane
1864bb0994 Data files changes.
* Added `embed_data_files` flag.  (not yet used)
* Shared no longer exports `findDataFile`.
* `readDataFile` now returns a strict bytestring.
* Shared now exports `readDataFileUTF8` which returns a string like
  the old `readDataFile`.
* Rewrote modules to use new data file functions and to avoid
  using functions from Paths_pandoc directly.
2012-12-29 17:54:07 -08:00
John MacFarlane
32c5a8e2dc Cabal file changes.
* Remove executable and library flags.
* Expose `Text.Pandoc.XML` and `Text.Pandoc.Biblio`.
* Depend on pandoc library in executable, so we don't recompile
  everything.
* Move pandoc.hs from src/ to .
2012-12-29 16:43:22 -08:00
Renamed from src/pandoc.hs (Browse further)