aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2019-10-09Change optVariables from [(String, String)] to Context Text.John MacFarlane3-26/+36
In Text.Pandoc.App.Opt [API change].
2019-10-09Options.WriterOptions: Change type of writerVariables to Context Text.John MacFarlane10-49/+126
This will allow structured values. [API change]
2019-10-08Use th to derive json instance for LineEnding.John MacFarlane1-16/+4
2019-10-07Text.Pandoc.Options: change To/FromJSON instances for...John MacFarlane2-9/+35
HTMLMathMethod, CiteMethod, ObfuscationMethod, TrackChanges, WrapOption, TopLevelDivision, ReferenceLocation, HTMLSlideVariant. In each case we use lowercase (or hyphenated lowercase) for constructors to line up more closely with command-line option values. This is a breaking change for those who manually decode or encode JSON for these data types (e.g. for ReaderOptions or WriterOptions). See #5790.
2019-10-07Shored.camelCaseToHyphenated: handle ABCDef = abc-def.John MacFarlane1-2/+8
2019-10-07Remove derive_json_via_th flag; always use TH.John MacFarlane5-94/+0
This cuts down on code duplication and reduces the chance for errors. See #4083.
2019-10-07Remove redundant import.John MacFarlane1-1/+0
2019-10-07Use typeMismatch.John MacFarlane1-1/+2
2019-10-06T.P.App.Opt: custom FromJSON instance for LineEnding.John MacFarlane1-8/+17
So either CRLF or crlf will work.
2019-10-06Opt: Change optHighlightStyle to a Maybe String instead of Maybe Style.John MacFarlane3-24/+28
Do the parsing/loading of themes later, after option parsing.
2019-10-06Code cleanupJohn MacFarlane1-19/+23
2019-10-06Text.Pandoc.App.Opt: Remove optBaseHeaderLevel from Opt.John MacFarlane3-7/+2
We now just use optShiftHeadingLevelBy, to avoid redundancy.
2019-10-06Text.Pandoc.App.Opt: Change optShiftHeadingLevel to optShiftHeadingLevelBy...John MacFarlane3-4/+4
to match the option.
2019-10-06Text.Pandoc.App.Opt: more convenient To/FromJSON instances.John MacFarlane1-5/+9
Make the field names like `strip-empty-paragraphs` rather than `optStripEmptyParagraphs`.
2019-10-04hlint Muse writerAlexander Krotov1-1/+1
2019-10-04hlint FB2 readerAlexander Krotov1-1/+1
2019-10-04Fix all hlint warnings in Muse readerAlexander Krotov1-2/+2
2019-10-04Fix compiler warnings on ghc 8.8.John MacFarlane1-21/+12
2019-10-03Minor ghc 8.8 fixups.John MacFarlane2-4/+8
2019-10-03Add additional listings languages.Wandmalfarbe1-0/+6
2019-09-29RST reader: don't strip final underscore from absolute URI.John MacFarlane1-3/+7
Partially addresses #5763.
2019-09-29Raise error on unsupported extensions. Closes #4338.John MacFarlane8-71/+259
+ An error is now raised if you try to specify (enable or disable) an extension that does not affect the given format, e.g. `docx+pipe_tables`. + The `--list-extensions[=FORMAT]` option now lists only extensions that affect the given FORMAT. + Text.Pandoc.Error: Add constructors `PandocUnknownReaderError`, `PandocUnknownWriterError`, `PandocUnsupportedExtensionError`. [API change] + Text.Pandoc.Extensions now exports `getAllExtensions`, which returns the extensions that affect a given format (whether enabled by default or not). [API change] + Text.Pandoc.Extensions: change type of `parseFormatSpec` from `Either ParseError (String, Extensions -> Extensions)` to `Either ParseError (String, [Extension], [Extension])` [API change]. + Text.Pandoc.Readers: change type of `getReader` so it returns a value in the PandocMonad instance rather than an Either [API change]. Exceptions for unknown formats and unsupported extensions are now raised by this function and need not be handled by the calling function. + Text.Pandoc.Writers: change type of `getWriter` so it returns a value in the PandocMonad instance rather than an Either [API change]. Exceptions for unknown formats and unsupported extensions are now raised by this function and need not be handled by the calling function.
2019-09-28More throwError in place of fail.John MacFarlane2-1/+3
2019-09-28Replace some more fails with throwErrors.John MacFarlane3-4/+9
2019-09-28Use throwError instead of fail when appropriate.John MacFarlane3-6/+14
2019-09-28Use Prelude.fail to avoid ambiguity with fail from GHC.Base.John MacFarlane17-38/+38
2019-09-27LogMessage: change UnknownExtension -> CouldNotDeduceFormatJohn MacFarlane3-6/+6
2019-09-24odt: Add external option for native numberingNils Carlson2-7/+8
This adds an external options +native_numbering to the ODT writer enabling enumeration of figures and tables in ODT output.
2019-09-24LaTeX reader: Add 'tikzcd' to list of special environments.Eigil Rischel1-0/+1
This allows it to be processed by filters, in the same way that one can do for 'tikzpicture'
2019-09-23Man writer: suppress non-absolute link URLs.John MacFarlane1-3/+3
Motivation: in a man page there's not much use for relative URLs, which you can't follow. Absolute URLs are still useful. We previously suppressed relative URLs starting with '#' (purely internal links), but it makes sense to go a bit farther. Closes #5770.
2019-09-22RST reader: Fixed parsing of indented blocks.John MacFarlane1-6/+9
We were requiring consistent indentation, but this isn't required by RST, as long as each nonblank line of the block has *some* indentation. Closes #5753.
2019-09-22[Docx Writer] Re-use Readers.Docx.Parse for StyleMap (#5766)Nikolay Yakimov5-411/+385
* [Docx Parser] Move style-parsing-specific code to a new module * [Docx Writer] Re-use Readers.Docx.Parse.Styles for StyleMap * [Docx Writer] Move Readers.Docx.StyleMap to Writers.Docx.StyleMap It's never used outside of writer code, so it makes more sense to scope it under writers really.
2019-09-22Make `plain` output plainer.John MacFarlane2-5/+17
Previously we used the following Project Gutenberg conventions for plain output: - extra space before and after level 1 and 2 headings - all-caps for strong emphasis `LIKE THIS` - underscores surrounding regular emphasis `_like this_` This commit makes `plain` output plainer. Strong and Emph inlines are rendered without special formatting. Headings are also rendered without special formatting, and with only one blank line following. To restore the former behavior, use `-t plain+gutenberg`. API change: Add `Ext_gutenberg` constructor to `Extension`. See #5741.
2019-09-22Use HsYAML-0.2.0.0John MacFarlane2-17/+20
Most of this is due to @vijayphoenix (#5704), but it needed some revisions to integrate with current master, and to use the released HsYAML. Closes #5704.
2019-09-21[Docx Writer] Consistently use style names, not style idsNikolay Yakimov1-27/+25
Styles that this change affects: paragraph styles: Author, Abstract, Compact, Figure, Captioned Figure, Image Caption, First Paragraph, Source Code, Table Caption, Definition, Definition Term; character styles: Verbatim Char, token styles (those with names ending in Tok)
2019-09-21[Docx Writer] Code clean-upNikolay Yakimov1-40/+37
Reduce code duplication, remove redundant brackets
2019-09-21[Docx Reader] Use style names, not ids, for assigning semantic meaningNikolay Yakimov3-183/+287
Motivating issues: #5523, #5052, #5074 Style name comparisons are case-insensitive, since those are case-insensitive in Word. w:styleId will be used as style name if w:name is missing (this should only happen for malformed docx and is kept as a fallback to avoid failing altogether on malformed documents) Block quote detection code moved from Docx.Parser to Readers.Docx Code styles, i.e. "Source Code" and "Verbatim Char" now honor style inheritance Docx Reader now honours "Compact" style (used in Pandoc-generated docx). The side-effect is that "Compact" style no longer shows up in docx+styles output. Styles inherited from "Compact" will still show up. Removed obsolete list-item style from divsToKeep. That didn't really do anything for a while now. Add newtypes to differentiate between style names, ids, and different style types (that is, paragraph and character styles) Since docx style names can have spaces in them, and pandoc-markdown classes can't, anywhere when style name is used as a class name, spaces are replaced with ASCII dashes `-`. Get rid of extraneous intermediate types, carrying styleId information. Instead, styleId is saved with other style data. Use RunStyle for inline style definitions only (lacking styleId and styleName); for Character Styles use CharStyle type (which is basicaly RunStyle with styleId and StyleName bolted onto it).
2019-09-21[Docx Reader] Code clean-upNikolay Yakimov2-63/+39
Reduce code duplication, remove redundant brackets, use newtype instead of data where appropriate
2019-09-20Changes to Slides to be more flexible with Div structure.John MacFarlane1-0/+3
Previously if you had ``` ::: #foo c ::: ``` slide level would be 1, not 2.
2019-09-20Preserve built-in styles in DOCX with custom style (#5670)Ben Steinberg1-22/+55
This commit prevents custom styles on divs and spans from overriding styles on certain elements inside them, like headings, blockquotes, and links. On those elements, the "native" style is required for the element to display correctly. This change also allows nesting of custom styles; in order to do so, it removes the default "Compact" style applied to Plain blocks, except when inside a table.
2019-09-20Bug fixes to EPUB chapter splitting.John MacFarlane1-15/+16
2019-09-19MediaWiki: skip optional {{table}} template.John MacFarlane1-0/+1
See https://en.wikipedia.org/wiki/Template:Table Closes #5757.
2019-09-19Clarify warning for missing title.John MacFarlane1-3/+3
Closes #5760.
2019-09-19EPUB writer: make --epub-chapter-level work again.John MacFarlane1-19/+15
It was temporarily broken by the latest change to chapter splitting code.
2019-09-19EPUB writer: improve splitting into chapters.John MacFarlane2-39/+29
+ Use makeSection from T.P.Shared. This deals better with embedded divs. (Closes #5761.) + Remove chapter-title class from chapter h1, for now. (Reverts one change made earlier; we may revisit this in light of #5749.) + Avoid issuing warning multiple times when title not set (see #5760).
2019-09-19Remove admonition-title remnants.John MacFarlane1-1/+1
Completes 8e01ccb41dde8a5e6123f5b0746c36f240576047
2019-09-18LaTeX writer: use `\hspace{0pt}` for 0-width space U+200B.John MacFarlane1-0/+1
Closes #5756.
2019-09-16PDF: Fix test for Cygwin. See #5451.John MacFarlane1-2/+2
2019-09-14Add chapter-title class to EPUB chapter title h1 elements.John MacFarlane1-3/+5
See #5269.
2019-09-14EPUB toChapters: don't treat "refs" Div specially.John MacFarlane1-1/+1
This should make toChapters work better if there are Divs around sections.