Commit graph

5060 commits

Author SHA1 Message Date
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
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
John MacFarlane
7093a3b44c Markdown: Improved computation of relative cell widths in pipe tables. 2017-12-12 15:36:29 -08:00
John MacFarlane
e86c337356 Pipe tables: use full text width for tables with wrapping cells.
Previously we computed the column sizes based on the ratio
between the header lines and the text width (as set by `--columns`).
This meant that tables with very short header lines would be
very narrow. With this change, pipe tables with wrapping cells will
always take up the whole text width. The relative column widths
will still be determined by the ratio of header lines, but they
will be normalized to add up to 1.0.
2017-12-12 15:16:16 -08:00
Hamish Mackenzie
ec1693505c fig, table-wrap & caption Divs for JATS writer
Support writing <fig> and <table-wrap> elements with <title> and
<caption> inside them by using Divs with class set to on of
fig, table-wrap or cation.  The title is included as a Heading
so the constraint on where Heading can occur is also relaxed.

Also leaves out empty alt attributes on links.
2017-12-13 12:06:22 +13:00
John MacFarlane
51c0ae5a66 --pdf-engine-opt: fix bug where option order was reversed.
Closes #4137.
2017-12-11 07:55:24 -08:00
Jesse Rosenthal
be6b43b14c Fix comment that confused compiler. 2017-12-11 07:00:17 -05:00
Jesse Rosenthal
8fd51e12ef Remove redundant imports from Docx writer.
These were a result of moving functions to the OOXML module.
2017-12-11 07:00:17 -05:00
Jesse Rosenthal
b212a51062 Integrate Powerpoint writer into pandoc. 2017-12-11 07:00:17 -05:00
Jesse Rosenthal
da4703236d Add Powerpoint writer.
This imports the essential Powerpoint writer.

It works following the standard Pandoc conventions for making other
sorts of slides. At the moment, there are still these TODOs:

1. Syntax highlighting is not yet implemented. (This is difficult
   because there are no character classes in Powerpoint.)

2. Footnotes and Definition lists are not yet implemented. (Notes will
   usually take the form of a final slide.

3. Image placement and auto-resizing has a few glitches.

4. Reference powerpoint files don't work dependably from the command
   line. This will be implemented, but at the moment users are advised
   to change themes from within Powerpoint.
2017-12-11 07:00:17 -05:00
Jesse Rosenthal
8cd0ebe303 Add necessary powerpoint functions to Class. 2017-12-11 07:00:17 -05:00
Jesse Rosenthal
6cc673dbab Create shared OOXML writer file.
This is for functions used by both Powerpoint and Docx writers.
2017-12-11 07:00:17 -05:00
John MacFarlane
5e039d913f Changes for skylighting-0.5.
This fixes a bug in 2.0.4, whereby pandoc could not
read the theme files generated with `--print-highlight-style`.

It also fixes some CSS issues involving line numbers.
Highlighted code blocks are now enclosed in a div with class
sourceCode.

Highlighting CSS no longer sets a generic color for pre
and code; we only set these for class `sourceCode`.

This will close #4133 and #4128.
2017-12-10 21:13:05 -08:00
Albert Krewinkel
1cd785fe33
Lua filters: fix package loading for Lua 5.1
The list of package searchers is named `package.loaders` in Lua 5.1 and
LuaJIT, and `package.searchers` in Lua 5.2 and later.
2017-12-10 21:43:57 +01:00
John MacFarlane
544494d0e2 Man writer: omit internal links.
That is, just print the link text without the url.

Closes #4136.
2017-12-09 14:09:00 -08:00
John MacFarlane
67b6abc806 LaTeX reader: fix \ before newline.
This should be a nonbreaking space, as long as it's not
followed by a blank line. This has been fixed at the tokenizer
level.

Closes #4134.
2017-12-08 16:34:15 -08:00
John MacFarlane
f6007e7146 Markdown reader: accept processing instructions as raw HTML.
Closes #4125.
2017-12-06 16:05:50 -08:00
Albert Krewinkel
4066a385ac
Lua filters: use script to initialize the interpreter
The file `init.lua` is used to initialize the Lua interpreter which is
used in Lua filters. This gives users the option to require libraries
which they want to use in all of their filters, and to extend default
modules.
2017-12-06 22:50:56 +01:00
Albert Krewinkel
d5b1c7b767
Lua filters: refactor lua module handling
The integration with Lua's package/module system is improved: A
pandoc-specific package searcher is prepended to the searchers in
`package.searchers`. The modules `pandoc` and `pandoc.mediabag` can now
be loaded via `require`.
2017-12-02 23:07:29 +01:00
Alexander Krotov
e536c4d9c9 hlint Muse reader and tests 2017-12-06 19:38:25 +03:00
Alexander Krotov
3ae359721d Muse reader: don't allow emphasis to be preceded by letter 2017-12-06 19:04:35 +03:00
Alexander Krotov
12789fd42a Muse reader: support multiline directives in Amusewiki mode 2017-12-05 12:59:28 +03:00
John MacFarlane
fac3953abf Markdown reader: Don't parse native div as table caption.
Closes #4119.
2017-12-04 15:04:47 -08:00
John MacFarlane
ae60e0196c Add empty_paragraphs extension.
* Deprecate `--strip-empty-paragraphs` option.  Instead we now
  use an `empty_paragraphs` extension that can be enabled on
  the reader or writer.  By default, disabled.

* Add `Ext_empty_paragraphs` constructor to `Extension`.

* Revert "Docx reader: don't strip out empty paragraphs."
  This reverts commit d6c58eb836.

* Implement `empty_paragraphs` extension in docx reader and writer,
  opendocument writer, html reader and writer.

* Add tests for `empty_paragraphs` extension.
2017-12-04 14:56:57 -08:00
Alexander Krotov
ed261e5832 Muse reader: add underline support in Emacs Muse mode 2017-12-04 15:59:26 +03:00
John MacFarlane
45a46bf900 Removed unnecessary import. 2017-12-03 20:25:04 -08:00
John MacFarlane
d25017fc70 commonmark/gfm writer: use raw html for native divs/spans.
This allows a pandoc markdown native div or span to be
rendered in gfm using raw html tags.
2017-12-03 12:29:57 -08:00
John MacFarlane
5d0863d198 HTML writer: export tagWithAttributes.
This is a helper allowing other writers to create single
HTML tags.
2017-12-03 12:25:23 -08:00
John MacFarlane
0a091f1463 commonmark/gfm writer: implement raw_html and raw_tex extensions.
Note that `raw_html` is enabled by default for `gfm`, while
`raw_tex` is disabled by default.
2017-12-03 11:45:22 -08:00
John MacFarlane
92c527713b Docx writer: allow empty paragraphs.
See #2252.

This also changes fixDisplayMath from Text.Pandoc.Writers.Shared
so that it no longer produces empty Para as an artifact.
(That was the original reason the writer omitted them.)
2017-12-02 17:17:39 -08:00
John MacFarlane
d6c58eb836 Docx reader: don't strip out empty paragraphs.
We now have the `--strip-empty-paragraphs` option for that,
if you want it.  Closes #2252.

Updated docx reader tests.

We use stripEmptyParagraphs to avoid changing too
many tests.  We should add new tests for empty paragraphs.
2017-12-02 16:51:31 -08:00
John MacFarlane
f4b86a1bc2 Shared.blocksToInlines: rewrote using builder.
This gives us automatic normalization, so we don't get
for example two consecutive Spaces.
2017-12-02 16:28:20 -08:00
John MacFarlane
7b8c2b6691 Add --strip-empty-paragraphs option.
This works for any input format.
2017-12-02 15:21:59 -08:00
John MacFarlane
22eb15ec35 LaTeX writer: escape _ in code with --listings. 2017-12-02 10:31:58 -08:00
John MacFarlane
1193c1a505 LaTeX writer: allow specifying just width or height for image size.
Previously both needed to be specified (unless the image was
being resized to be smaller than its original size).

If height but not width is specified, we now set width to
textwidth (and similarly if width but not height is specified).
Since we have keepaspectratio, this yields the desired result.
2017-12-01 21:18:29 -08:00
John MacFarlane
29ec13184d LaTeX writer: escape ~ in code with --listings.
Closes #4111.
2017-12-01 17:17:26 -08:00
John MacFarlane
b2a190546d Revert "LaTeX writer: Add keepaspectratio to includegraphics..."
This reverts commit 171187a452.
2017-12-01 13:51:33 -08:00
Albert Krewinkel
6640506ddc
Lua/StackInstances: push Pandoc and Meta via constructor
Pandoc and Meta elements are now pushed by calling the respective
constructor functions of the pandoc Lua module. This makes serialization
consistent with the way blocks and inlines are pushed to lua and allows
to use List methods with the `blocks` value.
2017-12-01 17:58:12 +01:00
Albert Krewinkel
8473a151c5
List.lua: add missing fixes as discussed in #4099
The changes were missing due to an error while using git.
2017-12-01 17:12:56 +01:00
John MacFarlane
171187a452 LaTeX writer: Add keepaspectratio to includegraphics...
...if only one of height/width is given.
2017-11-30 16:03:28 -08:00
John MacFarlane
03ddac451e Support beamer \alert in LaTeX reader. Closes #4091. 2017-11-29 21:30:13 -08:00
John MacFarlane
a276bb0a8a Let papersizes a0, a1, a2, ... be case-insensitive in LaTeX and ConTeXt. 2017-11-29 09:45:38 -08:00
Alexander Krotov
7751391fce Muse reader: correctly remove indentation from notes
Exactly one space is required and considered to be part of the marker.
2017-11-29 05:12:25 +03:00
Albert Krewinkel
0105a3c293 Add basic lua List module (#4099)
The List module is automatically loaded, but not assigned to a global
variable. It can be included in filters by calling `List = require
'List'`.

Lists of blocks, lists of inlines, and lists of classes are now given
`List` as a metatable, making working with them more convenient. E.g.,
it is now possible to concatenate lists of inlines using Lua's
concatenation operator `..` (requires at least one of the operants to
have `List` as a metatable):

    function Emph (emph)
      local s = {pandoc.Space(), pandoc.Str 'emphasized'}
      return pandoc.Span(emph.content .. s)
    end

Closes: #4081
2017-11-28 17:20:01 -07:00
John MacFarlane
845b6c8670 Added --print-highlight-style option.
This generates a JSON version of a highlighting style, which can be
saved as a .theme file, modified, and used with `--highlight-style`.

Closes #4106.
Closes #4096.
2017-11-28 13:35:49 -08:00
John MacFarlane
00561b1bb9 Support --webtex for gfm output. 2017-11-28 10:56:32 -08:00
Mauro Bieg
393ce6f1e3 make normalizeDate more forgiving (#4101)
also parse two-digit days, e.g. "April 20, 2017"
2017-11-28 11:15:35 -07:00
Mauro Bieg
de75d4eaf9 Fix --help output for --highlight-style to include FILE (#4098)
Closes #4095.
2017-11-27 18:30:53 -07:00
Alexander Krotov
c2993a6fc6 Muse reader: parse "~~" as non-breaking space in Emacs mode 2017-11-27 12:25:06 +03:00
John MacFarlane
a1378ed76b Clearer deprecation warning for --latexmathml, --asciimathml, -m.
Previously we only mentioned `--latexmathml`, even if `-m` was
used.
2017-11-26 22:31:32 -08:00
Alexander Krotov
00004f042c Muse reader: make code blocks round trip 2017-11-27 04:54:23 +03:00
Alexander Krotov
bdad8c1d69 Muse reader: drop common space prefix from list items 2017-11-26 22:14:18 +03:00
Alexander Krotov
5ba890a973 Fix comment typo: s/elemnet/element/ 2017-11-25 22:47:29 +03:00
Alexander Krotov
ea2ea455b3 Muse reader: don't interpret XML entities 2017-11-25 22:46:25 +03:00
Alexander Krotov
887977c421 Muse reader: remove nested 2017-11-25 18:59:03 +03:00
Alexander Krotov
77af25b4c3 Muse reader: parse markup in definition list terms 2017-11-24 14:02:43 +03:00
Alexander Krotov
137c7c2a65 Muse reader: allow definition to end with EOF 2017-11-24 13:16:09 +03:00
Alexander Krotov
bd3feb864f Muse writer: improve inline normalization 2017-11-24 12:35:25 +03:00
Alexander Krotov
0cfd764d27 Muse: move inline list normalization to writer 2017-11-24 12:17:20 +03:00
Albert Krewinkel
cd85c73ded
Org reader: allow empty list items
Fixes: #4090
2017-11-22 22:53:24 +01:00
Alexander Krotov
75e2a1104c Muse reader: allow list items to be empty 2017-11-22 18:49:07 +03:00
Alexander Krotov
454062eccd Muse writer: escape hash symbol 2017-11-22 16:17:30 +03:00
Alexander Krotov
87e10ac28b Muse reader: don't allow blockquotes within lists 2017-11-22 15:22:39 +03:00
Alexander Krotov
e32657a671 Muse reader: fix reading of multiline definitions 2017-11-22 14:59:14 +03:00
Alexander Krotov
7e42857ed8 Muse writer: escape "----" to avoid accidental horizontal rules 2017-11-22 01:39:20 +03:00
Alexander Krotov
351765d4ad Muse reader: concatenate inlines of the same type 2017-11-22 01:22:43 +03:00
Alexander Krotov
df3a80cc97 Muse writer: escape only </code> inside code tag
Additional <verbatim> is not needed as <code> is verbatim already.
2017-11-22 01:22:43 +03:00
Jasper Van der Jeugt
cf87ffe9ee Change Generic JSON instances to TemplateHaskell (#4085) 2017-11-21 12:27:40 -08:00
John MacFarlane
fda4426883 Add comment explaining why TH is used in Text.Pandoc.App. 2017-11-21 09:22:06 -08:00
Jasper Van der Jeugt
30c1e53c42 Change JSON instances for Opt to TemplateHaskell (#4083)
The `Generic` JSON instances for `Text.Pandoc.App.Opt` seem to tickle a
particulary bad quadratic complexity case (Generics complexity is worse
than quadratic with respect to the number of fields in the datatype).
This is with GHC-8.2.1, I didn't test it using 8.0 but I assume it is
similar.

Using `Generic`, compilation of the `Text.Pandoc.App` module takes
minutes and often gets killed due to out of memory on slower machines
with "only" 8GB of accessible memory.  This is particularly annoying to
me since it means I cannot build pandoc on Travis.

TemplateHaskell is a little uglier, but the module seems to compile
within a few seconds, and compilation doesn't take more than 1GB of
memory.

Should I also change the other JSON instances throughout the codebase
for consistency?
2017-11-21 09:20:05 -08:00
Alexander Krotov
6c17117ef2 Muse reader: add inline <literal> support 2017-11-21 19:53:55 +03:00
Alexander Krotov
046f5bcc81 Muse reader: chop newlines after <literal> and before </literal> 2017-11-21 19:01:53 +03:00
Alexander Krotov
91d6733426 Muse reader: <literal> has "style" attribute, not "format" 2017-11-21 19:01:53 +03:00
Alexander Krotov
1b970cca13 Recognize ".muse" file extension 2017-11-21 14:08:14 +03:00
John MacFarlane
97efed8c23 Allow spaces after \( and before \) with tex_math_single_backslash.
Previously `\( \frac{1}{a} < \frac{1}{b} \)` was not parsed as math
in `markdown` or `html` `+tex_math_single_backslash`.
2017-11-19 13:06:03 -08:00
Alexander Krotov
82bcda80c6 Muse reader: count only one space as part of list item marker 2017-11-19 04:40:00 +03:00
Alexander Krotov
163af3fdee Muse reader: produce SoftBreaks on newlines
Now wrapping can be preserved with --wrap=preserve
2017-11-19 02:37:52 +03:00
John MacFarlane
b9cdef03f0 HTML reader: ensure we don't produce level 0 headers,
even for chapter sections in epubs.

This causes problems because writers aren't set up to
expect these.

This fixes the most immediate problem in #4076.
It would be good to think more about how to propagate
the information that top-level headers are chapters
from the reader to the writer.
2017-11-18 14:08:45 -08:00
Albert Krewinkel
53aafd6643 Lua filters: preload text module (#4077)
The `text` module is preloaded in lua. The module contains some UTF-8
aware string functions, implemented in Haskell.  The module is loaded on
request only, e.g.:

    text = require 'text'
    function Str (s)
      s.text = text.upper(s.text)
      return s
    end
2017-11-18 13:24:06 -08:00
Alexander Krotov
6018a2324d Muse reader: Add Text::Amuse footnote extensions
Footnote end is indicated by indentation,
so footnotes can be placed anywhere in the text,
not just at the end of it.
2017-11-18 23:43:02 +03:00
Alexander
26e59b331f Introduce HasSyntaxExtensions typeclass (#4074)
+ Added new `HasSyntaxExtensions` typeclass for `ReaderOptions` and `WriterOptions`.
+ Reimplemented `isEnabled` function from `Options.hs` to accept both `ReaderOptions`
  and `WriterOptions`.
+ Replaced `enabled` from `CommonMark.hs` with new `isEnabled`.
2017-11-16 09:24:02 -08:00
Sascha Wilde
4e02ed5f5c Creole reader: Fix performance issue for longer lists. (#4075)
Fixes #4067.
2017-11-15 17:38:11 -08:00
John MacFarlane
508aab0bd5 Text.Pandoc.Parsing.uri: allow & and = as word characters.
This fixes a bug where pandoc would stop parsing a URI with an
empty attribute:  for example, `&a=&b=` wolud stop at `a`.
(The uri parser tries to guess which punctuation characters
are part of the URI and which might be punctuation after it.)

Closes #4068.
2017-11-14 22:08:14 -08:00
John MacFarlane
22d69c8916 RST reader: better support for 'container' directive.
Create a div, incorporate name attribute and classes.

Closes #4066.
2017-11-14 21:20:30 -08:00
John MacFarlane
c2a68ad763 EPUB writer: Fixed path for cover image.
It was previously `media/media/imagename`, and should have
been `media/imagename`.
2017-11-14 21:06:24 -08:00
John MacFarlane
d29ef39f6f EPUB writer: fix paths for cover image.
Closes #4069.
2017-11-14 20:57:41 -08:00
John MacFarlane
51897937cd LaTeX reader: allow optional arguments on \footnote.
Closes #4062.
2017-11-13 21:19:38 -08:00
John MacFarlane
8d6e0e516a Markdown writer: fix bug with doubled footnotes in grid tables.
Closes #4061.
2017-11-13 21:12:04 -08:00
Alexander Krotov
3a83b3843d Replace "emacs" extension with "amuse" extension
It makes clear that extension is related to Muse markup.
2017-11-13 18:41:49 +03:00
John MacFarlane
b85921259d Fix comment that confuses haddock. 2017-11-12 16:51:49 -08:00
John MacFarlane
eeaa3b048c LaTeX reader: support column specs like *{2}{r}.
This is equivalent to `rr`.  We now expand it like a macro.

Closes #4056.
2017-11-12 14:46:29 -08:00
John MacFarlane
7ba0ae8b4d LaTeX reader: allow optional args for parbox.
See #4056.
2017-11-12 14:19:58 -08:00
Alexander Krotov
df4cb20f29 Muse reader: accept Emacs Muse definition lists
Emacs Muse does not require indentation.
2017-11-12 18:08:41 +03:00
Alexander Krotov
f13f142945 Add emacs extension 2017-11-12 16:06:22 +03:00
John MacFarlane
6094c84b7a Functor instance to fix ghc 7.8 warning. 2017-11-11 21:13:43 -08:00
John MacFarlane
6174b5bea5 Add lua filter functions to walk inline and block elements.
Refactored some code from Text.Pandoc.Lua.PandocModule
into new internal module Text.Pandoc.Lua.Filter.

Add `walk_inline` and `walk_block` in pandoc lua module.
2017-11-11 14:41:11 -08:00
John MacFarlane
fb5ba1bb00 Fixed YAML metadata with "chomp" (|-).
Previously if a YAML block under `|-` contained
a blank line, pandoc would not parse it as metadata.
2017-11-11 10:17:53 -05:00
Alexander Krotov
f501ad031d MediaWiki reader: hlint 2017-11-11 03:12:15 +03:00
Alexander Krotov
6e832a571b Txt2Tags reader: hlint 2017-11-10 14:48:11 +03:00
Alexander Krotov
207b3edcb9 Vimwiki reader: hlint 2017-11-10 13:26:39 +03:00
John MacFarlane
1592d38821 Allow fenced code blocks to be indented 1-3 spaces.
This brings our handling of them into alignment with
CommonMark's.

Closes #??.
2017-11-09 23:22:44 -05:00
Alexander Krotov
f72d763655 HTML reader: hlint 2017-11-10 02:23:58 +03:00
John MacFarlane
fef5770591 Fix regression with --metadata.
It should replace a metadata value set in the document
itself, rather than creating a list including a new value.

Closes #4054.
2017-11-08 21:54:23 -08:00
John MacFarlane
c6338fa883 EPUB writer: fixed modified paths for raw HTML tags
(src, poster, etc.)  This had not been updated for the
new EPUB container layout, with a separate text/ subdirectory.
Closes #4050. Closes #4055.
2017-11-08 17:07:27 -08:00
John MacFarlane
5a4c0d6a8c Deprecated ancient HTML math methods.
`--latexmathml`,
`--gladtex`,
`--mimetex`,
`--jsmath`
2017-11-07 13:05:06 -08:00
John MacFarlane
b0b90aba62 EPUB writer: fixed EPUB OCF structure.
The structure of the EPUBs was messed up, and #3720 was
improperly implemented.  This commit fixes things.
2017-11-07 12:24:37 -08:00
John MacFarlane
36449d3ea4 EPUB writer: fix image paths with empty --epub-subdirectory. 2017-11-07 08:30:52 -08:00
Alexander Krotov
38ad0b3204 Spellcheck comments 2017-11-06 06:56:21 +03:00
John MacFarlane
8e8d7802ee Logging: issue INFO, not WARNING, if LaTeX .sty file can't be read.
Normally this is not a situation requiring a fix from the user,
so a warning is inappropriate.
2017-11-04 17:07:55 -07:00
John MacFarlane
fe42c175eb Revert "Better indentation under headers in org mode output."
This reverts commit 1a81751cef.
2017-11-04 11:32:47 -07:00
John MacFarlane
1a81751cef Better indentation under headers in org mode output.
See #4036.

Close examination by org experts needed, to ensure that
nothing breaks.
2017-11-04 11:25:38 -07:00
John MacFarlane
8e53489cbc Fix strikethrough in gfm writer.
Previously we got a crash, because we were trying to print
a native cmark STRIKETHROUGH node, and the commonmark writer
in cmark-github doesn't support this.  Work around this by
using a raw node to add the strikethrough delimiters.

Closes #4038.
2017-11-04 10:35:52 -07:00
John MacFarlane
642d603666 Improved support for columns in HTML.
* Move as much as possible to the CSS in the template.
* Ensure that all the HTML-based templates (including epub)
  contain the CSS for columns.
* Columns default to 50% width unless they are given a width
  attribute.

Closes #4028.
2017-11-02 20:57:05 -07:00
John MacFarlane
5dfe131ee0 Support lineAnchors (or line-anchors) in code blocks, for HTML. 2017-11-02 16:38:06 -07:00
John MacFarlane
856587ff63 Use latest skylighting; ensure no duplicate ids on code lines.
The line identifiers are built using the code block's identifier
as a prefix. If the code block has null identifier, we use
"cb1", "cb2", etc.

Closes #4031.
2017-11-02 16:03:40 -07:00
John MacFarlane
6d00e6e8c3 Fixed revealjs slide column width issues.
* Remove "width" attribute which is not allowed on div.
* Remove space between `<div class="column">` elements,
  since this prevents columns whose widths sum to 100%
  (the space takes up space).

Closes #4028.
2017-11-02 10:23:04 -07:00
Alexander Krotov
a553baf3a4 hlint 2017-11-02 15:28:53 +03:00
John MacFarlane
52e372b71d SelfContained: use base64 for css links with media attribute.
This fixes `--self-contained` with s5.  Closes #4026.
2017-11-01 17:42:33 -07:00
John MacFarlane
ed3d466384 Really fix #3989.
The previous fix only worked in certain cases.
Other cases with `>` in an HTML attribute broke.
2017-11-01 09:27:51 -07:00
Alexander Krotov
00b64f337d hlint 2017-11-01 14:40:10 +03:00
Alexander Krotov
3cee9c8976 FB2 writer: Add "unrecognised" genre to <title-info>
XML schema requires at least one genre.
2017-11-01 13:31:16 +03:00
Alexander Krotov
8a5541dca8 FB2 writer: remove <annotation> from <body>
<annotation> is not allowed inside <body> according to FictionBook2 XML schema. Besides that, the same information is already placed inside <description>.

Related bug: #2424
2017-11-01 13:08:52 +03:00
John MacFarlane
9b513b8a7a
Merge pull request #4009 from mb21/html-class-names
HTML Writer: consistently use dashed class-names
2017-11-01 00:39:08 -04:00
John MacFarlane
eef8118af0
Merge pull request #4008 from labdsf/fb2-bullets
FB2 writer: make bullet lists consistent with ordered lists
2017-11-01 00:38:02 -04:00
John MacFarlane
32f6938605 Properly pass through author metadata in JATS writer.
Closes #4020.
2017-10-31 21:27:08 -07:00
John MacFarlane
fb6e5812bc Fixed regression in parsing of HTML comments in markdown...
and other non-HTML formats (`Text.Pandoc.Readers.HTML.htmlTag`).
The parser stopped at the first `>` character, even if it wasn't
the end of the comment.

Closes #4019.
2017-10-31 21:14:38 -07:00
John MacFarlane
fd7e3cb18f
Merge pull request #4018 from swilde/creole-fixes
Creole Reader: fix lists with triling white space
2017-11-01 00:04:36 -04:00
Sascha Wilde
534e625ace Creole reader: fixed some minor typos and formatting. 2017-10-31 22:33:58 +01:00
John MacFarlane
0e57b8b85d Add Millimeter constructor to Dimension in ImageSize.
Minor API change.

Now sizes given in 'mm' are no longer converted to 'cm'.

Closes #4012.
2017-10-31 11:58:43 -07:00
John MacFarlane
5f9f458df3 LaTeX reader: handle % comment right after command.
For example

    \emph%
    {hi}
2017-10-31 11:31:35 -07:00
John MacFarlane
2a81ff3245 LaTeX/Beamer writer: support "blocks" inside columns and other Divs.
Example:

```

<div class="columns">
<div class="column" width="40%">
- Item
</div>
<div class="column" width="60%">
- Item
</div>
</div>
```

Closes #4016.
2017-10-31 11:07:39 -07:00
John MacFarlane
556c6c2c6d Markdown reader: make sure fenced div closers work in lists.
Previously the following failed:

    ::: {.class}
    1. one
    2. two
    :::

and you needed a blank line before the closing `:::`.
2017-10-31 10:57:20 -07:00
John MacFarlane
81610144f9 Make fenced_divs affect the Markdown writer.
If `fenced_divs` is enabled, fenced divs will be used.
2017-10-31 10:57:20 -07:00
Sascha Wilde
fa67d6e86f Creole reader: fixed lists with trailing white space. 2017-10-31 18:55:27 +01:00
Alexander Krotov
a496979c6d FB2 writer: write blocks outside of <p> in definitions 2017-10-31 20:19:00 +03:00
mb21
8d7ce0fdf0 HTML Writer: consistently use dashed class-names
see #3556
2017-10-31 10:40:16 +01:00
Alexander Krotov
94d02a6efa FB2 writer: make bullet lists consistent with ordered lists
Previously bullet lists interacted in odd way with ordered lists.
For example, bullet lists nested in ordered list had incorrect
indentation. Besides that, indentation with spaces is not rendered
by FBReader and fbless. To avoid this problem, bullet lists are
indented by appending bullets to marker just the same way it is
done for ordered lists.
2017-10-31 11:35:47 +03:00
John MacFarlane
c0e51c5710 EPUB writer: fixed filepaths for nonstandard epub-subdirectory values. 2017-10-30 17:43:08 -07:00
John MacFarlane
599d4aa032 EPUB writer fixes:
- Ensure that epub2 is recognized as a non-text format,
  so that a template is used.

- Don't include "prefix" attribute for ibooks for epub2.
  It doesn't validate.

- Fix stylesheet paths; previously we had an incorrect
  stylesheet path for the cover page and nav page.
2017-10-30 17:25:15 -07:00
John MacFarlane
90597fe292 LaTeX reader: insert space when needed in macro expansion.
Sometimes we need to insert a space after a control sequence
to prevent it merging with a following letter.

Closes #4007.
2017-10-30 11:51:49 -07:00
John MacFarlane
272b833ad5 Allow unbraced arguments for macros.
See #4007.
2017-10-30 11:35:40 -07:00
John MacFarlane
601a28fd36 Allow body of macro definition to be unbraced.
e.g.

    \newcommand\arrow\to

See #4007.
2017-10-30 10:59:52 -07:00
John MacFarlane
1e1a7a9b83 Fixed warnings. 2017-10-29 15:19:49 -07:00
John MacFarlane
6a1476e7e2 Export all of Text.Pandoc.Class from Text.Pandoc. 2017-10-29 15:00:49 -07:00
John MacFarlane
95ccbdaac2 Removed useless notes state in DokuWiki writer. 2017-10-29 14:55:22 -07:00
John MacFarlane
52ee19a825 Source code reformatting. 2017-10-29 14:29:32 -07:00
John MacFarlane
f270dd9b18 hlint suggestions. 2017-10-29 14:18:06 -07:00
John MacFarlane
271e1fe2f1 More hlint. 2017-10-29 13:19:15 -07:00
John MacFarlane
9ef4ad2e20 Small reformat. 2017-10-29 13:01:04 -07:00
John MacFarlane
b18dbfe792 Use uncurry. 2017-10-29 12:58:41 -07:00