Commit graph

7398 commits

Author SHA1 Message Date
Jesse Rosenthal
e666c92bc9 RST reader: skip whitespace before note.
RST requires a space before a footnote marker. We discard those spaces
so that footnotes will be adjacent to the text that comes before
it. This is in line with what rst2latex does. rst2html does not discard
the space, but its html output is different than pandoc's, so this seems
the most semantically correct approach.

Closes #3163
2016-10-17 09:54:59 -04:00
John MacFarlane
f8603e6df5 Bump pandoc-types versions to 1.17.0.3 in stack.yaml. 2016-10-17 15:05:38 +02:00
John MacFarlane
54d54fc57f Use pandoc-types 1.17.0.2 in stack.yaml. 2016-10-17 13:59:58 +02:00
John MacFarlane
15902b31ab Try travis build with latest dev pandoc-types. 2016-10-17 13:48:20 +02:00
John MacFarlane
e298dc2065 BUmp pandoc-types version in stack.yamls. 2016-10-17 09:57:55 +02:00
John MacFarlane
8625ff21a9 Update stack.yamls to use pandoc-types 1.17 release. 2016-10-16 22:18:03 +02:00
John MacFarlane
bd1dcd6fe8 Travis: fixed --flag argument in stack. 2016-10-16 21:54:00 +02:00
John MacFarlane
4a25342ae0 Travis: Use fast flag for aeson.
This dramatically speeds up the build, according to the
aeson changelog.
2016-10-15 14:43:39 +02:00
Albert Krewinkel
462c140eb6
Org reader: allow figure with empty caption
A `#+CAPTION` attribute before an image is enough to turn an image into a
figure. This wasn't the case because the `parseFromString` function, which
processes the caption value, would fail on empty values. Adding a newline
character to the caption value fixes this.

Fixes: #3161
2016-10-14 23:16:51 +02:00
Jesse Rosenthal
49b0b67b11 Remove Tests.Arbitrary
Use exported Arbitrary instances from pandoc-types instead.
2016-10-14 09:22:29 -04:00
John MacFarlane
9bd1da122a Merge pull request #3146 from hubertp-lshift/feature/odt-list-start-value
[ODT Parser] Include list's starting value
2016-10-14 15:15:50 +02:00
Hubert Plociniczak
9282fadc6b Added tests and a corner case for starting number
Review revealed that we didn't handle the case
when the starting point is an empty string. While
this is not a valid .odt file, we simply added
a special case to deal with it.

Also added tests for the new feature.
2016-10-14 13:56:24 +02:00
John MacFarlane
85cf7b165a Travis: test with lts-7 not lts-6. 2016-10-14 09:14:17 +02:00
John MacFarlane
8049a43800 Use latest pandoc-types in windows/stack.yaml. 2016-10-13 21:03:26 +02:00
John MacFarlane
b5c0eeb3ca Use newest pandoc-types from repo. 2016-10-13 21:01:28 +02:00
Jesse Rosenthal
cd1427876e Markdown writer: Abstract out note/ref function.
We do basically the same thing every time we insert notes, so let's cut
down on code duplication.
2016-10-13 11:04:35 -04:00
John MacFarlane
886e131949 Use latest pandoc-citeproc in stack.yamls. 2016-10-13 16:35:23 +02:00
John MacFarlane
6156cdda13 Update stack.yaml files. 2016-10-13 13:02:18 +02:00
John MacFarlane
6d13567ac5 Allow http-client 0.4.30, which is the version in stackage lts.
Previously we required 0.5.
Remove CPP conditionals for earlier versions.
2016-10-13 13:01:49 +02:00
John MacFarlane
4a1ef0b51d Revert "Remove http-client CPP conditionals."
This reverts commit 3f82471355.

We might want to revert the requirement of http-client 0.5,
as this is not yet in Stackage and that is starting to
cause problems.  I can't recall why it is there.
2016-10-13 12:35:58 +02:00
John MacFarlane
79d8056acf Document biblio-title variable in MANUAL.txt.
Cloess #258.
2016-10-13 11:57:56 +02:00
John MacFarlane
354c4ab04f Updated stack.yaml and windows/stack.yaml to use latest pandoc-types. 2016-10-13 11:51:44 +02:00
John MacFarlane
4eff607678 Merge pull request #3072 from tarleb/lineblock
Read and write LineBlock elements
2016-10-13 11:38:19 +02:00
Albert Krewinkel
63966f6375
Bump required pandoc-types version to 1.17 2016-10-13 08:46:45 +02:00
Albert Krewinkel
3e60ed9c03
Allow empty lines when parsing line blocks
Line blocks are allowed to contain empty lines and should be parsed as a
single block in that case.  Previously an empty (line block) line would
have terminated parsing of the line block element.
2016-10-13 08:46:44 +02:00
Albert Krewinkel
c9460e7013
Parse line-oriented markup as LineBlock
Markup-features focusing on lines as distinctive part of the markup are read
into `LineBlock` elements. This currently means line blocks in reStructuredText
and Markdown (the latter only if the `line_block` extension is enabled), the
`linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode
`VERSE` blocks.
2016-10-13 08:46:44 +02:00
Albert Krewinkel
22cb9e3327
Add support for the LineBlock element to writers
The following markup features are used to output the lines of the `LineBlock`
element:

  - AsciiDoc: a `[verse]` block,
  - ConTeXt: text surrounded by `\startlines` and `\endlines`,
  - HTML: `div` with an per-element style setting to interpret the content as
    pre-wrapped,
  - Markdown: line blocks if the `line_blocks` extension is enabled, a simple
    paragraph with hard linebreaks otherwise,
  - Org: VERSE block,
  - RST: a line block, and
  - all other formats: a paragraph, containing hard linebreaks between lines.

Custom lua writers should be updated to use the `LineBlock` element.
2016-10-13 08:46:44 +02:00
Albert Krewinkel
64b77cc2c5
Shared: add function combining lines using LineBreak
The `linesToBlock` function takes a list of lines and combines them by appending
a hard `LineBreak` to each line and concatenating the result, putting the result
it into a `Para`. This is most useful when dealing when converting `LineBlock`
elements.
2016-10-13 08:46:38 +02:00
Hubert Plociniczak
edc951ee7d [ODT Parser] Include list's starting value
Previously the starting value of the lists' items has been
hardcoded to 1. In reality ODT's list style definition can
provide a new starting value in one of its attributes.

Writers already handle the modified start value so no need
to change anything in that area.
2016-10-12 18:36:40 +02:00
John MacFarlane
cbeb72d06b MANUAL: Made formatting of arguments with several options consistent. 2016-10-12 11:15:08 +02:00
John MacFarlane
ced4032a35 Note on --reference-links about --reference-location. 2016-10-12 11:13:28 +02:00
John MacFarlane
901045b0bb Merge pull request #3159 from jkr/refs
Specify location for footnotes (and reference links) in MD output
2016-10-12 11:11:06 +02:00
Jesse Rosenthal
afbeba952d MANUAL.txt: document --reference-location. 2016-10-11 22:30:13 -04:00
Jesse Rosenthal
4b0dbdc118 Markdown writer: add test for note placement. 2016-10-11 22:26:03 -04:00
Jesse Rosenthal
14209b2ba0 Add reference-location options to executable. 2016-10-11 15:17:07 -04:00
Jesse Rosenthal
ca50deeeee Markdown writer: Allow footnotes/refs at the end of blocks, sections
This allows footnotes and refs to be placed at the end of blocks and
sections. Note that we only place them at the end of blocks that are at
the top level and before headers that are the top level. We add an
environment variable to keep track of this. Because we clear the
footnotes and refs when we use them, we also add a state variable to
keep track of the starting number.

Finally, note that we still add any remaining footnotes at the end. This
takes care of the final section, if we are placing at the end of a
section, and will always come after a final block as well.
2016-10-11 15:17:01 -04:00
Jesse Rosenthal
6914808139 Add ReaderT monad for environment variables.
This will make it easier to keep track of what level of block we are at.
2016-10-11 13:53:47 -04:00
Jesse Rosenthal
27113bda1f Options: Add references location.
This will be used by the markdown writer for deciding where to put links
and footnotes.
2016-10-11 13:30:01 -04:00
Albert Krewinkel
bb48f2edc4
Org reader: trim verse lines properly
An empty verse line should not result in `Str ""` but in `mempty`.
2016-10-10 21:12:47 +02:00
John MacFarlane
f4b7ab125e More checks for Ext_raw_html when rendering HTML in Markdown.
Previously we'd emit raw HTML tables even if the `raw_html`
extension was disabled.

Now we just emit `[TABLE]` if no table formats are enabled
and raw HTML is not enabled.

We also check for the `raw_html` extension before emiting
a raw HTML block.

Closes #3154.
2016-10-10 11:23:04 +02:00
John MacFarlane
5a0d91f115 Merge pull request #3156 from ickc/removing-googlecode
Delete googlecode-upload.sh
2016-10-10 10:13:01 +02:00
ickc
8b7b42eaf5 Delete googlecode-upload.sh 2016-10-09 18:07:20 -07:00
KolenCheung
be5bd22fc4 remove temporary checklist 2016-10-09 21:30:03 +02:00
KolenCheung
a06586a6fd update manual accordingly 2016-10-09 21:30:03 +02:00
KolenCheung
46be319ca9 removed mmd raw_tex in src/Text/Pandoc/Options.hs 2016-10-09 21:30:03 +02:00
KolenCheung
ea5c6200b3 add a temp file to keep track of all files involving markdown_mmd and multimarkdownExtensions 2016-10-09 21:30:03 +02:00
John MacFarlane
d8600d6627 Added a small clarification on --webtex with Markdown output.
Thanks to @ickc.
2016-10-06 11:08:52 +02:00
KolenCheung
6613359182 fix typo 2016-10-06 11:04:37 +02:00
KolenCheung
4d621f43d9 Replace Google Chart API by CodeCogs 2016-10-06 11:04:37 +02:00
Jesse Rosenthal
6d05c378d0 Docx writer: Move one more env var to Reader monad
PrintWidth is set at the beginning and stays the same throughout the
document writing, so we just set it as an env variable in the Reader
monad.
2016-10-05 08:15:55 -04:00