summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/HTML.hs
Commit message (Collapse)AuthorAge
* Don't escape URIs in HTML writer.John MacFarlane2010-03-23
| | | | This should be done in the readers instead.
* Updated copyright notices.John MacFarlane2010-03-23
|
* Fixed treatment of unicode characters in URIs.John MacFarlane2010-03-23
| | | | | | | | | | | | | | * Added stringToURI to Shared. This is used in the HTML writer for all URIs. It properly URI-encodes high characters (> 127), leaving everything else (including symbols and spaces) the same. * Modified unsanitaryURI to allow UTF8 characters in a URI. (First, we convert the URI to URI-encoded octets, then we pass through parseURIReference.) This resolves gitit Issue #99. Previously '[abc](http://gitit.net/测试)' would not be rendered as a link when --sanitize was selected.
* HTML writer: fixed error in Math writer that caused infinite loop.John MacFarlane2010-03-21
|
* HTML writer: Don't include TOC div if table of contents is empty.fiddlosopher2010-03-20
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1922 788f1e2b-df1e-0410-8736-df70ead52e1b
* Added --mathml option; removed Text.Pandoc.LaTeXMathML.fiddlosopher2010-03-18
| | | | | | | | | | | * Added data/MathMLinHTML.js, which is included when no URL is provided for --mathml. This allows MathML to be displayed in better browsers, as text/html. * The module was no longer necessary; its functionality (two lines) was incorporated into pandoc.hs. * Consolidated the two LaTeXMathML.js files into one. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1909 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: Use a p rather than a div for image caption.fiddlosopher2010-03-18
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1900 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: implemented image-with-caption feature.fiddlosopher2010-03-16
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1891 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
* HTML writer: Use tbody, thead, and cols in tables.fiddlosopher2010-03-10
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1875 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: Fixed multiline tables with no header.fiddlosopher2010-03-07
| | | | | | | In this case, the widths must be in the first table row. In the process, simplified table generation code. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1864 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML, LaTeX writer: Don't print header row in headerless table.fiddlosopher2010-03-01
| | | | | | Resolves Issue #210. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1856 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: don't include empty UL if --toc but no sections.fiddlosopher2010-01-09
| | | | | | Resolves Issue #199. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1799 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: Use functions from XML module to escape strings.fiddlosopher2010-01-01
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1768 788f1e2b-df1e-0410-8736-df70ead52e1b
* Finished converting HTML writer to use unicode instead of entities.fiddlosopher2010-01-01
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1767 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use UTF8 instead of entities in HTML.fiddlosopher2009-12-31
| | | | | | Resolves Issue #163. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1744 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML footnotes: put anchor inside sup, instead of other way.fiddlosopher2009-12-31
| | | | | | Resolves Issue #191. Thanks to infinity0x for suggesting. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1743 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use $for$ for --css option in HTML writer.fiddlosopher2009-12-31
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1721 788f1e2b-df1e-0410-8736-df70ead52e1b
* Made renderTemplate polymorphic; added TemplateTarget class.fiddlosopher2009-12-31
| | | | | | | Now renderTemplate can return an Html, a Doc, a ByteString, or a String. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1712 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer changes for templates.fiddlosopher2009-12-31
| | | | | | | | | Note: now a single meta tag is used for multiple authors. Previously one tag per author was used. Fixed title in HTML template to avoid excess blank space. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1703 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
* Fixed S5.fiddlosopher2009-12-31
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1674 788f1e2b-df1e-0410-8736-df70ead52e1b
* Use HTML combinators for spans in section numbers.fiddlosopher2009-12-09
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1660 788f1e2b-df1e-0410-8736-df70ead52e1b
* Provide CSS hooks for section numbers in headers and TOC entries.fiddlosopher2009-12-08
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@1659 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
* Added --id-prefix option.fiddlosopher2009-12-05
| | | | | | | | | | | | This adds a prefix to all automatically generated HTML identifiers, which helps prevent duplicate identifiers when you're generating a fragment (say a blog post). Added writerIdentifierPrefix to WriterOptions. Resolves Issue #41. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1650 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed handling of footnotes in titles (HTML) and headers (LaTeX).fiddlosopher2009-12-05
| | | | | | Resolves Issues #137. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1648 788f1e2b-df1e-0410-8736-df70ead52e1b
* Modified html+lhs output to use 'haskell' highlighter.fiddlosopher2009-11-21
| | | | | | | | The bird tracks are added in the highlighting module. This makes sense, because the kate's haskell highlighter is much better than the literateHaskell highlighter. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1620 788f1e2b-df1e-0410-8736-df70ead52e1b
* Specially mark code blocks that were "literate" in the input.fiddlosopher2009-11-03
| | | | | | | | | | | They can then be treated differently in the writers. This allows authors to distinguish bits of the literate program they are writing from source code examples, even if the examples are marked as Haskell for highlighting. Resolves Issue #174. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1618 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 changes in r1086 (implicit section header references).fiddlosopher2007-11-23
| | | | | | | This caused too much of a performance hit. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1093 788f1e2b-df1e-0410-8736-df70ead52e1b
* Implemented implicit reference-style links to section headers in markdown.fiddlosopher2007-11-22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For example, if you have a header '# Supported architectures', you can link to it with '[Supported architectures]'. If there are multiple headers with this label, the link will point to the first of them. Implicit references are always overridden by explicitly specified references. Addresses Issue #20. + Moved isPunctuation, uniqueIdentifiers, and inlineListToIdentifier from Text.Pandoc.Writers.HTML to Text.Pandoc.Shared. + Added stHeaders to ParserState. This holds a list of header texts used in the document, and is used to construct implicit header references. + In Text.Pandoc.Readers.Markdown, added call to headerReference parser in initial parsing pass, constructing a list of section header labels. This is then passed to uniqueIdentifiers to produce identifiers, and a list of implicit references is constructed. This is added to the end of the explicitly specified references, so it will be overridden by explicitly specified references. All of this processing is skipped if --strict was specified. + Modified documentation in README. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1086 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
* '--no-wrap' option now prevents the addition of structural whitespacefiddlosopher2007-10-18
| | | | | | | in HTML output, minimizing the file size. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1053 788f1e2b-df1e-0410-8736-df70ead52e1b
* Markdown writer: Don't print title attribute if title is empty.fiddlosopher2007-09-18
| | | | | | | | | (This differs from the behavior of Markdown.pl, and agrees with PHP Markdown. But John Gruber has indicated that he prefers this behavior.) Adjusted test suite accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1026 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: Don't produce HTML for table of contents iffiddlosopher2007-09-05
| | | | | | | | there are no headers. (This would be an empty list, which is invalid XHTML.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@1011 788f1e2b-df1e-0410-8736-df70ead52e1b
* HTML writer: put anchors around contents of headers, not aroundfiddlosopher2007-09-02
| | | | | | | | the header tags themselves, when producing backlinks to TOC. Resolves Issue #23. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1000 788f1e2b-df1e-0410-8736-df70ead52e1b
* Removed incorrect "{}" around style information infiddlosopher2007-08-23
| | | | | | | | HTML tables. Adjusted test suite accordingly. Column widths now work properly in HTML. git-svn-id: https://pandoc.googlecode.com/svn/trunk@882 788f1e2b-df1e-0410-8736-df70ead52e1b
* If --strict and not --toc, don't include identifiers in headers.fiddlosopher2007-08-20
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@875 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 problems with obfuscateLink introduced by last roundfiddlosopher2007-07-28
| | | | | | | | of changes. Changed type so that text parameter is String, not HTML, which allows easier testing for autolinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@819 788f1e2b-df1e-0410-8736-df70ead52e1b
* Simplified HTML writer's treatment of autolinks.fiddlosopher2007-07-28
| | | | | | | | There are now a few different cases for Link, and less conditional logic needed. git-svn-id: https://pandoc.googlecode.com/svn/trunk@813 788f1e2b-df1e-0410-8736-df70ead52e1b
* Make URLs and emails in autolinks appear as Code.fiddlosopher2007-07-28
| | | | git-svn-id: https://pandoc.googlecode.com/svn/trunk@810 788f1e2b-df1e-0410-8736-df70ead52e1b
* Changed how ASCIIMathML is handled:fiddlosopher2007-07-26
| | | | | | | | | | | | | + -m|--asciimathml option now takes an *optional* argument, the URL to an asciiMathML.js script. This is much better in situations where multiple files with math must be served, as the script can be cached. + If the argument is provided, a link is inserted; otherwise, the whole script is inserted as before. + Nothing is inserted unless there is inline LaTeX. git-svn-id: https://pandoc.googlecode.com/svn/trunk@799 788f1e2b-df1e-0410-8736-df70ead52e1b
* Fixed bug in TOC generation in HTML writer (regression,fiddlosopher2007-07-24
| | | | | | | introduced by the revision in the WriterState type). git-svn-id: https://pandoc.googlecode.com/svn/trunk@793 788f1e2b-df1e-0410-8736-df70ead52e1b