Commit graph

10013 commits

Author SHA1 Message Date
Albert Krewinkel
bd3ea72371
Lua modules: added pandoc.utils module
A new module `pandoc.utils` has been created. It holds utility functions
like `sha1`, which was moved from the main `pandoc` module.
2017-12-21 22:42:59 +01:00
Albert Krewinkel
5ad719c1fb
Lua modules: make a Haskell module for each Lua module
Definitions for the `pandoc.mediabag` modules are moved to a separate
Haskell module.

Change: minor
2017-12-21 22:42:59 +01:00
Albert Krewinkel
ab3c506584
Lua modules: move to dedicated submodule
The Haskell module defining the Lua `pandoc` module is moved to
Text.Pandoc.Lua.Module.Pandoc.

Change: minor
2017-12-21 22:42:59 +01:00
Mauro Bieg
6ec7e39b4c MANUAL.txt use native syntax for custom-style (#4174) 2017-12-21 12:56:20 -07:00
John MacFarlane
685e90cd4f LaTeX reader: Fixed subtle bug in tokenizer.
Material following `^^` was dropped if it wasn't a character
escape.  This only affected invalid LaTeX, so we didn't see it
in the wild, but it appeared in a QuickCheck test failure
https://travis-ci.org/jgm/pandoc/jobs/319812224
2017-12-21 11:50:55 -08:00
John MacFarlane
117a672c4d Removed default.theme data file.
It is no longer needed now that we have `--print-highlight-style`.
See #4096.
2017-12-21 11:28:38 -08:00
Jesse Rosenthal
c4f58684ee PowerPoint writer: Implement notes
This currently prints all notes on a final slide.

Note that at the moment, there is a danger of text overflowing the
note slide, since there is no logic for adding further slides. A
future commit will shrink the font size on these notes, but that won't
take care of the problem altogether. (We might have to implement some
sort of clumsy page-breaking logic here based on font size and
text-box dimensions, though that seems like a can of worms.)
2017-12-21 12:11:58 -05:00
Jesse Rosenthal
f76b4fc497 PowerPoint writer: Register notes to state.
When we encounter a note, we write it to the state directory of notes,
and input a superscript.
2017-12-21 11:45:08 -05:00
Jesse Rosenthal
d6c9e4f243 Add Note state to PowerPoint writer.
First step toward implementing notes in pptx writer.
2017-12-21 11:35:00 -05:00
Jesse Rosenthal
4d0cb0b2fc Implement basic definition list functionality to PowerPoint writer.
These are currently implemented in terms of a Bold para for the terms,
and then blockquotes for the definitions. THis can be refined a bit in
the future.
2017-12-21 11:09:05 -05:00
Jesse Rosenthal
4e53c7bf55 Don't look for default template file for Powerpoint.
When using readerStandalone, this keeps us from looking for a
non-existent template pptx file.

Closes #4181
2017-12-21 10:35:51 -05:00
Jesse Rosenthal
3c8f0269f9 Add pptx to isTextFormat list
This is used to check standalone and not writing to the terminal.
2017-12-21 10:22:58 -05:00
Alexander Krotov
d035689a06 Org writer: do not wrap "-" to avoid accidental bullet lists
Also add TODO for ordered lists.
2017-12-21 16:36:29 +03:00
Alexander Krotov
0405c5b461 Muse reader: parse anchors immediately after headings as IDs 2017-12-21 15:52:10 +03:00
Albert Krewinkel
5d3573e780
Lua modules: turn pipe, read into full Haskell functions
The `pipe` and `read` utility functions are converted from hybrid
lua/haskell functions into full Haskell functions. This avoids the need
for intermediate `_pipe`/`_read` helper functions, which have dropped.
2017-12-20 22:24:41 +01:00
Albert Krewinkel
299e452463
Test more pandoc Lua module functions
The functions `sha1`, `read`, and `pipe` are now tested.

Change: minor
2017-12-20 21:36:41 +01:00
John MacFarlane
2b2dae8b47 Travis: use --jobs=2 for installing dependencies.
In hopes this will help with the OOM problems.
2017-12-20 12:35:58 -08:00
John MacFarlane
f5c8dd2745 makefile: use lts-10 resolver. 2017-12-20 12:35:58 -08:00
Albert Krewinkel
e45f87a3be
Org reader: fix asterisks-related parsing error
A parsing error was fixed which caused the org reader to fail when
parsing a paragraph starting with two or more asterisks.

Fixes: #4180
2017-12-20 18:04:50 +01:00
Alexander Krotov
b5e62a5c09 Muse reader: require that note references does not start with 0 2017-12-20 14:00:30 +03:00
John MacFarlane
ac202e648b Stack builds with lts-10.0. 2017-12-19 22:28:25 -08:00
Alexander Krotov
1e21cfb251 Muse writer: don't wrap note references to the next line
Closes #4172.
2017-12-19 13:30:48 +03:00
Alexander Krotov
ef8430e702 Fix for #4171 fix: don't wrap note references after SoftBreak 2017-12-19 13:30:48 +03:00
Albert Krewinkel
46d3c95ecd
pandoc.lua: re-add missing MetaMap function
This was a bug introduced in version 2.0.4 (commit
3f1f9536d4).
2017-12-19 09:12:16 +01:00
Alexander Krotov
f6abf15832 Muse reader: parse empty comments correctly 2017-12-19 04:23:32 +03:00
John MacFarlane
c0cc9270cb Org writer: don't allow fn refs to wrap to beginning of line.
Otherwise they can be interpreted as footnote definitions.

Closes #4171.
2017-12-18 16:33:52 -08:00
Albert Krewinkel
70dc5834da
Lua filters: perform minor code clean-up
Change: minor
2017-12-18 18:10:08 +01:00
John MacFarlane
808f6d3fa1 OPML reader: enable raw HTML and other extensions by default for notes.
This fixes a regression in 2.0.

Note that extensions can now be individually disabled, e.g.
`-f opml-smart-raw_html`.

Closes #4164.
2017-12-17 09:52:53 -08:00
John MacFarlane
d35e396f3c Use latest pandoc-citeproc in binary pkg. 2017-12-15 15:48:02 -08:00
John MacFarlane
bba7646340 LaTeX writer: use \renewcommand for \textlatin with babel.
This avoids a clash with a deprecated \textlatin command defined
in Babel.  Closes #4161.
2017-12-15 12:21:41 -08:00
John MacFarlane
79c3f57c47 Added tests of latex tokenizer.
This should help prevent regressions like #4159.
2017-12-15 10:13:43 -08:00
John MacFarlane
3a3d661408 LaTeX reader: export tokenize, untokenize.
Mainly so they can be tested.
2017-12-15 10:13:16 -08:00
John MacFarlane
044d58bb24 Fixed regression in LateX tokenization.
This mainly affects the Markdown reader when parsing
raw LaTeX with escaped spaces.  Closes #4159.
2017-12-15 09:45:29 -08:00
John MacFarlane
61133b5268 Merge branch 'master' of github.com:jgm/pandoc 2017-12-14 20:54:59 -08:00
John MacFarlane
b88cd9c2ed filters.md: say that Text.Pandoc.JSON comes form pandoc-types.
Closes jgm/pandoc-website#16.
2017-12-14 20:54:15 -08:00
John MacFarlane
a831a4f469 MANUAL: add note on what formats have +smart by default. 2017-12-14 12:54:37 -08:00
John MacFarlane
b94f1e2045 RST reader: more accurate parsing of references.
Previously we erroneously included the enclosing
backticks in a reference ID (closes #4156).

This change also disables interpretation of
syntax inside references, as in docutils.
So, there is no emphasis in

    `my *link*`_
2017-12-14 12:48:43 -08:00
John MacFarlane
3361f85f8e
Merge pull request #4148 from stencila/jats-figures
fig, table-wrap & caption Divs for JATS writer
2017-12-14 13:45:23 -07:00
John MacFarlane
7888f49342 Markdown reader: be pickier about table captions.
A caption starts with a `:` which can't be followed
by punctuation.  Otherwise we can falsely interpret
the start of a fenced div, or even a table header line
like `:--:|:--:`, as a caption.
2017-12-14 12:03:14 -08:00
Hamish Mackenzie
fa0241592c Deduplicate JATS writer image mime type code 2017-12-14 18:39:45 +13:00
John MacFarlane
17b667ec26 Update latex template to work with recent versions of beamer.
The old template produced numbered sections with some recent
versions of beamer.

Thanks to Thomas Hodgson.
2017-12-13 21:17:13 -08:00
John MacFarlane
935b16b38a Removed whitespace at ends of line. 2017-12-13 20:48:24 -08:00
John MacFarlane
52a8116e71
Merge pull request #4153 from tarleb/unify-lua-init
Unify lua initalization
2017-12-13 21:42:06 -07:00
Jesse Rosenthal
440533643e Docx writer: Add tests for list continuation. 2017-12-13 15:16:44 -05:00
Jesse Rosenthal
3c7a3d378c Docx writer: Continue lists after interruption.
Docx expects that lists will continue where they left off after an
interruption and introduces a new id if a list is starting again. So
we keep track of the state of lists and use them to define a "start"
attribute, if necessary.

Closes #4025
2017-12-13 15:16:17 -05:00
Albert Krewinkel
4c64af4407
Custom writer: use init file to setup Lua interpreter
The same init file (`data/init`) that is used to setup the Lua
interpreter for Lua filters is also used to setup the interpreter of
custom writers.lua.
2017-12-13 21:15:41 +01:00
Albert Krewinkel
f9d0e1c89c
Lua filters: drop unused code, language extensions 2017-12-13 19:54:57 +01:00
Albert Krewinkel
0abb9bdc54
Custom writer: define instances for newtype wrapper
The custom writer used its own `ToLuaStack` instance definitions, which
made it difficult to share code with Lua filters, as this could result
in conflicting instances. A `Stringify` wrapper is introduced to avoid
this problem.
2017-12-13 19:54:50 +01:00
Georger Araújo
ce73dec833 Delete removed -S option from command in epub.md (#4151)
Because `--smart/-S` has been removed.
Maybe ` -f markdown+smart` shoud also be added?
2017-12-13 11:28:16 -07:00
John MacFarlane
d9cdce4281 Markdown reader: always use four space rule for example lists.
It would be awkward to indent example list contents to the
first non-space character after the label, since example
list labels are often long.

Thanks to Bernhard Fisseni for the suggestion.
2017-12-13 10:20:57 -08:00