aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
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-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-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-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-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-02Remove Compat.MonoidJesse Rosenthal2-2/+2
This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
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-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.
2016-08-18Org writer: ensure link targets are paths or URLsAlbert Krewinkel1-5/+23
Org-mode treats links as document internal searches unless the link target looks like a URL or file path, either relative or absolute. This change ensures that this is always the case.
2016-08-18Org writer: ensure blank line after figureAlbert Krewinkel1-1/+1
An Org-mode figure should be surrounded by blank lines. The figure would be recognized regardless, but images in the following line would unintentionally be treated as figures as well.
2016-08-18Org writer: remove blank line after figure captionAlbert Krewinkel1-3/+2
Org-mode only treats an image as a figure if it is directly preceded by a caption.
2016-08-15Docx Writer: change dynamic style keyJesse Rosenthal1-1/+1
Use "custom-style" instead of "docx-style." This allows it to be used in other formats like ODT in the future.
2016-08-15Docx writer: Inject text properties as well.Jesse Rosenthal1-3/+20
2016-08-15Docx Writer: Keep track of dynamic text props too.Jesse Rosenthal1-0/+3
2016-08-15Docx writer: Allow dynamic styles on spans.Jesse Rosenthal1-1/+5
This enables dynamic styling on spans. It uses the same prefix as we used on divs ("docx-style" for the moment). It does not yet inject the style into styles.xml.
2016-08-15Docx writer: Inject new paragraph propertiesJesse Rosenthal1-4/+23
This injects new dynamic paragraph properties to be into the style file. Nothing occurs if the prop already exists in the style file.
2016-08-15Docx Writer: Have state keep track of dynamic styles.Jesse Rosenthal1-2/+6
We want to be able to inject these into our styles.xml.
2016-08-13Docx Writer: Implement user-defined styles.Jesse Rosenthal1-0/+6
Divs with a "docx-style" key in the attributes will apply the corresponding key to the contained blocks.
2016-08-06LaTeX writer: don't use * for unnumbered paragraph, subparagraph.John MacFarlane1-2/+2
The starred variants don't exist. This helps with part of #3058...it gets rid of the spurious *s. But we still have numbers on the 4th and 5th level headers.
2016-07-14Fixed compiler warnings.John MacFarlane2-2/+1
2016-07-14Docx Writer: Use actual creation time as doc propJesse Rosenthal1-4/+3
Previously, we had used the user-supplied date, if available, for Word's document creation metadata. This could lead to weird results, as in cases where the user post-dates a document (so the modification might be prior to the creation). Here we use the actual computer time to set the document creation.
2016-07-05Org writer: improve Div handlingAlbert Krewinkel1-7/+41
Div blocks handling is changed to make the output look more like idiomatic org mode: - Div-wrapped content is output as-is if the div's attribute is the null attribute. - Div containers with an id but neither classes nor key-value pairs are unwrapped and the id is added as an anchor. - Divs with classes associated with greater block elements are wrapped in a `#+BEGIN`...`#+END` block. - The old behavior for Divs with more complex attributes is kept.
2016-07-03Allow 'standout' as a beamer frame option.John MacFarlane1-1/+1
## Slide title {.standout} Closes #3007.
2016-07-01LaTeX writer: don't URI-escape image source.John MacFarlane1-1/+1
Usually this is a local file, and replacing spaces with `%20` ruins things. Closes #2825.
2016-07-01ZimWiki writer: removed commented out code that confused Haddock.John MacFarlane1-8/+8
See https://travis-ci.org/jgm/pandoc/jobs/141542247
2016-06-30Added Zim Wiki writer, template and tests.Alex Ivkin1-0/+361
2016-07-01Docx writer: set paragraph to FirstPara after display mathJesse Rosenthal1-0/+1
We treat display math like block quotes, and apply FirstParagraph style to paragraphs that follow them. These can be styled as the user wishes. (But, when the user is using indentation, this allows for paragraphs to continue after display math without indentation.)
2016-07-01Writers: treat SoftBreak as space for strippingJesse Rosenthal1-0/+1
In Writers.Shared, we strip leading and trailing spaces for display math. Since SoftBreak's are treated as spaces, we should strip those too.
2016-06-24Make --webtex work with the Markdown writer.John MacFarlane1-12/+17
Closes #1177. This is a convenient option for people using websites whose Markdown flavors don't provide for math.
2016-06-23Markdown writer: use raw HTML for simple, pipe tables with linebreaks.John MacFarlane1-1/+5
Markdown line breaks involve a newline, and simple and pipe tables can't contain one. Closes #2993.
2016-06-22HTML writer: Better support for raw LaTeX environments.John MacFarlane1-12/+41
Previously we just passed all raw TeX through when MathJax was used for HTML math. This passed through too much. With this patch, only raw LaTeX environments that MathJax can handle get passed through. This patch also causes raw LaTeX environments to be treated as math, when possible, with MathML and WebTeX output. Closes #2758.
2016-06-13Org writer: support arbitrary raw inlinesAlbert Krewinkel1-3/+4
Org mode allows arbitrary raw inlines ("export snippets" in Emacs parlance) to be included as `@@format:raw foreign format text@@`. Support for this features is added to the Org writer.