Commit graph

9341 commits

Author SHA1 Message Date
John MacFarlane
214e7919b7 Revert "Use cabal-2.0 for 8.2.1 (#3814)"
This reverts commit d8f07fad09.
2017-07-24 11:45:54 +02:00
John MacFarlane
329b61ff5c LaTeX reader: support etoolbox's ifstrequal. 2017-07-24 11:20:59 +02:00
John MacFarlane
e7876d4320 LaTeX reader: removed code for non-exported 'macro'. 2017-07-24 00:25:35 +02:00
Matthew Pickering
d8f07fad09 Use cabal-2.0 for 8.2.1 (#3814) 2017-07-24 00:11:30 +02:00
John MacFarlane
439ffc2e7f Added a test case with markdown-latex_macros. 2017-07-24 00:02:55 +02:00
John MacFarlane
159d31e80f LaTeX reader: Removed 'macro'.
It is no longer necessary, since the rawLaTeXBlock parser
will parse macro definitions.

This also avoids the need for a separate latexMacro parser
in the Markdown reader.
2017-07-24 00:02:55 +02:00
John MacFarlane
be14e2b501 LaTeX reader: some improvements in macro parsing.
Fixed applyMacros so that it operates on the whole
string, not just the first token!

Don't remove macro definitions from the output,
even if Ext_latex_macros is set, so that macros will
be applied.  Since they're only applied to math in
Markdown, removing the macros can have bad effects.
Even for math macros, keeping them should be harmless.
2017-07-24 00:02:55 +02:00
John MacFarlane
d453b3319a Refactored some common code in LaTeX reader. 2017-07-24 00:02:54 +02:00
Mauro Bieg
7d9b782f73 HTML Reader: parse figure and figcaption (#3813) 2017-07-22 19:22:56 +02:00
John MacFarlane
f9309bc46e LaTeX reader: improved heuristic for raw block/inline.
An unknown command at the beginning of the line that could
be either block or inline is treated as block if we have
a sequence of block commands followed by a newline or a
`\startXXX` command (which might start a raw ConTeXt environment).
2017-07-21 23:27:54 +02:00
rlpowell
2ae75e23dd Added TikiWiki reader (#3800)
Added TikiWiki reader, including tests and documentation.

It's probably not *complete*, but it works pretty well, handles all
the basics (and some not-so-basics).
2017-07-21 10:09:54 +02:00
Alexander Krotov
335a1c7f48 Muse reader: fix reading of lists inside tags (#3802) 2017-07-21 10:04:13 +02:00
John MacFarlane
7191fe1f29 LaTeX reader: handle optional args in raw \titleformat.
Closes #3804.
2017-07-21 09:28:36 +02:00
John MacFarlane
992943d98e Templates: change signature of getDefaultTemplate.
Now it runs in any instance of PandocMonad, and returns
a String rather than an Either value.
2017-07-19 21:46:28 +02:00
John MacFarlane
2ce6b492e1 Class: started adding haddocks. 2017-07-19 21:31:46 +02:00
John MacFarlane
56f63af3f6 LaTeX reader: fixed regression with starred environment names.
Closes #3803.
2017-07-19 17:30:22 +02:00
John MacFarlane
3267af23f0 Travis: Removed ghc 8.2.1 build from allowed failures. 2017-07-15 19:39:58 +02:00
John MacFarlane
4e8f7a1796 Fix docx writer test for ghc 8.2.1.
Workaround for different behavior of Data.Unique in different ghc
versions.
2017-07-15 11:39:01 +02:00
John MacFarlane
dcf79c4188 Don't rely on listDirectory, which is only in newer versions...
of directory.
2017-07-15 11:38:43 +02:00
John MacFarlane
3871a73e0f Rearrange docx writer roundtrip test.
I'm hoping this gives reproducible results on ghc 8.2.1.
2017-07-15 09:14:17 +02:00
John MacFarlane
4e9e1bae7c Refactored compareOutput in docx writer test 2017-07-14 23:39:33 +02:00
John MacFarlane
df5a00990e Class: make addToFileTree handle directories recursively. 2017-07-14 17:28:13 +02:00
John MacFarlane
f8fef1ebb0 Class: remove stFontFiles in PureState, 'glob' searches stFiles. 2017-07-14 16:35:29 +02:00
John MacFarlane
f140784870 Class: added addToFileTree 2017-07-14 16:24:30 +02:00
John MacFarlane
42fd536a0e Fix ghc 8.2.1 compiler warnings. 2017-07-14 11:17:46 +02:00
John MacFarlane
f6d97bc8cc Revert "Fixed some ghc 8.2 compiler warnings."
This reverts commit e22dc98a70.
2017-07-14 11:00:42 +02:00
John MacFarlane
e22dc98a70 Fixed some ghc 8.2 compiler warnings.
(Unnecessary type constraints.)
2017-07-14 09:57:18 +02:00
John MacFarlane
3a36441b61 Use foldrWithKey instead of deprecated foldWithKey. 2017-07-13 23:37:21 +02:00
John MacFarlane
247257ed3e Travis: cabal build for ghc 8.2.1 RC. 2017-07-13 21:51:26 +02:00
John MacFarlane
9c79a518ac Revert "Added a travis build on ghc 8.2 release candidate."
This reverts commit 62915a8af1.
2017-07-13 21:49:37 +02:00
John MacFarlane
62915a8af1 Added a travis build on ghc 8.2 release candidate. 2017-07-13 21:43:24 +02:00
schrieveslaach
911b63dfc3 Add LaTeX xspace support (#3797) 2017-07-13 20:56:59 +02:00
Marc Schreiber
f93d7d06f6 Merge branch 'master' of https://github.com/jgm/pandoc into textcolor-support 2017-07-13 11:51:40 +02:00
Yuchen Pei
8b502dd50f Fixed #3760. (#3784)
Using the same solution as in the LaTeX reader:
equation -> displaymath
align -> displaymath \begin{aligned} ... \end{aligned}
etc..
2017-07-12 17:19:49 +02:00
Alexander Krotov
de117fbd9e Muse writer: indent lists inside <quote> with at least one space (#3795) 2017-07-12 17:16:02 +02:00
Alexander Krotov
e0025cf4f1 Remove redundant imports (#3796) 2017-07-12 17:14:10 +02:00
John MacFarlane
050036c036 Print informative message when failing with use of --normalize.
We may want to think of some kind of graceful fallback, but
the present behavior has the advantage of forcing people to
update scripts when updating to pandoc 2.0.

See #3786.
2017-07-12 16:51:30 +02:00
John MacFarlane
013fd1c6b6 Make sure \write18 is parsed as raw LaTeX.
The change is in the LaTeX reader's treatment of raw commands,
but it also affects the Markdown reader.
2017-07-12 14:50:49 +02:00
John MacFarlane
41209ea676 HTML reader: Ensure that paragraphs are closed properly...
when the parent block element closes, even without `</p>`.

Closes #3794.
2017-07-11 15:52:38 +02:00
John MacFarlane
e6cdaea27f COPYRIGHT: clarify that pandoc-types is BSD3 licensed. 2017-07-10 19:19:12 +02:00
John MacFarlane
f55cfe2541 COPYRIGHT: clarify that templates are dual-licensed. 2017-07-10 19:12:09 +02:00
John MacFarlane
770e0cccc1 Use takeP in LaTeX reader. 2017-07-07 12:37:21 +02:00
John MacFarlane
6f6e83a06e Parsing: added takeP, takeWhileP for efficient parsing of [Char]. 2017-07-07 12:37:21 +02:00
John MacFarlane
0feb7504b1 Rewrote LaTeX reader with proper tokenization.
This rewrite is primarily motivated by the need to
get macros working properly.  A side benefit is that the
reader is significantly faster (27s -> 19s in one
benchmark, and there is a lot of room for further
optimization).

We now tokenize the input text, then parse the token stream.

Macros modify the token stream, so they should now be effective
in any context, including math. Thus, we no longer need the clunky
macro processing capacities of texmath.

A custom state LaTeXState is used instead of ParserState.
This, plus the tokenization, will require some rewriting
of the exported functions rawLaTeXInline, inlineCommand,
rawLaTeXBlock.

* Added Text.Pandoc.Readers.LaTeX.Types (new exported module).
  Exports Macro, Tok, TokType, Line, Column.  [API change]
* Text.Pandoc.Parsing: adjusted type of `insertIncludedFile`
  so it can be used with token parser.
* Removed old texmath macro stuff from Parsing.
  Use Macro from Text.Pandoc.Readers.LaTeX.Types instead.
* Removed texmath macro material from Markdown reader.
* Changed types for Text.Pandoc.Readers.LaTeX's
  rawLaTeXInline and rawLaTeXBlock.  (Both now return a String,
  and they are polymorphic in state.)
* Added orgMacros field to OrgState.  [API change]
* Removed readerApplyMacros from ReaderOptions.
  Now we just check the `latex_macros` reader extension.
* Allow `\newcommand\foo{blah}` without braces.

Fixes #1390.
Fixes #2118.
Fixes #3236.
Fixes #3779.
Fixes #934.
Fixes #982.
2017-07-07 12:36:00 +02:00
John MacFarlane
1dd769e558 Logging: added MacroAlreadyDefined. 2017-07-06 14:50:51 +02:00
John MacFarlane
8300b3fbda MANUAL: document ibooks specific epub metadata. 2017-06-30 23:56:01 +02:00
John MacFarlane
20103ac2bc Allow ibooks-specific metadata in epubs. Closes #2693.
You can now have the following fields in your YAML metadata,
and it will be treated appropriately in the generated
EPUB.

```
ibooks:
  version: 1.3.4
  specified-fonts: false
  ipad-orientation-lock: portrait-only
  iphone-orientation-lock: landscape-only
  binding: true
  scroll-axis: vertical
```

This commit also fixes a regression in stylesheet paths.
2017-06-30 23:33:51 +02:00
John MacFarlane
57122f3760 Updated stack.pkg.yaml. 2017-06-30 23:26:17 +02:00
John MacFarlane
d3dae1200a Removed hard_line_breaks extension from markdown_github.
GitHub has two Markdown modes, one for long-form documents like READMEs
and one for short things like issue coments. In issue comments, a line
break is treated as a hard line break. In README, wikis, etc., it is
treated as a space as in regular Markdown.

Since pandoc is more likely to be used to convert long-form
documents from GitHub Markdown, `-hard_line_breaks` is a better
default.

Closes #3594.
2017-06-30 22:26:42 +02:00
John MacFarlane
69b2cb38a8 Make east_asian_line_breaks affect all readers/writers.
Closes #3703.
2017-06-30 22:23:15 +02:00