summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Docbook.hs
Commit message (Collapse)AuthorAge
* Updated copyright notices.John MacFarlane2010-03-23
|
* Docbook writer: support images as figures.fiddlosopher2010-03-17
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1897 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use template variables for include-before/after.fiddlosopher2010-03-13
| | | | | | | | | | | | * These options now imply -s; previously they worked also in fragment mode. * Users can now adjust position of include-before and include-after text in the templates. * Default position of include-before moved back (as it originally was) before table of contents. * Resolves Issue #217. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1883 788f1e2b-df1e-0410-8736-df70ead52e1b
* Docbook writer: handle headerless tables.fiddlosopher2010-03-09
| | | | | | In addition, use cols, thead, and tbody. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1874 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed docbook writer for headerless tables.fiddlosopher2010-03-07
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1863 788f1e2b-df1e-0410-8736-df70ead52e1b
* Docbook writer: use unicode instead of entities.fiddlosopher2010-01-01
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1769 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed redundant imports (found by ghc 6.12).fiddlosopher2009-12-31
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1750 788f1e2b-df1e-0410-8736-df70ead52e1b
* Updated docbook writer to use new templates.fiddlosopher2009-12-31
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1728 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed unneeded writer options; use template variables instead.fiddlosopher2009-12-31
| | | | | | | | | Removed writerIncludeAfter, writerIncludeBefore, writerTitlePrefix, writerHeader. Removed corresponding fields of Options structure in pandoc.hs. The options now set template variables (writerVariables) instead. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1684 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added optional section numbering in HTML output.fiddlosopher2009-12-08
| | | | | | | | | | | | This involves a change to the Element data structure, including a section number as well as an id and title for each section. Section numbers are lists of integers; this should allow different numbering schemes to be used in the future. Currently [1,2,3] -> 1.2.3. Resolves Issue #150. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1658 788f1e2b-df1e-0410-8736-df70ead52e1b
* Improved syntax for markdown definition lists.fiddlosopher2009-12-07
| | | | | | | | | | | | | | | | | | | Definition lists are now more compatible with PHP Markdown Extra. Resolves Issue #24. + You can have multiple definitions for a term (but still not multiple terms). + Multi-block definitions no longer need a column before each block (indeed, this will now cause multiple definitions). + The marker no longer needs to be flush with the left margin, but can be indented at or two spaces. Also, ~ as well as : can be used as the marker (this suggestion due to David Wheeler.) + There can now be a blank line between the term and the definitions. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1656 788f1e2b-df1e-0410-8736-df70ead52e1b
* Docbook writer: add ids to sections. Use link for internal links.fiddlosopher2009-12-05
| | | | | | See Issue #60. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1651 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use language attribute to indicate source language in docbook code blocks.fiddlosopher2009-07-03
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1587 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: wrap sections in divs. Resolves Issue #70.fiddlosopher2009-04-25
| | | | | | | | | | | | | | | | | | | | + hierarchicalize has been rationalized; it builds a hierarchical representation of the document from the headers, and simultaneously gives each section a unique identifier based on the heading title. + Identifiers are now attached to the divs rather than to the headers themselves. + Table of content backlinks go to the beginning of the table, rather than to the section reference that was clicked. This seems better. + Code for constructing identifiers has been moved to Text.Pandoc.Shared from the HTML writer, since it is now consumed only by hierarchicalize. + In --strict mode, pandoc just prints bare headings, as before (unless --toc has been specified). + In s5 output, it does not wrap sections in divs, as that seems to confuse the s5 javascript. + Test suite updated accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1562 788f1e2b-df1e-0410-8736-df70ead52e1b
* Moved all haskell source to src subdirectory.fiddlosopher2009-01-24
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1528 788f1e2b-df1e-0410-8736-df70ead52e1b
* Moved everything from src into the top-level directory.fiddlosopher2007-11-29
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1104 788f1e2b-df1e-0410-8736-df70ead52e1b
* Reverted back to state as of r1062. The template haskell changesfiddlosopher2007-11-03
| | | | | | | are more trouble than they're worth. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1064 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use template haskell to avoid the need for templates:fiddlosopher2007-11-03
| | | | | | | | | | | | | | | | | | + Added library Text.Pandoc.Include, with a template haskell function $(includeStrFrom fname) to include a file as a string constant at compile time. + This removes the need for the 'templates' directory or Makefile target. These have been removed. + The base source directory has been changed from src to . + A new 'data' directory has been added, containing the ASCIIMathML.js script, writer headers, and S5 files. + The src/wrappers directory has been moved to 'wrappers'. + The Text.Pandoc.ASCIIMathML library is no longer needed, since Text.Pandoc.Writers.HTML can use includeStrFrom to include the ASCIIMathML.js code directly. It has been removed. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1063 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added a writer option for wrapped text and a command-line optionfiddlosopher2007-09-27
| | | | | | | | | | | | | | '--no-wrap', which disables text wrapping. (Resolves Issue #26.) + Added support for '--no-wrap' to Main.hs. + Added wrapIfNeeded function to Text.Pandoc.Shared. + Use wrapIfNeeded instead of wrapped in the RST, Man, Docbook, and Markdown writers. + Note: Not yet implemented in HTML, LaTeX, or ConTeXt writers. No documentation yet. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1034 788f1e2b-df1e-0410-8736-df70ead52e1b
* Major code cleanup in all modules. (Removed unneeded imports,fiddlosopher2007-08-15
| | | | | | | | | | | | | | | | | | | | | | | | | | | reformatted, etc.) More major changes are documented below: + Removed Text.Pandoc.ParserCombinators and moved all its definitions to Text.Pandoc.Shared. + In Text.Pandoc.Shared: - Removed unneeded 'try' in blanklines. - Removed endsWith function and rewrote functions to use isSuffixOf instead. - Added >>~ combinator. - Rewrote stripTrailingNewlines, removeLeadingSpaces. + Moved Text.Pandoc.Entities -> Text.Pandoc.CharacterReferences. - Removed unneeded functions charToEntity, charToNumericalEntity. - Renamed functions using proper terminology (character references, not entities). decodeEntities -> decodeCharacterReferences, characterEntity -> characterReference. - Moved escapeStringToXML to Docbook writer, which is the only thing that uses it. - Removed old entity parser in HTML and Markdown readers; replaced with new charRef parser in Text.Pandoc.Shared. + Fixed accent bug in Text.Pandoc.Readers.LaTeX: \^{} now correctly parses as a '^' character. + Text.Pandoc.ASCIIMathML is no longer an exported module. git-svn-id: https://pandoc.googlecode.com/svn/trunk@835 788f1e2b-df1e-0410-8736-df70ead52e1b
* Major change in the way ordered lists are handled:fiddlosopher2007-08-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + The changes are documented in README, under Lists. + The OrderedList block element now stores information about list number style, list number delimiter, and starting number. + The readers parse this information, when possible. + The writers use this information to style ordered lists. + Test suites have been changed accordingly. Motivation: It's often useful to start lists with numbers other than 1, and to have control over the style of the list. Added to Text.Pandoc.Shared: + camelCaseToHyphenated + toRomanNumeral + anyOrderedListMarker + orderedListMarker + orderedListMarkers Added to Text.Pandoc.ParserCombinators: + charsInBalanced' + withHorizDisplacement + romanNumeral RST writer: + Force blank line before lists, so that sublists will be handled correctly. LaTeX reader: + Fixed bug in parsing of footnotes containing multiple paragraphs, introduced by use of charsInBalanced. Fix: use charsInBalanced' instead. LaTeX header: + use mathletters option in ucs package, so that basic unicode Greek letters will work properly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@834 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed a bug in Docbook writer: email links with text were beingfiddlosopher2007-07-28
| | | | | | | incorrectly treated as autolinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@809 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed text to char for one character stringsfiddlosopher2007-07-22
| | | | | | | in RST, Man, and Docbook writers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@757 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Added support for superscript, subscript, andfiddlosopher2007-07-22
| | | | | | | | | | | | | | strikeout to all writers. (Thanks to Bradley Kuhn for the patches for strikeout, here slightly modified.) + Refactored character escaping using the new functions escapeStringUsing and backslashEscapes. + Added state to LaTeX writer, which now keeps track of what packages need to be included in the preamble, based on the content of the document. (Thus, e.g., ulem is only required if you use strikeout.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@755 788f1e2b-df1e-0410-8736-df70ead52e1b
* Adjusted copyright notices to 2006-7; usefiddlosopher2007-07-07
| | | | | | | | real email address instead of lamely attempting to obfuscate. git-svn-id: https://pandoc.googlecode.com/svn/trunk@640 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Introduced writerIgnoreNotes option in WriterOptions. This is neededfiddlosopher2007-07-07
| | | | | | | | | | | for processing header blocks for a table of contents, since notes on headers should not appear in the TOC. Set default in Main.hs. + Moved Element, headerAtLeast, and hierarchicalize from Docbook writer to Text.Pandoc.Shared. This is because HTML writer now uses these in constructing a table of contents. git-svn-id: https://pandoc.googlecode.com/svn/trunk@633 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added support for definition lists in Docbook writer.fiddlosopher2007-05-09
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@595 788f1e2b-df1e-0410-8736-df70ead52e1b
* Extensive changes stemming from a rethinking of the Pandoc datafiddlosopher2007-04-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | structure. Key and Note blocks have been removed. Link and image URLs are now stored directly in Link and Image inlines, and note blocks are stored in Note inlines. This requires changes in both parsers and writers. Markdown and RST parsers need to extract data from key and note blocks and insert them into the relevant inline elements. Other parsers can be simplified, since there is no longer any need to construct separate key and note blocks. Markdown, RST, and HTML writers need to construct lists of notes; Markdown and RST writers need to construct lists of link references (when the --reference-links option is specified); and the RST writer needs to construct a list of image substitution references. All writers have been rewritten to use the State monad when state is required. This rewrite yields a small speed boost and considerably cleaner code. * Text/Pandoc/Definition.hs: + blocks: removed Key and Note + inlines: removed NoteRef, added Note + modified Target: there is no longer a 'Ref' target; all targets are explicit URL, title pairs * Text/Pandoc/Shared.hs: + Added 'Reference', 'isNoteBlock', 'isKeyBlock', 'isLineClump', used in some of the readers. + Removed 'generateReference', 'keyTable', 'replaceReferenceLinks', 'replaceRefLinksBlockList', along with some auxiliary functions used only by them. These are no longer needed, since reference links are resolved in the Markdown and RST readers. + Moved 'inTags', 'selfClosingTag', 'inTagsSimple', and 'inTagsIndented' to the Docbook writer, since that is now the only module that uses them. + Changed name of 'escapeSGMLString' to 'escapeStringForXML' + Added KeyTable and NoteTable types + Removed fields from ParserState; 'stateKeyBlocks', 'stateKeysUsed', 'stateNoteBlocks', 'stateNoteIdentifiers', 'stateInlineLinks'. Added 'stateKeys' and 'stateNotes'. + Added clause for Note to 'prettyBlock'. + Added 'writerNotes', 'writerReferenceLinks' fields to WriterOptions. * Text/Pandoc/Entities.hs: Renamed 'escapeSGMLChar' and 'escapeSGMLString' to 'escapeCharForXML' and 'escapeStringForXML' * Text/ParserCombinators/Pandoc.hs: Added lineClump parser: parses a raw line block up to and including following blank lines. * Main.hs: Replaced --inline-links with --reference-links. * README: + Documented --reference-links and removed description of --inline-links. + Added note that footnotes may occur anywhere in the document, but must be at the outer level, not embedded in block elements. * man/man1/pandoc.1, man/man1/html2markdown.1: Removed --inline-links option, added --reference-links option * Markdown and RST readers: + Rewrote to fit new Pandoc definition. Since there are no longer Note or Key blocks, all note and key blocks are parsed on a first pass through the document. Once tables of notes and keys have been constructed, the remaining parts of the document are reassembled and parsed. + Refactored link parsers. * LaTeX and HTML readers: Rewrote to fit new Pandoc definition. Since there are no longer Note or Key blocks, notes and references can be parsed in a single pass through the document. * RST, Markdown, and HTML writers: Rewrote using state monad new Pandoc and definition. State is used to hold lists of references footnotes to and be printed at the end of the document. * RTF and LaTeX writers: Rewrote using new Pandoc definition. (Because of the different treatment of footnotes, the "notes" parameter is no longer needed in the block and inline conversion functions.) * Docbook writer: + Moved the functions 'attributeList', 'inTags', 'selfClosingTag', 'inTagsSimple', 'inTagsIndented' from Text/Pandoc/Shared, since they are now used only by the Docbook writer. + Rewrote using new Pandoc definition. (Because of the different treatment of footnotes, the "notes" parameter is no longer needed in the block and inline conversion functions.) * Updated test suite * Throughout: old haskell98 module names replaced by hierarchical module names, e.g. List by Data.List. * debian/control: Include libghc6-xhtml-dev instead of libghc6-html-dev in "Build-Depends." * cabalize: + Remove haskell98 from BASE_DEPENDS (since now the new hierarchical module names are being used throughout) + Added mtl to BASE_DEPENDS (needed for state monad) + Removed html from GHC66_DEPENDS (not needed since xhtml is now used) git-svn-id: https://pandoc.googlecode.com/svn/trunk@580 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed Blank block element as unnecessary.fiddlosopher2007-03-17
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@578 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed 'encodeEntities' to 'escapeSGMLString'.fiddlosopher2007-01-28
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@520 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Simplified entity handling by removing stringToSGML from Entities.hs.fiddlosopher2007-01-28
| | | | | | | | | | | | | | | | | | | It is no longer needed now that all entities are processed in the markdown and HTML readers. All calls to stringToSGML have been replaced by calls to encodeEntities. + Since inTag's attribute handling already encodes entities, calls to encodeEntities are no longer needed for attribute values, so they've been removed. + The HTML and Markdown readers now call decodeEntities on all raw strings (e.g. authors, dates, link titles), to ensure that no unprocessed entities are included in the native representation of the document. (In the HTML reader, most of this work is done by a change in extractAttributeName.) + The result is a small speed improvement (around 5% on my benchmark) and cleaner code. git-svn-id: https://pandoc.googlecode.com/svn/trunk@519 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use encodeEntities rather than stringToSGML for contents offiddlosopher2007-01-27
| | | | | | | | Str inline in Docbook and HTML writers, since now these strings should not contain literal entity references. git-svn-id: https://pandoc.googlecode.com/svn/trunk@518 788f1e2b-df1e-0410-8736-df70ead52e1b
* More changes in entity handling: Instead of using entities for charactersfiddlosopher2007-01-27
| | | | | | | | | | | | | | | | | | above 128 in HTML and Docbook output, we now just use unicode. After all, we're declaring UTF-8 content in the header. This makes the HTML and docbook files produced by pandoc much more readable and editable. Changes to Entities.hs: + Removed specialCharToEntity + Added escapeSGMLChar (which just escapes the basic four, <>&") + Modified encodeEntities and stringToSGML to use escapeSGMLChar + Removed encodeEntitiesNumerical + Rewrote encodeEntities for better performance + Rewrote stringToSGML for better performance git-svn-id: https://pandoc.googlecode.com/svn/trunk@516 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changes in entity handling:fiddlosopher2007-01-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | + Entities are parsed (and unicode characters returned) in both Markdown and HTML readers. + Parsers characterEntity, namedEntity, decimalEntity, hexEntity added to Entities.hs; these parse a string and return a unicode character. + Changed 'entity' parser in HTML reader to use the 'characterEntity' parser from Entities.hs. + Added new 'entity' parser to Markdown reader, and added '&' as a special character. Adjusted test suite accordingly since now we get 'Str "AT",Str "&",Str "T"' instead of 'Str "AT&T".. + stringToSGML moved to Entities.hs. escapeSGML removed as redundant, given encodeEntities. + stringToSGML, encodeEntities, and specialCharToEntity are given a boolean parameter that causes only numerical entities to be used. This is used in the docbook writer. The HTML writer uses named entities where possible, but not all docbook-consumers know about the named entities without special instructions, so it seems safer to use numerical entities there. + decodeEntities is rewritten in a way that avoids Text.Regex, using the new parsers. + charToEntity and charToNumericalEntity added to Entities.hs. + Moved specialCharToEntity from Shared.hs to Entities.hs. + Removed unneeded 'decodeEntities' from 'str' parser in HTML and Markdown readers. + Removed sgmlHexEntity, sgmlDecimalEntity, sgmlNamedEntity, and sgmlCharacterEntity from Shared.hs. + Modified Docbook writer so that it doesn't rely on Text.Regex for detecting "mailto" links. git-svn-id: https://pandoc.googlecode.com/svn/trunk@515 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added support for tables in markdown reader and in LaTeX,fiddlosopher2007-01-15
| | | | | | | | DocBook, and HTML writers. The syntax is documented in README. Tests have been added to the test suite. git-svn-id: https://pandoc.googlecode.com/svn/trunk@493 788f1e2b-df1e-0410-8736-df70ead52e1b
* Don't use named entities in docbook writer. Instead, usefiddlosopher2007-01-09
| | | | | | | numerical entities, for portability across stylesheets. git-svn-id: https://pandoc.googlecode.com/svn/trunk@473 788f1e2b-df1e-0410-8736-df70ead52e1b
* Merged changes from 'quotes' branch since r431. Smart typographyfiddlosopher2007-01-06
| | | | | | | | | is now handled in the Markdown and LaTeX readers, rather than in the writers. The HTML writer has been rewritten to use the prettyprinting library. git-svn-id: https://pandoc.googlecode.com/svn/trunk@436 788f1e2b-df1e-0410-8736-df70ead52e1b
* Refactored SGML escaping functions and "in tag" functions tofiddlosopher2007-01-04
| | | | | | | | | Text/Shared/Pandoc. (escapeSGML, stringToSGML, inTag, inTagSimple, inTagIndented, selfClosingTag) These can be used by both the HTML and Docbook writers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@417 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed unneeded 'options' parameter from 'indentedInTags' functionfiddlosopher2007-01-04
| | | | | | | in Docbook writer. git-svn-id: https://pandoc.googlecode.com/svn/trunk@413 788f1e2b-df1e-0410-8736-df70ead52e1b
* + Improved text wrapping algorithm in markdown, docbook, and RST writers.fiddlosopher2007-01-04
| | | | | | | | | LineBreaks no longer cause ugly wrapping in Markdown output. + Replaced splitBySpace with the more general, polymorphic function splitBy (in Text/Pandoc/Shared). git-svn-id: https://pandoc.googlecode.com/svn/trunk@411 788f1e2b-df1e-0410-8736-df70ead52e1b
* Change 'HtmlEntities' module to 'Entities'. Adjusted callingfiddlosopher2007-01-02
| | | | | | | code accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@395 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use entities for all characters above 127 in docbook output.fiddlosopher2007-01-02
| | | | | | | | | | | | Though XML tools should support unicode, some people will be using SGML tools, and these do not. Using entities makes the docbook files more portable. Also refactored encodeEntities and charToHtmlEntity in HtmlEntities.hs git-svn-id: https://pandoc.googlecode.com/svn/trunk@394 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed representation of code blocks to use <screen> andfiddlosopher2007-01-01
| | | | | | | | escaped characters rather than <programlisting> and CDATA. Reason: XML source more easily editable and readable. git-svn-id: https://pandoc.googlecode.com/svn/trunk@393 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed a line that was causing a compiler warning in docbookfiddlosopher2007-01-01
| | | | | | | | writer. The line isn't necessary, since we have a case for every kind of block element. git-svn-id: https://pandoc.googlecode.com/svn/trunk@388 788f1e2b-df1e-0410-8736-df70ead52e1b
* Merged changes from docbook branch since r363.fiddlosopher2007-01-01
git-svn-id: https://pandoc.googlecode.com/svn/trunk@386 788f1e2b-df1e-0410-8736-df70ead52e1b