aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2017-06-25Writers.Shared: refactored getLang, splitLang...John MacFarlane4-36/+55
into `Lang(..)`, `getLang`, `parceBCP47`.
2017-06-25Fixed support for `lang` attribute in OpenDocument and ODT writers.John MacFarlane1-20/+15
This improves on the last commit, which didn't work in some important ways. See #1667.
2017-06-25Support `lang` attribute in OpenDocument and ODT writers.John MacFarlane3-18/+72
This adds the required attributes to the temporary styles, and also replaces existing language attributes in styles.xml. Support for lang attributes on Div and Span has also been added. Closes #1667.
2017-06-25Text.Pandoc.Writers.Shared: export splitLang.John MacFarlane1-0/+19
2017-06-25Text.Pandoc.Writers.Shared: added getLang.John MacFarlane1-2/+13
2017-06-23Markdown writer: make sure `plain`, `markdown_github`, etc. work for raw.John MacFarlane1-5/+9
Previously only `markdown` worked. Note: currently a raw block labeled `markdown_github` will be printed for any `markdown` format.
2017-06-23HTML writer: make sure html4, html5 formats work for raw blocks/inlines.John MacFarlane1-14/+26
2017-06-22EPUB writer: put title_page.xhtml in text/.John MacFarlane1-2/+2
2017-06-22EPUB writer: Fixed various things with new EPUB structure.John MacFarlane1-6/+6
2017-06-22Added `writerEpubSubdirectory` to `WriterOptions`.John MacFarlane1-8/+8
[API change] The EPUB writer now takes its EPUB subdirectory from this option. Also added `PandocEpubSubdirectoryError` to `PandocError`. This is raised if the EPUB subdirectory is not all ASCII alphanumerics. See #3720.
2017-06-21Change default EPUB directory structure in OCF container.John MacFarlane1-11/+22
See #3720. We now put all EPUB related content in an EPUB/ subdirectory by default (later this will be configurable). mimetype META-INF/ com.apple.ibooks.display-options.xml container.xml EPUB/ <<--configurable-->> fonts/ <<--static-->> font.otf media/ <<--static-->> cover.jpg fig1.jpg styles/ <<--static-->> stylesheet.css content.opf toc.ncx text/ <<--static-->> ch001.xhtml
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane25-47/+51
Now we raise a proper error on template failure.
2017-06-20Removed redundant import.John MacFarlane1-1/+0
2017-06-20Docbook, JATS, TEI writers: print INFO message when omitting interior header.John MacFarlane3-8/+14
This only applies to section headers inside list items, e.g., which were otherwise silently omitted. See #3750.
2017-06-20FB2 writer: don't fail with an error on interior headers (e.g. in list).John MacFarlane1-3/+5
Instead, omit them with an INFO message. Closes #3750.
2017-06-20Fixed footnotes in table captions.John MacFarlane1-16/+18
Note that if the table has a first page header and a continuation page header, the notes will appear only on the first occurrence of the header. Closes #2378.
2017-06-19Text.Pandoc.Writers.Math: export defaultMathJaxURL, defaultKaTeXURL.John MacFarlane1-0/+7
This will ensure that we only need to update these in one place. (Currently, for example, the mathjax URL is used in both App and trypandoc.) Closes #3685.
2017-06-18Use revealjs's math plugin for mathjax.John MacFarlane1-1/+7
This is a thin wrapper around mathjax that makes math look better on revealjs. See https://github.com/hakimel/reveal.js/#mathjax We do this by setting the 'mathjax' boolean variable and using it in the revealjs template. Also, for revealjs and mathjax, we don't assign the usual thing to the 'math' variable, since it's handled by mathjax config. Closes #3743.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane23-24/+24
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-12Markdown writer: don't allow soft break in header.John MacFarlane1-0/+7
Closes #3736.
2017-06-11Switched Writer types to use Text.John MacFarlane29-149/+211
* 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-06-10Writers.Shared: metaToJSON, generalized type so it can take a Text.John MacFarlane1-9/+9
Previously a String was needed as argument; now any ToJSON instance will do. API change.
2017-06-03Improve code style in lua and org modulesAlbert Krewinkel1-16/+14
2017-06-02Fixed keywords in docx writer.John MacFarlane1-1/+6
(See #3719)
2017-06-02Add keywords metadata to docx document propertiesIan1-0/+1
Hi, I don't know haskell so possibly this is wrong, but DOCX stores keywords in cp:keywords in core.xml, and this should be easy to add from the pandoc metadata (I copy and paste the author code). As far as I can tell (no clear documentation, just a few refs), keywords should be separated with a comma.
2017-06-01HTML writer: Avoid two class attributes when adding 'uri' class.John MacFarlane1-7/+7
Closes #3716.
2017-06-01Markdown writer: Avoid inline surround-marking with empty content.John MacFarlane1-0/+5
E.g. we don't want `<strong></strong>` to become `****`. Similarly for emphasis, super/subscript, strikeout. Closes #3715.
2017-05-27Markdown writer: changes to `--reference-links`.John MacFarlane1-15/+44
With `--reference-location` of `section` or `block`, pandoc will now repeat references that have been used in earlier sections. The Markdown reader has also been modified, so that *exactly* repeated references do not generate a warning, only references with the same label but different targets. The idea is that, with references after every block, one might want to repeat references sometimes. Closes #3701.
2017-05-26HTML writer: Removed unused parameter in dimensionsToAttributeList.John MacFarlane1-3/+3
2017-05-25Allow em for image height/width in HTML, LaTeX.John MacFarlane1-4/+3
- Export `inEm` from ImageSize [API change]. - Change `showFl` and `show` instance for `Dimension` so extra decimal places are omitted. - Added `Em` as a constructor of `Dimension` [API change]. - Allow `em`, `cm`, `in` to pass through without conversion in HTML, LaTeX. Closes #3450.
2017-05-25Docx writer: Use Table rather than "Table Normal" for table style.John MacFarlane1-1/+1
"Table Normal" is the default table style and can't be modified. Closes #3275, further testing welcome.
2017-05-23Fixed handling of soft hyphen (0173) in docx writer.John MacFarlane1-7/+19
Closes #3691.
2017-05-23Shared: Provide custom isURI that rejects unknown schemes [isURI]Albert Krewinkel11-16/+8
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-19RST writer: add empty comments when needed...John MacFarlane1-3/+25
to avoid including a blocquote in the indented content of a preceding block. Closes #3675.
2017-05-18Don't render LaTeX images with data: URIs.John MacFarlane1-0/+3
LaTeX can't handle these. Note that --extract-media can be used when the input contains data: URIs. Closes #3636.
2017-05-18Docx writer: Change FigureWithCaption to CaptionedFigure (#3658)Ian1-1/+1
Edit styles.xml as part of the fix for #3656
2017-05-17Markdown writer: Fixed duplicated reference linksJohn MacFarlane1-11/+15
with `--reference-links` and `--reference-location=section`. Also ensure that there are no empty link references `[]`. Closes #3674.
2017-05-13Update dates in copyright noticesAlbert Krewinkel29-57/+62
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-13Add haddock module description to FB2 writerAlbert Krewinkel1-1/+11
Copyright, maintainer etc. were missing in haddock docs for this module.
2017-05-13Change maintainer line in Org writer moduleAlbert Krewinkel1-1/+1
2017-05-07Markdown writer: missing \n (#3647)David A Roberts1-1/+1
2017-05-07Muse writer: Indent tables with one space (#3649)Alexander Krotov1-2/+2
It is required to trigger Muse table rendering.
2017-05-04Muse writer: omit automatic header identifiers (#3633)Alexander Krotov1-1/+10
2017-05-03Markdown writer: better escaping for links (#3628)David A Roberts1-1/+10
Previously the Markdown writer would sometimes create links where there were none in the source. This is now avoided by selectively escaping bracket characters when they occur in a place where a link might be created. Closes #3619.
2017-05-03Markdown Writer: put space before reference link definitionsMauro Bieg1-1/+1
Fixes #3630 (#3631). Previously the attributes in link reference definitions did not have a space preceding.
2017-05-02Added PandocResourceNotFound error.John MacFarlane4-21/+7
Use this instead of PandocIOError when a resource is not found in path. This improves the error message in this case, see #3629.
2017-05-02Markdown writer: Case-insensitive reference links. (#3616)David A Roberts1-14/+16
Ensure that we do not generate reference links whose labels differ only by case. Also allow implicit reference links when the link text and label are identical up to case. Closes #3615.
2017-05-02FB2 writer: Add support for "lang" metadata (#3625)Alexander Krotov1-2/+7
2017-04-29LaTeX writer: Fix problem with escaping in lstinline.John MacFarlane1-1/+6
Previously the LaTeX writer created invalid LaTeX when `--listings` was specified and a code span occured inside emphasis or another construction. This is because the characters `%{}\` must be escaped in lstinline when the listinline occurs in another command, otherwise they must not be escaped. To deal with this, adoping Michael Kofler's suggestion, we always wrap lstinline in a dummy command `\passthrough`, now defined in the default template if `--listings` is specified. This way we can consistently escape the special characters. Closes #1629.
2017-04-28LaTeX writer: don't use lstinline it \item[..].John MacFarlane1-1/+7
If you do, the contents of item disappear or are misplaced. Use `\texttt` instead. Closes #645.