aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Man.hs
AgeCommit message (Collapse)AuthorFilesLines
2018-10-02Removed Text.Pandoc.Groff.John MacFarlane1-1/+0
Moved groffEscape function to Text.Pandoc.Writers.Shared. [API change, since T.P.W.S is exported.]
2018-10-01Shared: new export `splitSentences` [API change].John MacFarlane1-26/+0
This was duplicated in the Man and Ms writers, and really belongs in Shared.
2018-09-30Implement `--ascii` (`writerPreferAscii`) in writers, not App.John MacFarlane1-1/+3
Now the `write*` functions for Docbook, HTML, ICML, JATS, Man, Ms, OPML are sensitive to `writerPreferAscii`. Previously the to-ascii translation was done in Text.Pandoc.App, and thus not available to those using the writer functions directly. In addition, the LaTeX writer is now sensitive to `writerPreferAscii` and to `--ascii`. 100% ASCII output can't be guaranteed, but the writer will use commands like `\"{a}` and `\l` whenever possible, to avoid emiting a non-ASCII character. A new unexported module, Text.Pandoc.Groff, has been added to store functions used in the different groff-based writers.
2018-09-04hlint some writersAlexander Krotov1-2/+2
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-19hlint code improvements.John MacFarlane1-1/+1
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-2/+2
2017-12-09Man writer: omit internal links.John MacFarlane1-0/+2
That is, just print the link text without the url. Closes #4136.
2017-10-29Source code reformatting.John MacFarlane1-1/+1
2017-10-29hlint suggestions.John MacFarlane1-17/+17
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-1/+1
2017-08-07Man writer: removed some unneeded imports.John MacFarlane1-2/+0
2017-08-07Man writer: avoid error for def lists with no definitions.John MacFarlane1-9/+12
Closes #3832.
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-1/+1
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-13/+17
* 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-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-04-12Man writer: Fix handling of nested font commands.John MacFarlane1-9/+37
Previously pandoc emitted incorrect markup for bold + italic, for example, or bold + code. Closes #3568.
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-16/+16
2017-03-01Writers: Use gets to access MonadState where possible (#3480)Alexander Krotov1-3/+3
2017-02-17Added warnings for non-rendered blocks to some writers.John MacFarlane1-5/+10
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Refactored math conversion in writers.John MacFarlane1-3/+3
* Remove exported module `Text.Pandoc.Readers.TeXMath` * Add exported module `Text.Pandoc.Writers.Math` * The function `texMathToInlines` now lives in `Text.Pandoc.Writers.Math` * Export helper function `convertMath` from `Text.Pandoc.Writers.Math` * Use these functions in all writers that do math conversion. This ensures that warnings will always be issued for failed math conversions.
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Implement Errors in PandocMonadJesse Rosenthal1-26/+31
Errors can be thrown purely with `throwError`. At the moment there are only three kinds of errors: 1. PandocFileReadError FilePath (for problems reading a file from the filesystem) 2. PandocShouldNeverHappenError String (for stuff that should never happen but we need to pattern-match anyway) 3. PandocSomeError String (a grab bag of everything else) Of course, we need to subdivide the third item in this list.
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-1/+2
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-12-05Man writer: Ensure that periods are escaped at beginning of line.John MacFarlane1-4/+2
Closes #3270.
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-10-13Add support for the LineBlock element to writersAlbert Krewinkel1-1/+2
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-08-27Man writer: allow section numbers that are not a single digit.John MacFarlane1-5/+5
Closes #3089.
2015-12-11Implemented SoftBreak and new `--wrap` option.John MacFarlane1-1/+3
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-3/+3
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-01Set the template variable $pandoc-version$ to pandocVersion by default.Alex Vong1-0/+1
* src/Text/Pandoc/Writers/Man.hs: Set $pandoc-version$ to be pandocVersion.
2015-10-01Set the template variable $hyphenate$ to true by defaultAlex Vong1-0/+1
* src/Text/Pandoc/Writers/Man.hs: Set $hyphenate$ to be true.
2015-08-07Updated readers, writers and README for link attributemb211-3/+3
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-1/+1
(mb21)
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2014-08-04Use `stripPrefix` where appropriate.Artyom Kazak1-2/+3
2014-07-19Renamed readTeXMath' to avoid name conflict with texmath 0.6.7Matthew Pickering1-2/+2
Also removed deprecated readTeXMath.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-03-12Man writer: Ensure that terms in definition lists aren't line wrapped.John MacFarlane1-1/+1
Closes #1195.
2013-11-01TexMath: Export readTeXMath', which attends to display/inline.John MacFarlane1-2/+3
Deprecate readTeXMath, and use readTeXMath' in all the writers. Require texmath >= 0.6.5.
2013-08-10Adjustments for new Format newtype.John MacFarlane1-4/+6
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+2
Currently these are "transparent" containers, except in HTML, where they produce div and span elements with attributes.
2013-07-01Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane1-2/+2
* Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified.
2013-06-29Metadata changes: Variables now completely shadow metadata.John MacFarlane1-2/+2
Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list.
2013-06-27Writers: Use defField for defaults.John MacFarlane1-7/+7
This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.