aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/DocBook.hs
AgeCommit message (Collapse)AuthorFilesLines
2017-10-27hlint changes.John MacFarlane1-18/+22
2017-09-26Fix a typo: s/collabarators/collaborators/Alexander Krotov1-1/+1
2017-06-20Move CR filtering from tabFilter to the readers.John MacFarlane1-2/+3
The readers previously assumed that CRs had been filtered from the input. Now we strip the CRs in the readers themselves, before parsing. (The point of this is just to simplify the parsers.) Shared now exports a new function `crFilter`. [API change] And `tabFilter` no longer filters CRs.
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-10Changed all readers to take Text instead of String.John MacFarlane1-3/+5
Readers: Renamed StringReader -> TextReader. Updated tests. API change.
2017-01-25Working on readers.Jesse Rosenthal1-16/+16
2016-11-19Fixed xref lookup in DocBook reader. Closes #3243.John MacFarlane1-4/+6
It previously only worked when the qnames lacked the docbook namespace URI.
2016-10-13Parse line-oriented markup as LineBlockAlbert Krewinkel1-3/+3
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.
2016-09-02Remove TagSoup compatJesse Rosenthal1-3/+3
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.
2016-09-02Remove Text.Pandoc.Compat.ExceptJesse Rosenthal1-1/+1
2015-11-19Merge branch 'new-image-attributes' of https://github.com/mb21/pandoc into ↵John MacFarlane1-7/+17
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-14Use custom Prelude to avoid compiler warnings.John MacFarlane1-2/+0
- The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
2015-09-24Improve text generated for <xref> by employing docbook-xsl heuristicsFrerich Raabe1-2/+16
docbook-xsl, a set of XSLT scripts to generate HMTL out of DocBook, tries harder to generate a nice xref text. Depending on the element being linked to, it looks at the title or other descriptive child elements. Let's do that, too.
2015-09-24Added proper support for DocBook 'xref' elementsFrerich Raabe1-2/+18
'xref' is used to create cross references to other parts of the document. It is an empty element - the cross reference text depends on various attributes. Quoting 'DocBook: The Definitive Guide': 1. If the endterm attribute is specified on xref, the content of the element pointed to by endterm will be used as the text of the cross-reference. 2. Otherwise, if the object pointed to has a specified XRefLabel, the content of that attribute will be used as the cross-reference text.
2015-09-23Pass the parsed DocBook content along the state of readDocBookFrerich Raabe1-2/+4
Having access to the entire document will be needed when handling elements which refer to other elements. This is needed for e.g. <xref> or <link>, both of which reference other elements (by the 'id' attribute) for the label text. I suppose that in practice, the [Content] returned by parseXML always only contains one 'Elem' value -- the document element. However, I'm not totally sure about it, so let's just pass all the Content along.
2015-09-23Minor refactoring to readDocBookFrerich Raabe1-2/+2
I plan to use the parsed and normalized XML tree read in readDocBook in other places - prepare that commit by factoring this code out into a separate, shared, definition.
2015-08-08DocBook reader: handle informalexample.John MacFarlane1-1/+4
It is parsed into a Div with class `informalexample`. Closes #2319.
2015-08-07Updated readers, writers and README for link attributemb211-1/+2
2015-08-07Updated readers and writers for new image attribute parameter.John MacFarlane1-6/+15
(mb21)
2015-06-21DocBook reader mediaobjects and figures, closes #2184mb211-11/+20
2015-04-07Removed redundat import.John MacFarlane1-1/+0
2015-04-07DocBook reader: look inside "info" elements for section titles.John MacFarlane1-1/+4
Closes #1931.
2015-02-18Change return type of DocBook readerMatthew Pickering1-11/+16
2014-12-14DocBook readers: Include id on section headers.John MacFarlane1-1/+2
Closes #1818.
2014-12-14DocBook reader: Handle menuchoice elements better.John MacFarlane1-4/+11
They are now rendered with a `>` between them. Closes #1817.
2014-12-14DocBook reader: get string content in inner tags for literal elements.John MacFarlane1-6/+9
Closes #1816.
2014-12-14DocBook reader: handle keycombo, keycap.John MacFarlane1-2/+6
Closes #1815.
2014-12-08DocBook reader: document/test "type" as implementedBryan O'Sullivan1-1/+1
2014-12-08DocBook reader: add support for classnameBryan O'Sullivan1-1/+2
2014-12-08DocBook reader: add support for calloutlist and calloutBryan O'Sullivan1-3/+5
We treat a calloutlist as a bulleted list. This works well in practice.
2014-08-12DocBook: Support equations with mathml.John MacFarlane1-4/+16
equation, informalequation, inlineequation and mml:math elements.
2014-07-23DocBook reader: Better handle elements inside code environments.John MacFarlane1-1/+6
Of course, we can't include structure in the code block, but this way we at least preserve the text. Closes #1449.
2014-06-17DocBook reader: Support <?asciidoc-br?>.John MacFarlane1-2/+17
Closes #1236. Note, this is a bit of a kludge, to work around the fact that xml-light doesn't parse `<?asciidoc-br?>` correctly. We preprocess the input, replacing that instruction with `<br/>`, and then parse that as a line break. Other XML instructions are simply removed from the input stream.
2014-04-04DocBook reader: Better treatment of formalpara.John MacFarlane1-3/+3
We now emit the title (if present) as a separate paragraph with boldface text. Closes #1215.
2014-04-04DocBook reader: set metadata "author" not "authors"John MacFarlane1-1/+1
2014-04-04Removed trailing whitespace.John MacFarlane1-15/+15
2014-04-04DocBook reader: set "author" not "authors".John MacFarlane1-3/+3
2014-04-04Added recognition of authorgroup element and releaseinfo element to DocBook ↵Matthew Pickering1-9/+16
reader. Closes #1214
2014-04-04Converted current meta information parsing in DocBook to a more extensible ↵Matthew Pickering1-34/+48
version which is aware of the more recent meta representation.
2013-12-19HLint: use fromMaybeHenry de Valence1-3/+4
Replace uses of `maybe x id` with `fromMaybe x`.
2013-12-16Docbook reader: Avoid failure if tbody contains no tr or row elements.John MacFarlane1-1/+3
2013-10-22DocBook reader: Handle numerical attributes starting with decimal.John MacFarlane1-6/+7
Also use safeRead instead of read.
2013-08-08Added Text.Pandoc.Compat.TagSoupEntity.John MacFarlane1-1/+1
This allows pandoc to compile with tagsoup 0.13.x. Thanks to Dirk Ullrich for the patch.
2013-01-06Don't put the text of an autolink in Code font.John MacFarlane1-3/+3
2012-11-02DocBook reader: Support title in "figure" element.John MacFarlane1-6/+21
Closes #650.
2012-07-26Fixed whitespace errors.John MacFarlane1-5/+5
2012-07-25Changed reader parameters from ParserState to ReaderOptions.John MacFarlane1-2/+2
2012-06-26Docbook reader: Added support for "bold" emphasis.John MacFarlane1-0/+1
Thanks to mb21.