aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc
AgeCommit message (Collapse)AuthorFilesLines
2016-10-17Use bind function instead of pattern matchingHubert Plociniczak1-4/+1
2016-10-17Minor refactoringHubert Plociniczak1-10/+6
2016-10-17Infer caption from the text following the imgHubert Plociniczak1-20/+47
Frame can contain other frames with the text boxes. This is something that has not been considered before and meant that the whole construction of images was broken in those cases. Also the captions were fixed/ignored.
2016-10-12Basic support for images in ODT documentsHubert Plociniczak4-38/+131
Highly influenced by the docx support, refactored some code to avoid DRY.
2016-10-12Merge pull request #3159 from jkr/refsJohn MacFarlane2-85/+151
Specify location for footnotes (and reference links) in MD output
2016-10-11Markdown writer: Allow footnotes/refs at the end of blocks, sectionsJesse Rosenthal1-21/+64
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-11Add ReaderT monad for environment variables.Jesse Rosenthal1-64/+78
This will make it easier to keep track of what level of block we are at.
2016-10-11Options: Add references location.Jesse Rosenthal1-0/+9
This will be used by the markdown writer for deciding where to put links and footnotes.
2016-10-10Org reader: trim verse lines properlyAlbert Krewinkel1-2/+4
An empty verse line should not result in `Str ""` but in `mempty`.
2016-10-10More checks for Ext_raw_html when rendering HTML in Markdown.John MacFarlane1-5/+9
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-09removed mmd raw_tex in src/Text/Pandoc/Options.hsKolenCheung1-1/+3
2016-10-05Docx writer: Move one more env var to Reader monadJesse Rosenthal1-6/+5
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-05Docx writer: code legibility fixups.Jesse Rosenthal1-5/+6
More meaningful variable name, and explanatory comment.
2016-10-04Docx writer: Clean up and streamline RTL behaviorJesse Rosenthal1-71/+77
Now RTL is turned and off by a general function, `withDirection` wrapping `inlineToOpenXML` and `blockToOpenXML`. This acts according to the `envRTL` variable. This means we can just set the environment at the outset, and change the environment with `local` as need be. Note that this requires making the `inlineToOpenXML` and `blockToOpenXML` functions into wrappers around primed-versions (`{inline,block}ToOpenXML`) where the real work takes place.
2016-10-04Docx writer: move a couple more vars to ReaderTJesse Rosenthal1-21/+29
In general, we want things that are either: 1. unchanging environment variables, or 2. environment variables that will change for a the scope of a function and then pop back to be in the reader monad. This is safer for (1), since we won't accidentally change it, and easier for (2), since we can use `local` instad of setting the old value and then resetting. We keep the StateT monad for values that we will want to accumulate or change and then use later.
2016-10-03Clean up commented-out codeJesse Rosenthal1-12/+0
A few commented out functions were left in the code during the conversion from StateT to ReaderT. This removes them.
2016-10-03Remove bool on setRTL.Jesse Rosenthal1-17/+13
We had to use this because we set the env, which means that setRTL wouldn't do anything at the top level. We now don't set the env (it will always be false at the outset), which means the toplevel setRTL will work if necessary.
2016-10-03Filter text/para props correctly.Jesse Rosenthal1-2/+2
We only filter on the name, not the prefix.
2016-10-03Add a boolean flag to the setRTL function.Jesse Rosenthal1-5/+5
At the toplevel we don't check to see if RTL is already set.
2016-10-03Test for "dir" metadata.Jesse Rosenthal1-2/+7
2016-10-03Add setRTL and setLTR functions.Jesse Rosenthal1-8/+41
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-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