aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Texinfo.hs
AgeCommit message (Collapse)AuthorFilesLines
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/+4
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-04Stylish-haskell automatic formatting changes.John MacFarlane1-15/+15
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-2/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Unify Errors.Jesse Rosenthal1-1/+2
2017-01-25Deleted whitespace at end of source lines.John MacFarlane1-1/+1
2017-01-25Texinfo writer: restore former behavior for headers level > 4.John MacFarlane1-19/+21
The recent changes made the writer fail with an error if it encountered a header with level 5. Better to do as we did before and just print a paragraph in that case. Eventually we should emit a warning here.
2017-01-25Implement Errors in PandocMonadJesse Rosenthal1-36/+53
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-0/+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-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-0/+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-01-22Changed type of Shared.uniqueIdent argument from [String] to Set String.John MacFarlane1-3/+4
This avoids performance problems in documents with many identically named headers. Closes #2671.
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-08-07Updated readers, writers and README for link attributemb211-2/+2
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-6/+15
(mb21)
2015-05-28Texinfo writer: Removed tabs from source.John MacFarlane1-3/+3
2015-04-26Updated copyright notices to -2015. Closes #2111.John MacFarlane1-2/+2
2015-02-07Merge branch 'patch/fixTexinfoWrap' of https://github.com/timtylin/scholdoc ↵John MacFarlane1-1/+1
into timtylin-patch/fixTexinfoWrap Conflicts: src/Text/Pandoc/Writers/Texinfo.hs
2015-02-06Texinfo writer: fix wrapping by using breakable spacesTim Lin1-1/+1
2015-02-04Append newline to the LineBreak of various writersTim Lin1-1/+1
This change improves output formatting of content with a large amount of force line breaks, such as line-blocks. The following writers are affected: * Dokuwiki * HTML * EPUB (via HTML) * LaTeX * MediaWiki * OpenDocument * Texinfo This commit resolves #1924
2015-01-05ghc 7.10.1 RC1 requires specifying the type of String literals ↵Mark Wright1-1/+1
https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof...
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-01-02Use isHeaderBlock from Shared rather than defining it anew...John MacFarlane1-5/+1
2013-10-16Use isURI instead of isAbsoluteURI.John MacFarlane1-2/+2
It allows fragments identifiers.
2013-08-10Adjustments for new Format newtype.John MacFarlane1-8/+11
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+5
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/+3
* 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-3/+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-6/+6
This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.
2013-06-24Use new flexible metadata type.John MacFarlane1-21/+21
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-01-15Use 'fig:' instead of '\SOH' in title to indicate figure.John MacFarlane1-2/+2
Revises 1a4b47e93368bfbd31daccdfedbd9527ee740201
2013-01-14Implemented Ext_implicit_figures.John MacFarlane1-1/+2
* In markdown reader, add a '\1' character to the beginning of the title of an image that is alone in its paragraph, if implicit_figures extension is selected. * In writers, check for Para [Image alt (src,'\1':tit)] and treat it as a figure if possible. * Updated tests. This is a bit of a hack, but it allows us to make implicit_figures an extension of the markdown reader, rather than the writers.
2013-01-09Added Attr field to Header.John MacFarlane1-8/+8
Previously header ids were autogenerated by the writers. Now they are generated (unless supplied explicitly) in the markdown parser, if the `header_identifiers` extension is selected. In addition, the textile reader now supports id attributes on headers.
2013-01-06Don't put the text of an autolink in Code font.John MacFarlane1-1/+1
2012-09-24Texinfo writer: Fixed internal cross-references.John MacFarlane1-7/+26
Now we insert anchors after each header, and use @ref instead of @uref for links. Commas are now escaped as @comma{} only when needed; previously all commas were escaped. (This change is needed, in part, because @ref commands must be followed by a real comma or period.) Also insert a blank line in from of @verbatim environments.
2012-08-04Don't include empty captions in figures.John MacFarlane1-3/+5
Closes #581.
2012-07-26Moved WriterOptions and associated types Shared -> Options.John MacFarlane1-0/+1
2012-07-26Fixed whitespace errors.John MacFarlane1-9/+9
2012-04-25Texinfo writer: Escape special characters in node titles.John MacFarlane1-1/+2
This fixes a problem pointed out by Joost Kremers. Pandoc used to escape an '@' in a chapter title, but not in the corresponding node title, leading to invalid texinfo.
2012-03-21Texinfo writer: retain directories in image paths.Peter Wang1-1/+1
2011-12-27Replaced Apostrophe, Ellipses, EmDash, EnDash w/ unicode strings.John MacFarlane1-4/+4
2011-07-16Un-URI-escape image filenames in LaTeX, ConTeXt, RTF, Texinfo.John MacFarlane1-5/+7
Also do this when copying image files into EPUBs and ODTs. Closes #263.
2011-01-26Add support for attributes in inline Code.John MacFarlane1-2/+2
Additional related changes: * URLs in Code in autolinks now use class "url". * Require highlighting-kate 0.2.8.2, which omits the final <br/> tag, essential for inline code.
2011-01-26Adjusted writers to use "tex".John MacFarlane1-1/+1
2011-01-26Bumped version to 1.8; depend on pandoc-types 1.8.John MacFarlane1-3/+8
The old TeX, HtmlInline and RawHtml elements have been removed and replaced by generic RawInline and RawBlock elements. All modules updated to use the new raw elements.
2010-12-22Texinfo writer: Updated to use Pretty.John MacFarlane1-56/+37
2010-03-27Implemented @ for sequentially numbered examples.John MacFarlane1-0/+1
Also implemented (@label) for example labels and references.
2010-03-23Updated copyright notices.John MacFarlane1-2/+2