aboutsummaryrefslogtreecommitdiff
path: root/src/Text
AgeCommit message (Collapse)AuthorFilesLines
2016-10-03Move more enviroment vars to Reader Monad.Jesse Rosenthal1-62/+52
Things that get pushed and then reset are better in ReaderT, because they can be run with `local`.
2016-10-03Add ReaderT env to the docx writer:Jesse Rosenthal1-8/+17
This will allow us to add text and paragraph properties depending on if rtl is already set or not. (It would probably be cleaner and safer to move the paraprops and textprops to this part of the stack in the future.)
2016-10-02MediaWiki writer: transform filename with underscores in images.John MacFarlane1-1/+1
`foo bar.jpg` becomes `foo_bar.jpg`. This was already done for internal links, but it also needs to happen for images. Closes #3052.
2016-10-02EPUB writer: use stringify instead of plain writer for metadata.John MacFarlane1-6/+4
This means that underscores won't be used for emphasis, or CAPS for bold. The metadata fields will just have unadorned text. Closes #3066.
2016-10-02AsciiDoc writer: avoid unnecessary use of "unconstrained" emphasis.John MacFarlane1-7/+17
In AsciiDoc, you must use a special form of emphasis (double `__`) for intraword emphasis. Pandoc was previously using this more than necessary. Closes #3068.
2016-10-02Moved template compiling/rendering code to a separate library.John MacFarlane1-259/+8
jgm/doctemplates. This allows the pandoc templating system to be used independently.
2016-09-28Markdown reader: added bracket syntax for native spans.John MacFarlane2-0/+10
See #168. Text.Pandoc.Options.Extension has a new constructor `Ext_brackted_spans`, which is enabled by default in pandoc's Markdown.
2016-09-28Merge pull request #3093 from wilx/master-figure-placementJohn MacFarlane1-1/+1
LaTeX: Do not set [htbp] figure placement options.
2016-09-20LaTeX writer: change braced backtick to \textasciigrave{}Jesse Rosenthal1-1/+1
Backticks in verbatim environments are converted to open-single-quotes. This change makes them appear as backticks. This corresponds to how we treat `'' in verbatim environments (with \textquotesingle{}).
2016-09-19LaTeX writer: enclose backtick in `{}` in verbatimJesse Rosenthal1-0/+1
We don't want ligatures like ` ?` ` (which produces `¿`) inside `\texttt{}` environments, so we enclose the backtick in braces. This fixes #3121
2016-09-13TEI writer: remove heuristic to detect book templateAlbert Krewinkel1-9/+5
TEI doesn't have `<book>` elements but only generic `<divN>` division elements. Checking the template for a trailing `</book>` is nonsensical.
2016-09-06Add --parts command line option to LaTeX writer.Oliver Matthews2-10/+19
Add --parts command line argument. This only effects LaTeX writer, and only for non-beamer output formats. It changes the output levels so the top level is 'part', the next 'chapter' and then into sections.
2016-09-06DocBook writer: include an anchor element when a div or span has an id.John MacFarlane1-2/+9
This closes #3102. Note that DocBook does not have a class attribute, but at least this provides an anchor for internal links.
2016-09-03Remove http-client CPP conditionals.Jesse Rosenthal1-10/+1
Our lower bound on http-client is 0.5, and both of these min_version tests are less than 0.5, so they will always pass.
2016-09-03Remove blaze-html CPP conditional.Jesse Rosenthal1-5/+1
This tests for a min value >= 0.5. But we have a lower bound of 0.5 in pandoc.cabal, so the test will always pass. (If we bump the lower bound to 0.5.1, we can remove a conditional in the HTML writer as well.)
2016-09-03Add EOL note to time compat module.Jesse Rosenthal1-0/+12
Because time 1.4 is a boot library for GHC 7.8, we will support the compatibility module as long as we support 7.8. But we should be clear about when we will no longer need it.
2016-09-02Remove TagSoup compatJesse Rosenthal5-25/+10
We already lower-bound tagsoup at 0.13.7, which means we were always running the compatibility layer (it was conditional on min value 0.13). Better to just use `lookupEntity` from the library directly, and convert a string to a char if need be.
2016-09-02Remove unnecessary CPP condition in UTF8Jesse Rosenthal1-7/+2
Base 4.4 is ghc 7.2, so we don't have to worry about getting a lower version.
2016-09-02Actually remove T/P/Compat/Except.Jesse Rosenthal1-37/+0
2016-09-02Remove directory compatJesse Rosenthal2-22/+1
directory 1.1 depends on base 4.5 (ghc 7.4) which we are no longer supporting. So we don't have to use a compatibility layer for it.
2016-09-02Remove Text.Pandoc.Compat.ExceptJesse Rosenthal7-15/+6
2016-09-02Fix grouping of imports.Jesse Rosenthal7-7/+8
Some source files keep imports in tidy groups. Changing `Text.Pandoc.Compat.Monoid` to `Data.Monoid` could upset that. This restores tidiness.
2016-09-02Remove an inline monad compatibility macro.Jesse Rosenthal1-12/+0
2016-09-02Remove Compat.MonoidJesse Rosenthal22-38/+21
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
2016-09-02PDF: Don't crash with nonexistent image.John MacFarlane1-1/+2
Instead, emit the alt text, emphasized. This accords with what the ODT writer currently does. The user will still get a warning about a nonexistent image, but will no longer get a LaTeX crash. Closes #3100.
2016-09-02Merge pull request #3091 from wilx/master-narrow-no-break-spaceJohn MacFarlane1-0/+1
Translate NARROW NO-BREAK SPACE into LaTeX.
2016-08-30Org reader: respect unnumbered header propertyAlbert Krewinkel1-2/+10
Sections the `unnumbered` property should, as the name implies, be excluded from the automatic numbering of section provided by some output formats. The Pandoc convention for this is to add an "unnumbered" class to the header. The reader treats properties as key-value pairs per default, so a special case is added to translate the above property to a class instead. Closes #3095.
2016-08-29Docx reader: make all compilers happy with traversable.Jesse Rosenthal1-1/+3
The last attempt to make 7.8 happy made 7.10 unhappy. So we need some conditional logic to appease all versions.
2016-08-29Docx reader: Import traverse for ghc 7.8Jesse Rosenthal1-0/+1
The GHC 7.8 build was erroring without it.
2016-08-29Docx reader: clean up function with `traverse`Jesse Rosenthal1-6/+1
2016-08-29Merge branch 'org-meta-handling'Albert Krewinkel4-69/+195
2016-08-29Org reader: respect `creator` export optionAlbert Krewinkel3-5/+8
The `creator` option controls whether the creator meta-field should be included in the final markup. Setting `#+OPTIONS: creator:nil` will drop the creator field from the final meta-data output. Org-mode recognizes the special value `comment` for this field, causing the creator to be included in a comment. This is difficult to translate to Pandoc internals and is hence interpreted the same as other truish values (i.e. the meta field is kept if it's present).
2016-08-29Org reader: respect `email` export optionAlbert Krewinkel3-5/+7
The `email` option controls whether the email meta-field should be included in the final markup. Setting `#+OPTIONS: email:nil` will drop the email field from the final meta-data output.
2016-08-29Org reader: respect `author` export optionAlbert Krewinkel4-4/+23
The `author` option controls whether the author should be included in the final markup. Setting `#+OPTIONS: author:nil` will drop the author from the final meta-data output.
2016-08-29Org reader: read HTML_head as header-includesAlbert Krewinkel1-0/+2
HTML-specific head content can be defined in `#+HTML_head` lines. They are parsed as format-specific inlines to ensure that they will only show up in HTML output.
2016-08-29Org reader: set classoption meta from LaTeX_class_optionsAlbert Krewinkel1-1/+8
2016-08-29Org reader: set documentclass meta from LaTeX_classAlbert Krewinkel1-0/+1
2016-08-29Org reader: read LaTeX_header as header-includesAlbert Krewinkel1-9/+31
LaTeX-specific header commands can be defined in `#+LaTeX_header` lines. They are parsed as format-specific inlines to ensure that they will only show up in LaTeX output.
2016-08-29Org reader: give precedence to later meta linesAlbert Krewinkel1-1/+1
The last meta-line of any given type is the significant line. Previously the value of the first line was kept, even if more lines of the same type were encounterd.
2016-08-29Org reader: allow multiple, comma-separated authorsAlbert Krewinkel1-1/+9
Multiple authors can be specified in the `#+AUTHOR` meta line if they are given as a comma-separated list.
2016-08-29Org reader: read markup only for special meta keysAlbert Krewinkel1-5/+20
Most meta-keys should be read as normal string values, only a few are interpreted as marked-up text.
2016-08-29Org reader: extract meta parsing code to moduleAlbert Krewinkel2-64/+111
Parsing of meta-data is well separable from other block parsing tasks. Moving into new module to get small files and clearly arranged code.
2016-08-29LaTeX: Do not set [htbp] figure placement options.Vaclav Zeman1-1/+1
Do not set `[htbp]` placement options on each figure to allow overriding them by them using `\fps@figure` redefintion either in header or in template.
2016-08-28Docx reader: update copyright.Jesse Rosenthal3-6/+6
2016-08-28Docx reader: use all anchor spans for header ids.Jesse Rosenthal1-1/+1
Previously we only used the first anchor span to affect header ids. This allows us to use all the anchor spans in a header, whether they're nested or not. Along with 62882f97, this closes #3088.
2016-08-28Docx reader: Let headers use exisiting id.Jesse Rosenthal1-6/+10
Previously we always generated an id for headers (since they wouldn't bring one from Docx). Now we let it use an existing one if possible. This should allow us to recurs through anchor spans.
2016-08-28Docx reader: Handle anchor spans with content in headers.Jesse Rosenthal1-7/+8
Previously, we would only be able to figure out internal links to a header in a docx if the anchor span was empty. We change that to read the inlines out of the first anchor span in a header. This still leaves another problem: what to do if there are multiple anchor spans in a header. That will be addressed in a future commit.
2016-08-27Translate NARROW NO-BREAK SPACE into LaTeX.Vaclav Zeman1-0/+1
Translate NARROW NO-BREAK SPACE into LaTeX' `\,`.
2016-08-27Man writer: allow section numbers that are not a single digit.John MacFarlane1-5/+5
Closes #3089.
2016-08-20Org writer: translate language identifiersAlbert Krewinkel1-5/+23
Pandoc and Org-mode use different programming language identifiers. An additional translation between those identifiers is added to avoid unexpected behavior. This fixes a problem where language specific source code would sometimes be output as example code.