aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2016-11-18Markdown writer: Use bracketed form for native spans...John MacFarlane1-4/+11
...when `bracketed_spans` enabled. Closes #3229.
2016-11-15Adjust widths in Markdown grid tables so that they match on round-trip.John MacFarlane1-1/+1
2016-11-15Allow alignments to be specified in Markdown grid tables.John MacFarlane1-9/+29
2016-11-15Markdown writer: fixed inconsistent spacing issue.John MacFarlane1-12/+20
Previously a tight bullet sublist got rendered with a blank line after, while a tight ordered sublist did not. Now we don't get the blank line in either case. Closes #3232.
2016-11-12Markdown writer: Fix escaping of spaces in super/subscript.John MacFarlane1-37/+39
Previously two backslashes were inserted, which gave a literal backslash. Closes #3225.
2016-11-08Inline code when text has a special styleHubert Plociniczak1-1/+2
When a piece of text has a text 'Source_Text' then we assume that this is a piece of the document that represents a code that needs to be inlined. Addapted an odt writer to also reflect that change; previously it was just writing a 'preformatted' text using a non-distinguishable font style. Code blocks are still not recognized by the ODT reader. That's a separate issue.
2016-11-02Docx writer: Handle title text in images.Jesse Rosenthal1-2/+2
We already handled alt text. This just puts the image "title" into the docx "title" attr.
2016-10-25reveal.js: don't change slide title to level 1 header.John MacFarlane1-3/+1
This also affects other HTML slide show formats. Closes #2221.
2016-10-23ICML writer: replace partial function (!!) in table handling (#3175)Mauro Bieg1-5/+5
2016-10-19Add option for top-level division typeAlbert Krewinkel4-44/+62
The `--chapters` option is replaced with `--top-level-division` which allows users to specify the type as which top-level headers should be output. Possible values are `section` (the default), `chapter`, or `part`. The formats LaTeX, ConTeXt, and Docbook allow `part` as top-level division, TEI only allows to set the `type` attribute on `div` containers. The writers are altered to respect this option in a sensible way.
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 Matthews1-10/+17
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-10-17Org writer: drop space before footnote markersAlbert Krewinkel1-1/+1
The writer no longer adds an extra space before footnote markers. Fixes: #3162
2016-10-13Markdown writer: Abstract out note/ref function.Jesse Rosenthal1-28/+22
We do basically the same thing every time we insert notes, so let's cut down on code duplication.
2016-10-13Add support for the LineBlock element to writersAlbert Krewinkel24-28/+102
The following markup features are used to output the lines of the `LineBlock` element: - AsciiDoc: a `[verse]` block, - ConTeXt: text surrounded by `\startlines` and `\endlines`, - HTML: `div` with an per-element style setting to interpret the content as pre-wrapped, - Markdown: line blocks if the `line_blocks` extension is enabled, a simple paragraph with hard linebreaks otherwise, - Org: VERSE block, - RST: a line block, and - all other formats: a paragraph, containing hard linebreaks between lines. Custom lua writers should be updated to use the `LineBlock` element.
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.