aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/ConTeXt.hs
AgeCommit message (Collapse)AuthorFilesLines
2019-03-01Remove license boilerplate.John MacFarlane1-18/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-2/+2
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-09-20Fix compiler warning.John MacFarlane1-1/+1
2018-09-20ConTeXt writer: change `\` to `/` in Windows image paths.John MacFarlane1-1/+6
We do this in the LaTeX writer, and it avoids problems. Note that `/` works as a LaTeX path separator on Windows. Closes #4918.
2018-09-04hlint some writersAlexander Krotov1-2/+1
2018-08-15Markdown reader: Use "tex" instead of "latex" for raw tex-ish content.John MacFarlane1-9/+6
We can't always tell if it's LaTeX, ConTeXt, or plain TeX. Better just to use "tex" always. Also changed: ConTeXt writer: now outputs raw "tex" blocks as well as "context". (Closes #969). RST writer: uses ".. raw:: latex" for "tex" content. (RST doesn't support raw context anyway.) Note that if "context" or "latex" specifically is desired, you can still force that in a markdown document by using the raw attribute (see MANUAL.txt): ```{=latex} \foo ``` Note that this change may affect some filters, if they assume that raw tex parsed by the Markdown reader will be RawBlock (Format "latex"). In most cases it should be trivial to modify the filters to accept "tex" as well.
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-01-25ConTeXt writer: new section syntax and --section-divs (#4295)Henri Menke1-17/+37
Fixes #2609. This PR introduces the new-style section headings: `\section[my-header]{My Header}` -> `\section[title={My Header},reference={my-header}]`. On top of this, the ConTeXt writer now supports the `--section-divs` option to write sections in the fenced style, with `\startsection` and `\stopsection`.
2018-01-23ConTeXt writer: xtables: correct wrong usage of captionHenri Menke1-1/+1
2018-01-15ConTeXt writer: Use xtables instead of Tables (#4223)Henri Menke1-26/+72
- Default to xtables for context output. - Added `ntb` extension (affecting context writer only) to use Natural Tables instead. - Added `Ext_ntb` constructor to `Extension` (API change).
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-11-29Let papersizes a0, a1, a2, ... be case-insensitive in LaTeX and ConTeXt.John MacFarlane1-3/+4
2017-10-29More hlint.John MacFarlane1-14/+12
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-25/+25
2017-10-11ConTeXt writer: Use identifiers for chapters.John MacFarlane1-6/+7
Closes #3968.
2017-08-11Added support for translations (localization) (see #3559).John MacFarlane1-1/+1
* readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
2017-06-28Make `papersize: a4` work regardless of the case of `a4`.John MacFarlane1-0/+5
It is converted to `a4` in LaTeX and `A4` in ConTeXt.
2017-06-25BCP47: split toLang from getLang, rearranged types.John MacFarlane1-33/+34
2017-06-25Refactored ConTeXt writer to use BCP47.John MacFarlane1-34/+34
BCP47 - consistent case for BCP47 fields (e.g. uppercase for region).
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-3/+3
Now we raise a proper error on template failure.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-11Switched Writer types to use Text.John MacFarlane1-5/+8
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-05-23Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel1-1/+1
We also export the set of known `schemes`. The new function replaces the function of the same name from `Network.URI`, as the latter did not check whether a scheme is well-known. E.g. MediaWiki wikis frequently feature pages with names like `User:John`. These links were interpreted as URIs, thus turning internal links into global links. This is prevented by also checking whether the scheme of a URI is frequently used (i.e. is IANA registered or an otherwise well-known scheme). Fixes: #2713 Update set of well-known URIs from IANA list All official IANA schemes (as of 2017-05-22) are included in the set of known schemes. The four non-official schemes doi, isbn, javascript, and pmid are kept.
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-2/+2
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-03-10ConTeXt writer: converted to use PandocMonad.John MacFarlane1-19/+28
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-27/+27
2017-03-03ConTeXt writer: remove unnecessary $ (#3482)Alexander Krotov1-2/+2
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Removed writerTeXLigatures.John MacFarlane1-1/+1
Make `smart` extension work in LaTeX/ConTeXt writers instead. Instead of `-t latex --no-tex-ligatures`, do `-t latex-smart`.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-2/+3
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-0/+1
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-3/+3
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]
2016-11-27Refactor top-level division selection (#3261)Albert Krewinkel1-8/+9
The "default" option is no longer represented as `Nothing` but via a new type constructor, making the `Maybe` wrapper superfluous. The default behavior of using heuristics can now be enabled explicitly by setting `--top-level-division=default`. API change (`Text.Pandoc.Options`): The `Division` type was renamed to `TopLevelDivision`. The `Section`, `Chapter`, and `Part` constructors were renamed to `TopLevelSection`, `TopLevelChapter`, and `TopLevelPart`, respectively. An additional `TopLevelDefault` constructor was added, which is now also the new default value of the `writerTopLevelDivision` field in `WriterOptions`.
2016-11-26Allow to overwrite top-level division type heuristics (#3258)Albert Krewinkel1-5/+6
Pandoc uses heuristics to determine the most resonable top-level division type when emitting LaTeX or Docbook markup. It is now possible to overwrite this implicitly set top-level division via the `top-level-division` command line parameter. API change (`Text.Pandoc.Options`): the type of the `writerTopLevelDivision` field in of the `WriterOptions` data type is altered from `Division` to `Maybe Division`. The field's default value is changed from `Section` to `Nothing`. Closes: #3197
2016-10-19Add option for top-level division typeAlbert Krewinkel1-15/+21
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-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-1/+3
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-03-18ConTeXt writer: fix whitespace at line beginning in line blocks.John MacFarlane1-1/+11
Add a `\strut` after `\crlf` before space. Closes #2744, #2745. Thanks to @c-foster. This uses the fix suggested by @c-foster. Mid-line spaces are still not supported, because of limitations of the Markdown parser.
2015-12-22ConTeXt writer: set default layout based on margin-left, etc.John MacFarlane1-0/+10
This sets up `\setuplayout` based on the variables `margin-left`, `margin-right`, `margin-bottom`, and `margin-top`, if no layout is given.
2015-12-19Fix language code for Czech (cs not cz)John MacFarlane1-1/+0
Closes #2597.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-1/+7
Added threefold wrapping option. * Command line option: deprecated `--no-wrap`, added `--wrap=[auto|none|preserve]` * Added WrapOption, exported from Text.Pandoc.Options * Changed type of writerWrapText in WriterOptions from Bool to WrapOption. * Modified Text.Pandoc.Shared functions for SoftBreak. * Supported SoftBreak in writers. * Updated tests. * Updated README. Closes #1701.
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-9/+32
mb21-new-image-attributes * Bumped version to 1.16. * Added Attr field to Link and Image. * Added `common_link_attributes` extension. * Updated readers for link attributes. * Updated writers for link attributes. * Updated tests * Updated stack.yaml to build against unreleased versions of pandoc-types and texmath. * Fixed various compiler warnings. Closes #261. TODO: * Relative (percentage) image widths in docx writer. * ODT/OpenDocument writer (untested, same issue about percentage widths). * Update pandoc-citeproc.
2015-11-09Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane1-1/+0
This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
2015-11-08Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane1-0/+1
This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
2015-10-18LaTeX and ConTeXt writers: support lang attribute on divs and spansmb211-16/+27
For LaTeX, also collect lang and dir attributes on spans and divs to set the lang, otherlangs and dir variables if they aren’t set already. See #895.
2015-09-26Support bidirectional text output with XeLaTeX, ConTeXt and HTMLmb211-9/+24
closes #2191
2015-08-20`lang` variable is now in BCP47 formatmb211-4/+36
strings are converted for LaTeX and ConTeXt output, closes #1614
2015-08-07Updated readers, writers and README for link attributemb211-5/+4
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-7/+31
(mb21)
2015-07-01ConTeXt: use `\goto` for internal links.John MacFarlane1-7/+2
2015-07-01ConTeXt writer: Added a % at end for `\reference` to avoid spurious space.John MacFarlane1-2/+2