summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAge
* Allow empty lines when parsing line blocksAlbert Krewinkel2016-10-13
| | | | | | Line blocks are allowed to contain empty lines and should be parsed as a single block in that case. Previously an empty (line block) line would have terminated parsing of the line block element.
* Parse line-oriented markup as LineBlockAlbert Krewinkel2016-10-13
| | | | | | | | Markup-features focusing on lines as distinctive part of the markup are read into `LineBlock` elements. This currently means line blocks in reStructuredText and Markdown (the latter only if the `line_block` extension is enabled), the `linegroup`/`line` combination from the Docbook 5.1 working draft, and Org-mode `VERSE` blocks.
* Add support for the LineBlock element to writersAlbert Krewinkel2016-10-13
| | | | | | | | | | | | | | | | | 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.
* Shared: add function combining lines using LineBreakAlbert Krewinkel2016-10-13
| | | | | | | The `linesToBlock` function takes a list of lines and combines them by appending a hard `LineBreak` to each line and concatenating the result, putting the result it into a `Para`. This is most useful when dealing when converting `LineBlock` elements.
* Merge pull request #3159 from jkr/refsJohn MacFarlane2016-10-12
|\ | | | | Specify location for footnotes (and reference links) in MD output
| * Markdown writer: Allow footnotes/refs at the end of blocks, sectionsJesse Rosenthal2016-10-11
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * Add ReaderT monad for environment variables.Jesse Rosenthal2016-10-11
| | | | | | | | This will make it easier to keep track of what level of block we are at.
| * Options: Add references location.Jesse Rosenthal2016-10-11
| | | | | | | | | | This will be used by the markdown writer for deciding where to put links and footnotes.
* | Org reader: trim verse lines properlyAlbert Krewinkel2016-10-10
|/ | | | An empty verse line should not result in `Str ""` but in `mempty`.
* More checks for Ext_raw_html when rendering HTML in Markdown.John MacFarlane2016-10-10
| | | | | | | | | | | | | 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.
* removed mmd raw_tex in src/Text/Pandoc/Options.hsKolenCheung2016-10-09
|
* Docx writer: Move one more env var to Reader monadJesse Rosenthal2016-10-05
| | | | | | 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.
* Docx writer: code legibility fixups.Jesse Rosenthal2016-10-05
| | | | More meaningful variable name, and explanatory comment.
* Docx writer: Clean up and streamline RTL behaviorJesse Rosenthal2016-10-04
| | | | | | | | | | | | 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.
* Docx writer: move a couple more vars to ReaderTJesse Rosenthal2016-10-04
| | | | | | | | | | | | | | | 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.
* Clean up commented-out codeJesse Rosenthal2016-10-03
| | | | | A few commented out functions were left in the code during the conversion from StateT to ReaderT. This removes them.
* Remove bool on setRTL.Jesse Rosenthal2016-10-03
| | | | | | | 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.
* Filter text/para props correctly.Jesse Rosenthal2016-10-03
| | | | We only filter on the name, not the prefix.
* Add a boolean flag to the setRTL function.Jesse Rosenthal2016-10-03
| | | | At the toplevel we don't check to see if RTL is already set.
* Test for "dir" metadata.Jesse Rosenthal2016-10-03
|
* Add setRTL and setLTR functions.Jesse Rosenthal2016-10-03
|
* Move more enviroment vars to Reader Monad.Jesse Rosenthal2016-10-03
| | | | | Things that get pushed and then reset are better in ReaderT, because they can be run with `local`.
* Add ReaderT env to the docx writer:Jesse Rosenthal2016-10-03
| | | | | | | | 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.)
* MediaWiki writer: transform filename with underscores in images.John MacFarlane2016-10-02
| | | | | | | `foo bar.jpg` becomes `foo_bar.jpg`. This was already done for internal links, but it also needs to happen for images. Closes #3052.
* EPUB writer: use stringify instead of plain writer for metadata.John MacFarlane2016-10-02
| | | | | | | | This means that underscores won't be used for emphasis, or CAPS for bold. The metadata fields will just have unadorned text. Closes #3066.
* AsciiDoc writer: avoid unnecessary use of "unconstrained" emphasis.John MacFarlane2016-10-02
| | | | | | | | In AsciiDoc, you must use a special form of emphasis (double `__`) for intraword emphasis. Pandoc was previously using this more than necessary. Closes #3068.
* Moved template compiling/rendering code to a separate library.John MacFarlane2016-10-02
| | | | | | jgm/doctemplates. This allows the pandoc templating system to be used independently.
* Markdown reader: added bracket syntax for native spans.John MacFarlane2016-09-28
| | | | | | | See #168. Text.Pandoc.Options.Extension has a new constructor `Ext_brackted_spans`, which is enabled by default in pandoc's Markdown.
* Merge pull request #3093 from wilx/master-figure-placementJohn MacFarlane2016-09-28
|\ | | | | LaTeX: Do not set [htbp] figure placement options.
| * LaTeX: Do not set [htbp] figure placement options.Vaclav Zeman2016-08-29
| | | | | | | | | | | | 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.
* | LaTeX writer: change braced backtick to \textasciigrave{}Jesse Rosenthal2016-09-20
| | | | | | | | | | | | | | 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{}).
* | LaTeX writer: enclose backtick in `{}` in verbatimJesse Rosenthal2016-09-19
| | | | | | | | | | | | | | We don't want ligatures like ` ?` ` (which produces `¿`) inside `\texttt{}` environments, so we enclose the backtick in braces. This fixes #3121
* | DocBook writer: include an anchor element when a div or span has an id.John MacFarlane2016-09-06
| | | | | | | | | | This closes #3102. Note that DocBook does not have a class attribute, but at least this provides an anchor for internal links.
* | Remove http-client CPP conditionals.Jesse Rosenthal2016-09-03
| | | | | | | | | | 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.
* | Remove blaze-html CPP conditional.Jesse Rosenthal2016-09-03
| | | | | | | | | | | | | | | | 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.)
* | Add EOL note to time compat module.Jesse Rosenthal2016-09-03
| | | | | | | | | | | | 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.
* | Remove TagSoup compatJesse Rosenthal2016-09-02
| | | | | | | | | | | | | | 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.
* | Remove unnecessary CPP condition in UTF8Jesse Rosenthal2016-09-02
| | | | | | | | Base 4.4 is ghc 7.2, so we don't have to worry about getting a lower version.
* | Actually remove T/P/Compat/Except.Jesse Rosenthal2016-09-02
| |
* | Remove directory compatJesse Rosenthal2016-09-02
| | | | | | | | | | 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.
* | Remove Text.Pandoc.Compat.ExceptJesse Rosenthal2016-09-02
| |
* | Fix grouping of imports.Jesse Rosenthal2016-09-02
| | | | | | | | | | | | Some source files keep imports in tidy groups. Changing `Text.Pandoc.Compat.Monoid` to `Data.Monoid` could upset that. This restores tidiness.
* | Remove an inline monad compatibility macro.Jesse Rosenthal2016-09-02
| |
* | Remove Compat.MonoidJesse Rosenthal2016-09-02
| | | | | | | | | | This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
* | PDF: Don't crash with nonexistent image.John MacFarlane2016-09-02
| | | | | | | | | | | | | | | | | | | | 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.
* | Merge pull request #3091 from wilx/master-narrow-no-break-spaceJohn MacFarlane2016-09-02
|\ \ | | | | | | Translate NARROW NO-BREAK SPACE into LaTeX.
| * | Translate NARROW NO-BREAK SPACE into LaTeX.Vaclav Zeman2016-08-27
| |/ | | | | | | Translate NARROW NO-BREAK SPACE into LaTeX' `\,`.
* | Org reader: respect unnumbered header propertyAlbert Krewinkel2016-08-30
| | | | | | | | | | | | | | | | | | | | | | 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.
* | Docx reader: make all compilers happy with traversable.Jesse Rosenthal2016-08-29
| | | | | | | | | | The last attempt to make 7.8 happy made 7.10 unhappy. So we need some conditional logic to appease all versions.
* | Docx reader: Import traverse for ghc 7.8Jesse Rosenthal2016-08-29
| | | | | | | | The GHC 7.8 build was erroring without it.