Commit graph

358 commits

Author SHA1 Message Date
John MacFarlane
1991edf9a5 Shared.openURL: URL-escape pipe characters.
Even though these are legal, Network.URI doesn't regard them
as legal in URLs.  So we escape them first.

Closes #535.
2013-04-28 22:57:17 -07:00
John MacFarlane
89d525e417 Shared: Fixed readDefaultDataFile so it works on Windows. 2013-04-20 13:07:50 -07:00
John MacFarlane
3c1a8d1924 Revert "Improved previous patch so it really solves the Windows issue."
This reverts commit e80116c813.
2013-04-20 10:09:17 -07:00
John MacFarlane
e80116c813 Improved previous patch so it really solves the Windows issue. 2013-04-19 23:24:06 -07:00
John MacFarlane
6bd686a4f6 Shared: readDefaultDataFile: normalize the paths.
This fixes bugs in `--self-contained` on pandoc compiled with
`embed_data_files`.  The bugs affect (a) paths containing `..`, (b)
Windows, where `\` is path separator.

Closes #833.
2013-04-19 23:03:59 -07:00
John MacFarlane
727645bc1f Shared: openURL now follows redirects.
Closes #701.
2013-03-26 08:32:02 -07:00
John MacFarlane
cdee226586 hierarchicalize: Do not number section with class "unnumbered".
Unnumbered sections get [] for their section number.
So far only the HTML writer has been adjusted to be sensitive
to this.

If we keep this change, all the writers will need to be changed
either (a) to directly check for the "unnumbered" class, if they
do section numbering themselves, or (b) to check for a null section
number, if they use hierarchicalize.
2013-02-13 08:49:48 -08:00
John MacFarlane
5330e63421 Shared: Changed type of Element.
Sec now includes a field for Attr rather than just String
(the identifier).

Note, this is an API change.
2013-02-12 20:13:23 -08:00
John MacFarlane
9c299d282f Added Text.Pandoc.Data (non-exported) if embed_data_files selected.
This module just exports the association list of embedded data files,
which is used by Shared.
2013-01-23 19:26:39 -08:00
John MacFarlane
449ddeb53b Refactoring:
* Shared now exports fetchItem (instead of getItem) and openURL
* fetchItem has different parameters than getItem and includes
  some logic formerly in the ODT and Docx writers
* getItem still used in SelfContained
2013-01-11 16:19:06 -08:00
John MacFarlane
77d9ead1b2 Move getItem from SelfContained to Share; export getItem. 2013-01-11 11:30:31 -08:00
John MacFarlane
d599c4cdab Added Attr field to Header.
Previously header ids were autogenerated by the writers.
Now they are generated (unless supplied explicitly) in the
markdown parser, if the `header_identifiers` extension is
selected.

In addition, the textile reader now supports id attributes on
headers.
2013-01-09 09:30:05 -08:00
John MacFarlane
7909982f9a Shared: export isTightList. 2013-01-07 20:12:05 -08:00
John MacFarlane
5e5859f126 Revert "Workaround for problem with file-embed."
This reverts commit 84ed0f055f.
2012-12-30 15:50:37 -08:00
John MacFarlane
84ed0f055f Workaround for problem with file-embed.
file-embed uses forward slashes as path separators, even
on Windows.  So we just convert backslashes to forward
before doing a lookup.
2012-12-29 20:44:09 -08:00
John MacFarlane
c2fe3aae64 Made embed_data_files flag work. 2012-12-29 18:45:20 -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
93e92a4716 Renamed removedLeadingTrailingSpace to trim.
Also removeLeadingSpace to triml,
removeTrailingSpace to trimr.
2012-09-29 17:09:34 -04:00
John MacFarlane
5c06322ab2 Shared: Export compactify', formerly in Markdown reader. 2012-09-27 17:52:38 -07:00
John MacFarlane
ff84881e8c Shared: Count \r as space in removeLeading/TrailingSpace. 2012-09-26 09:06:34 -07:00
John MacFarlane
12045d84b6 Revert "More intelligent handling of text encodings."
This reverts commit 7272735b3d.
2012-09-23 22:53:34 -07:00
John MacFarlane
7272735b3d More intelligent handling of text encodings.
Previously, UTF-8 was enforced for both input and output.

The new system:

* For input, UTF-8 is tried first; if an error is raised, the
  locale encoding is tried.
* For output, the locale encoding is always used.
2012-09-23 22:12:21 -07:00
John MacFarlane
a6f2b96084 Moved renderTags' from HTML reader & SelfContained to Shared.
Improved removal of markdown="1" attribute in Markdow reader.
2012-08-15 09:42:16 -07:00
John MacFarlane
0cb7362f62 Removed --strict, added extensions to writer/reader names.
* The `--strict` option has been removed.
* Instead of using `--strict`, one can now use `strict` instead of
  `markdown` as an input or output format name.
* The `--enable` and `--disable` optinos have been removed.
* It is now possible to enable or disable specific extensions
  by appending them (with '+' or '-') to the writer or reader
  name.  For example `pandoc -f markdown-footnotes+hard_line_breaks`.
* The lhs extensions are now implemented this way, too; you can
  use either `+lhs` or `+literate_haskell`.
2012-08-09 20:24:05 -07:00
John MacFarlane
10cdd59fa8 Added safeRead to Text.Pandoc.Shared. 2012-08-09 07:52:39 -07:00
John MacFarlane
00dc1e715e Moved WriterOptions and associated types Shared -> Options. 2012-07-26 22:59:56 -07:00
John MacFarlane
6d7f0a1b81 Fixed whitespace errors. 2012-07-26 22:32:53 -07:00
John MacFarlane
02ef26ae91 Slightly more efficient normalizeSpaces. 2012-07-24 22:12:18 -07:00
John MacFarlane
cd19d4596b Added fields to WriterOptions.
writerEpubStylesheet, writerEpubFonts, writerReferenceODT,
writerReferenceDocx.  These can now be removed as extra
parameters to the writers.
2012-07-24 09:49:57 -07:00
John MacFarlane
2351f7a112 Provide Data.Default instances for ParserState and WriterOptions.
Now you can use def (which is re-exported by Text.Pandoc) instead of
defaultParserState or defaultWriterOptions.  For now, these
are still defined too, so existing code need not change.

Closes #546.
2012-07-19 12:38:54 -07:00
Jonas Smedegaard
61f8dd4da8 Add support for Slideous output. 2012-05-24 10:31:18 +02:00
John MacFarlane
5f889b9396 Added writerTeXLigatures to WriterOptions, --no-tex-ligatures option.
This is useful for those who want to use advanced OpenType features
with xelatex/lualatex.
2012-05-11 23:00:46 -07:00
John MacFarlane
75485c2f11 Complete rewrite of LaTeX reader.
* The new reader is more robust, accurate, and extensible.
  It is still quite incomplete, but it should be easier
  now to add features.

* Text.Pandoc.Parsing: Added withRaw combinator.

* Markdown reader: do escapedChar before raw latex inline.
  Otherwise we capture commands like \{.

* Fixed latex citation tests for new citeproc.

* Handle \include{} commands in latex.
  This is done in pandoc.hs, not the (pure) latex reader.
  But the reader exports the needed function, handleIncludes.

* Moved err and warn from pandoc.hs to Shared.

* Fixed tests - raw tex should sometimes have trailing space.

* Updated lhs-test for highlighting-kate changes.
2012-02-04 09:56:43 -08:00
John MacFarlane
3a0b3df007 Put date in YYYY-MM-DD format if possible for HTML, docx metadata.
Added normalizeDate to Text.Pandoc.Shared.
2012-01-28 15:54:34 -08:00
John MacFarlane
ad33a22a22 Shared: Added splitStringWithIndices.
This is like splitWithIndices, but it is sensitive to distinctions
between wide, combining, and regular characters.
2012-01-27 00:37:46 -08:00
John MacFarlane
5fc6669be6 Added --atx-headers option. 2012-01-26 23:55:37 -08:00
John MacFarlane
60bf741d68 Added --slide-level option to override default.
This allows users to select a slide level below the first
header level with content.

Note that content under sections above the slide level will not appear
in slides (either in beamer or in HTML slide shows).

This is primarily useful for creating documents that can be made
into both slides and handouts (which contain additional content
outside the slides).
2012-01-25 17:51:52 -08:00
John MacFarlane
ea39a607ed Added 'beamer' as an output format.
Beamer output uses the default LaTeX template, with some
customizations via variables.

Added `writerBeamer` to `WriterOptions`.

Added `--beamer` option to `markdown2pdf`.
2011-12-29 13:26:04 -08:00
John MacFarlane
16629bf1ce Added --highlight-style and --no-highlight options. 2011-12-27 23:46:47 -08:00
John MacFarlane
a579e2c892 Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings. 2011-12-27 15:45:34 -08:00
John MacFarlane
f61e09cb9a Added writerHighlight to WriterOptions. 2011-12-22 13:12:08 -08:00
John MacFarlane
b892b29eac Removed writerAscii in WriterOptions.
No longer needed or used.
2011-12-22 11:41:35 -08:00
John MacFarlane
bdec07bac9 Shared: Removed unescapeURI, modified escapeURI.
escapeURI now only escapes space characters, leaving unicode characters
as they are, instead of converting them to octets and URL-encoding them,
as before.  This gives more readable URIs.  User agents now do the
percent-encoding themselves.

URIs are no longer unescaped at all on conversion to markdown, asciidoc,
rst, org.

Closes #349.
2011-12-02 19:39:30 -08:00
John MacFarlane
9b37c9cc35 Added dzslides output option.
* Added DZSlides to HTMLSlideVariant.
* Added support for dzslides in HTML writer.
* Added dzslides template.
2011-10-01 23:02:24 -07:00
John MacFarlane
18306c74fb Deprecated --xetex option - it is no longer needed.
Deprecated `writerXeTeX` and the `--xetex` option.
The latex writer now produces a file that can be processed
by latex, pdflatex, lualatex, or xelatex, so this option isn't
needed.

The option is still neded in markdown2pdf, however, which
has been modified to take some options that aren't in pandoc.
2011-07-22 13:11:46 -07:00
John MacFarlane
1c28c5308f Added unexported Text.Pandoc.MIME.
Moved getMimeType from Text.Pandoc.Shared to Text.Pandoc.MIME,
so we won't have an API change.
2011-07-19 12:01:20 -07:00
John MacFarlane
e980627769 Added getMimeType to Text.Pandoc.Shared. 2011-07-17 19:33:52 -07:00
John MacFarlane
8f408e4b7b Added --ascii option.
Currently supported only in HTML writer.
2011-02-06 09:27:03 -08:00
John MacFarlane
cbe162ecbe Make writerSectionDivs default to False. 2011-02-05 11:21:10 -08:00
John MacFarlane
221177c272 Shared: Minor refactoring. 2011-02-04 18:32:54 -08:00