Commit graph

9172 commits

Author SHA1 Message Date
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
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
John MacFarlane
fa43c0feaa Updated jats tests for new texmath version. 2017-06-30 20:50:37 +02:00
John MacFarlane
69388d52e3 Use latest texmath. 2017-06-30 20:39:53 +02:00
John MacFarlane
e574d50b1c Markdown writer: Ensure that + and - are escaped properly...
so they don't cause spurious lists.  Previously they were only
if succeeded by a space, not if they were at end of line.

Closes #3773.
2017-06-30 17:41:25 +02:00
John MacFarlane
5e00cf8086 Added parameter for user data directory to runLuaFilter.
in Text.Pandoc.Lua.  Also to pushPandocModule.

This change allows users to override pandoc.lua with a file
in their local data directory, adding custom functions, etc.

@tarleb, if you think this is a bad idea, you can revert this.
But in general our data files are all overridable.
2017-06-29 17:13:19 +02:00
John MacFarlane
0f658eb46c data/pandoc.lua: regularize constructors.
We now use Pandoc instead of Doc (though Doc remains a deprecated
Synonym), and we deprecate DoubleQuoted, SingleQuoted,
InlineMath, and DisplayMath.
2017-06-29 17:08:59 +02:00
John MacFarlane
cb25326fa3 Text.Pandoc.Lua: more code simplification.
Also, now we check before running walkM that the function
table actually does contain something relevant.  E.g. if
your filter just defines Str, there's no need to run walkM
for blocks, meta, or the whole document. This should
help performance a bit (and it does, in my tests).
2017-06-29 17:07:30 +02:00
John MacFarlane
780a65f8a8 Lua filters: Remove special treatment of Quoted, Math.
No more SingleQuoted, DoubleQuoted, InlineMath, DisplayMath.
This makes everything uniform and predictable, though it does
open up a difference btw lua filters and custom writers.
2017-06-29 15:47:27 +02:00
John MacFarlane
5c80aca0e2 Text.Pandoc.Lua: refactored to remove duplicated code. 2017-06-29 14:31:02 +02:00
John MacFarlane
6ad74815f6 Text.Pandoc.Lua: use generics to reduce boilerplate.
I tested this with the str.lua filter on MANUAL.txt, and
I could see no significant performance degradation.

Doing things this way will ease maintenance, as we won't
have to manually modify this module when types change.

@tarleb, do we really need special cases for things like
DoubleQuoted and InlineMath?
2017-06-29 14:00:26 +02:00
John MacFarlane
c505de59c0 Added link-table example to doc/lua-filters.md. 2017-06-28 15:31:42 +02:00
John MacFarlane
2902260b63 Make papersize: a4 work regardless of the case of a4.
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
2017-06-28 15:07:35 +02:00