Commit graph

6430 commits

Author SHA1 Message Date
John MacFarlane
52a57a5362 LaTeX writer: don't emit [<+->] unless beamer output,
even if `writerIncremental` is True.

See #5072.
2018-11-12 09:43:12 -08:00
John MacFarlane
5bc38a741b Exactly match GitHub's identifier generating algorithm.
See #5057.
2018-11-11 20:45:38 -08:00
John MacFarlane
a36d202e86 Text.Pandoc.Shared: add parameter to uniqueIdent, inlineListToIdentifier.
The parameter is Extensions. This allows these functions to
be sensitive to the settings of `Ext_gfm_auto_identifiers` and
`Ext_ascii_identifiers`.

This allows us to use `uniqueIdent` in the CommonMark reader,
replacing some custom code.

It also means that `gfm_auto_identifiers` can now be used
in all formats.

Semantically, `gfm_auto_identifiers` is now a modifier of
`auto_identifiers`; for identifiers to be set, `auto_identifiers`
must be turned on, and then the type of identifier produced
depends on `gfm_auto_identifiers` and `ascii_identifiers` are set.

Closes #5057.
2018-11-11 13:46:23 -08:00
John MacFarlane
ca17ae5246 Remove ascii_identifiers from githubMarkdownExtensions.
GitHub doesn't seem to strip non-ascii characters.
2018-11-11 11:04:34 -08:00
John MacFarlane
6b4b7a4ba3 Clean up toIdent in CommonMark reader.
This partially addresses #5057, fixing a bad interaction between
the `ascii_identifiers` extension and the `gfm_auto_identifiers`
extension, and creating identifiers that match the ones GitHub
produces.

This code still needs to be put somewhere common, so the
`gfm_auto_identifiers` extension will work with other formats.
2018-11-11 10:33:04 -08:00
Albert Krewinkel
73ccc7f3d0
Fix CPP conditional for TH pragma
The condition was from an earlier version.
2018-11-11 14:10:53 +01:00
Alexander Krotov
2f583dab9d Remove Functor and Applicative constraints where Monad already exists 2018-11-08 14:41:07 +03:00
John MacFarlane
846e231d18
Merge pull request #5054 from lierdakil/docx-image-bookmarks
Docx image and code block bookmarks
2018-11-07 15:29:09 -08:00
John MacFarlane
65ca95eeea Texinfo writer: add blank line before @menu section.
Closes #5055.
2018-11-07 15:27:02 -08:00
Albert Krewinkel
ff55530c03
T.P.App: fix regression in output format heuristics
This fix is necessary due to a rebasing error introduced in commit
418bd42df8
2018-11-07 21:36:36 +01:00
Albert Krewinkel
12f6cf13ad
T.P.App: extract submodule T.P.App.FormatHeuristics
Format guessing is used for input and output options and should be
shared.
2018-11-07 21:29:48 +01:00
Nikolay Yakimov
d3c8acd07b
[Docx Writer] Add bookmarks to code blocks 2018-11-07 23:17:35 +03:00
Nikolay Yakimov
06e207c662
[Docx Writer] Add bookmarks to images 2018-11-07 23:17:26 +03:00
Nikolay Yakimov
c6e85178e5
[Docx Writer] Refactor common bookmark creation code into a function 2018-11-07 23:16:24 +03:00
Albert Krewinkel
62a5f6fa85 ICML writer: fix missing type signature warning 2018-11-07 09:52:12 +01:00
John MacFarlane
6619b96dd7 Text.Pandoc.Pretty: don't render BreakingSpace at end of line...
or beginning of line.

Closes #5050.
2018-11-06 22:54:43 -08:00
John MacFarlane
985db7b0a8 ICML writer: consolidate adjacent strings, inc. spaces.
This avoids chunking up the output unnecessarily into
separate elements.
2018-11-06 22:54:25 -08:00
Albert Krewinkel
dae3a0e3d2
T.P.App: extract Opt into separate module
The new Opt module has only a few dependencies. This is important for
compile-times during development, as Template Haskell containing modules
are be recompiled whenever a (transitive) dependency changes.
2018-11-06 21:31:12 +01:00
John MacFarlane
8c61fe8d6a Use DERIVE_JSON_VIA_TH in Text.Pandoc.Filter.
Previously AVOID_TEMPLATE_HASKELL was used (with the opposite
valence).  I assume this was a leftover from an earlier version.
2018-11-05 15:06:55 -08:00
Alexander Krotov
6a5661da63 hlint Muse writer 2018-11-06 00:04:33 +03:00
John MacFarlane
f14396011e CommonMark writer: make sure --ascii affects quotes, super/subscript. 2018-11-05 09:55:15 -08:00
quasicomputational
a747268823 CommonMark writer: respect --ascii (#5043) 2018-11-05 09:33:10 -08:00
John MacFarlane
511d647290 XML: toHtml5Entities: prefer shorter entities...
when there are several choices for a particular character.
2018-11-04 22:15:53 -08:00
Alexander Krotov
0c84630549 Muse writer: add support for --reference-location=
Address #107
2018-11-05 08:42:52 +03:00
Albert Krewinkel
dc150df8e1
Add cabal flag derive_json_via_th
Disabling the flag will cause derivation of ToJSON and FromJSON
instances via GHC Generics instead of Template Haskell. The flag is
enabled by default, as deriving via Generics can be slow (see #4083).
2018-11-04 20:51:08 +01:00
John MacFarlane
7ac9c39996 AsciiDoc writer: prevent illegal nestings.
In asciidoc you can only have level n+1 headers directly under
level n headers.
2018-11-03 12:22:01 -07:00
John MacFarlane
2f65263851 AsciiDoc writer: use single-line section headers.
The underline style is now deprecated.
Previously `--atx-headers` would enable the single-line
style; now the single-line style is always used.

Closes #5038.
2018-11-03 12:03:05 -07:00
Alexander Krotov
9a004b86c9 Vimwiki reader: parse Text without converting to [Char] 2018-11-03 10:17:32 -07:00
Alexander Krotov
5686bdfc97 Creole reader: parse Text without converting to [Char] 2018-11-03 10:17:32 -07:00
Alexander Krotov
e5cc24fb61 Make readWithM accept Text input as well as String (API change) 2018-11-03 10:17:32 -07:00
Alexander Krotov
95eccb94b0 Add Text.Pandoc.Shared.ToString typeclass (API change) 2018-11-03 10:16:47 -07:00
Albert Krewinkel
418bd42df8 App: extract output settings into module 2018-11-03 10:07:47 -07:00
Albert Krewinkel
fd3c8cd8c7 App: extract command line options to separate module 2018-11-03 10:07:47 -07:00
John MacFarlane
2f6e4ba84a Man reader: table improvements. 2018-11-02 23:38:49 -07:00
John MacFarlane
2843ee960f Man reader: allow .SS to have blank contents. 2018-11-02 23:38:39 -07:00
John MacFarlane
bcfc66092a Roff reader: Don't require global table options. 2018-11-02 23:18:08 -07:00
John MacFarlane
30dbd6a981 Roff reader: tbl improvements. 2018-11-02 23:06:50 -07:00
John MacFarlane
9719b0c74c Roff reader: Handle 'H' modifier after '.TS'. 2018-11-02 22:58:25 -07:00
John MacFarlane
d18d9623b1 Roff reader: conditionals: allow .\} to end group. 2018-11-02 22:50:18 -07:00
John MacFarlane
65129f33fd Roff reader: reinstate column check for macros.
If .TS occurs in a table cell, this shouldn't
start a table.

We make an exception for the line after .if or .ie.
2018-11-02 22:42:58 -07:00
John MacFarlane
165e3bfffc Roff reader: another fix for conditionals. 2018-11-02 21:55:22 -07:00
John MacFarlane
8ee69c230b Roff reader: fixed small issue with conditionals. 2018-11-02 21:43:02 -07:00
John MacFarlane
805b9f8a12 Roff reader: Improved handling of custom strings as arguments.
Added test.
2018-11-02 21:35:49 -07:00
John MacFarlane
e95aeeafb8 Roff reader: expand strings in font commands.
Closes #5039.
2018-11-02 21:25:52 -07:00
John MacFarlane
aca87bb379 Revert "Revert "Revert "Roff reader: custom Stream type."""
This reverts commit 9a0333e489.
2018-11-02 20:43:13 -07:00
John MacFarlane
6b7a7adcbf Fix readWithM with Stream. 2018-11-02 20:26:36 -07:00
John MacFarlane
9a0333e489 Revert "Revert "Roff reader: custom Stream type.""
This reverts commit a64063af62.
2018-11-02 19:48:42 -07:00
John MacFarlane
a64063af62 Revert "Roff reader: custom Stream type."
This reverts commit 211f7ffc78.

We were getting stack overflows.  Not sure why.
2018-11-02 18:47:45 -07:00
John MacFarlane
211f7ffc78 Roff reader: custom Stream type.
So far, this is just a shell.  But it will allow us to
expand macro strings while getting tokens, when we add
a custom uncons instance.
2018-11-02 18:47:27 -07:00
John MacFarlane
c721d28c33 T.P.Parsing: Generalize readWithM to any Char Stream.
[API change]
2018-11-02 18:23:46 -07:00