aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers
AgeCommit message (Collapse)AuthorFilesLines
2009-06-06Man writer: break lines at end of each sentence.fiddlosopher1-3/+36
groff expects this and treats . and ? differently when followed by line ending as opposed to ordinary space. Also, don't escape periods. Instead, use zero-width character \& to avoid unwanted interpretation of periods at start of line. Resolves Issue #148. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1580 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-04-25HTML writer: wrap sections in divs. Resolves Issue #70.fiddlosopher4-107/+43
+ 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
2009-02-07Fixed bug with header spacing in Markdown and RST writers.fiddlosopher2-5/+11
A null header (Meta [] [] []) should not cause a blank line at the beginning of output. But a blank line is needed between a non-null header and the main text. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1536 788f1e2b-df1e-0410-8736-df70ead52e1b
2009-01-24Moved all haskell source to src subdirectory.fiddlosopher12-0/+4381
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1528 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-29Moved everything from src into the top-level directory.fiddlosopher8-2649/+0
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1104 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-23Reverted changes in r1086 (implicit section header references).fiddlosopher1-0/+46
This caused too much of a performance hit. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1093 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-22+ Changed \useurl to \useURL in ConTeXt output.fiddlosopher1-1/+1
+ Changed links from red to blue in ConTeXt output. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1087 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-22Implemented implicit reference-style links to section headers in markdown.fiddlosopher1-46/+0
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
2007-11-18More improvements to ConTeXt writer:fiddlosopher1-79/+100
+ writer options are now in state, so they don't have to be passed as a parameter + state also keeps track of ordered list level, so the right default numbering scheme can be used + extra blank line after \stopitemize + removed definitions of ltxenum and ltxitem from the preamble + both kinds of lists are now generated using \start-stopitemize, with appropriate options + in the case of bulleted lists, no options need be specified, because defaults are given in the preamble + test suite updated accordingly git-svn-id: https://pandoc.googlecode.com/svn/trunk@1084 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-17ConTeXt writer:fiddlosopher1-2/+4
+ Don't use \(sub)+subject if header level > 5. + Modified tests to conform to new treatment of level 4 and 5 headers. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1083 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-17Modified ConTeXt writer to use \subsubsubsubsection etc.,fiddlosopher1-4/+2
since these are supported (up to at least sub x 5). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1082 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-17Adjusted formatting of LaTeX and ConTeXt footnotes:fiddlosopher2-6/+6
- in ConTeXt, % is not needed at end of line before note, since space is gobbled. - beginning of footnote indented four spaces. - this required an additional parameter in wrappedTeX and wrapTeXIfNeeded, in Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1080 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-16ConTeXt writer: Use itemize options, not sym{}, to produce orderedfiddlosopher1-14/+28
lists with custom numbering styles. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1079 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-16New, "official" definition of blockquote environment in ConTeXt header.fiddlosopher1-1/+1
Also, use blank line after \startblockquote to balance blank line at the end. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1078 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-15Changes to ConTeXt writer:fiddlosopher1-121/+135
+ PrettyPrint module now used for output. + Text wrapping now provided, using wrapTeXIfNeeded. + Better treatment of footnotes: footnotes are always on lines by themselves. + Use \subject, \subsubject, ... or \section, \subsection, ... for headings, depending on whether --number-sections option is selected. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1072 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-15Improved footnote handling in LaTeX writer:fiddlosopher1-8/+16
+ use wrapTeXIfNeeded instead of wrapIfNeeded + make sure footnotes occur on lines by themselves, with a % at the end of the preceding line to prevent unwanted spaces + added writer options to state, so it can be accessed by wrapTeXIfNeeded git-svn-id: https://pandoc.googlecode.com/svn/trunk@1071 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-03Reverted back to state as of r1062. The template haskell changesfiddlosopher8-0/+2592
are more trouble than they're worth. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1064 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-11-03Use template haskell to avoid the need for templates:fiddlosopher8-2592/+0
+ 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
2007-11-01Cleaned up LaTeX footnotes:fiddlosopher1-5/+6
+ Footnotes start on a separate line. A comment % is used at the end of the previous line to prevent unwanted spaces. This makes footnotes easier to see, delete, and move around. + The final } now only appears on a separate line if it needs to (i.e. if the note ends with a Verbatim environment). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1061 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-18'--no-wrap' option now prevents the addition of structural whitespacefiddlosopher1-3/+9
in HTML output, minimizing the file size. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1053 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-12Undid last change: instead of blocking the internal links in thefiddlosopher1-1/+0
writers, it makes more sense to block them in the HTML reader. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1048 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-10-11Man writer: Don't print link source for internal links (#...).fiddlosopher1-0/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1047 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-27Fixed bug in markdown writer: If an ordered list item began withfiddlosopher1-1/+5
a marker greater than 3 characters in width, and the item took more than one line, it would appear on the line after the list marker, e.g.: (12) My list item. Multiline. Now it works as follows: (12) My list item. Multiline. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1036 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-27Added a writer option for wrapped text and a command-line optionfiddlosopher4-7/+9
'--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
2007-09-25Fixed a bug in the Markdown writer: incorrect line wrapping in fiddlosopher1-2/+11
paragraphs including hard line breaks. Resolves Issue #25. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1032 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-19RST writer: If label for a link reference contains a colon,fiddlosopher1-1/+4
surround by ` signs so the colon won't be interpreted as the end of the link label. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1029 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-18Markdown writer: Don't print title attribute if title is empty.fiddlosopher1-1/+4
(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
2007-09-10+ Fixed bug in RST writer's handling of ordered lists. Previously,fiddlosopher1-2/+2
list items with multiple lines would not always line up with single-line list items. Now, list items are nested the length of the list marker + 1. This looks better and ensures that list items all line up. (Note that list markers are padded to the length of the longest list marker in the series.) + Use 3-space indent for unordered lists. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1013 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-05HTML writer: Don't produce HTML for table of contents iffiddlosopher1-0/+1
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
2007-09-02HTML writer: put anchors around contents of headers, not aroundfiddlosopher1-11/+11
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
2007-09-02Markdown writer: escape paragraphs that begin with ordered listfiddlosopher1-1/+23
markers, so they don't get interpreted as ordered lists. git-svn-id: https://pandoc.googlecode.com/svn/trunk@988 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30Replaced individual wrapping routines in RST, Man, andfiddlosopher3-23/+6
Markdown writers with 'wrapped' from Text.Pandoc.Shared. git-svn-id: https://pandoc.googlecode.com/svn/trunk@967 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30Rewrote LaTeX writer to use the prettyprinting library,fiddlosopher1-104/+130
so we get word wrapping, etc. git-svn-id: https://pandoc.googlecode.com/svn/trunk@964 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-29Fixed bug in LaTeX writer: autolinks would not cause fiddlosopher1-5/+5
'\usepackage{url}' to be put in the document header. Also, changes to state in enumerated list items would be overwritten. git-svn-id: https://pandoc.googlecode.com/svn/trunk@947 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-25Fixed bug in LaTeX writer. When a footnote ends with a Verbatimfiddlosopher1-1/+3
environment, the close } of the footnote needs to occur on the same line or an error occurs. Fixed by adding a newline before the close } in every footnote. git-svn-id: https://pandoc.googlecode.com/svn/trunk@897 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-23Removed incorrect "{}" around style information infiddlosopher1-2/+2
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
2007-08-20If --strict and not --toc, don't include identifiers in headers.fiddlosopher1-1/+3
git-svn-id: https://pandoc.googlecode.com/svn/trunk@875 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-17Fixed block quote output in markdown writer: previously,fiddlosopher1-4/+4
block quotes in notes would be indented only in the first line. git-svn-id: https://pandoc.googlecode.com/svn/trunk@859 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-15Major code cleanup in all modules. (Removed unneeded imports,fiddlosopher8-497/+486
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
2007-08-08Major change in the way ordered lists are handled:fiddlosopher8-97/+179
+ 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
2007-08-03Use \url{} for autolinks in LaTeX writer.fiddlosopher1-2/+5
git-svn-id: https://pandoc.googlecode.com/svn/trunk@832 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28LaTeX writer:fiddlosopher1-12/+14
+ No longer using examplep (too many quirks, too hard to install) + Instead, using deVerb function for environments that don't support \verb + And fancyvrb for footnotes and verbatim environments in footnotes. + Add fancyvrb to header if Code inline occurs in a footnote. git-svn-id: https://pandoc.googlecode.com/svn/trunk@825 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Cleaned up and fixed autolinks in RST. All that's neededfiddlosopher1-12/+12
is a bare email address or URL. This is now handled with a separate matching clause in the definition of inlineToRST, rather than with conditionals. git-svn-id: https://pandoc.googlecode.com/svn/trunk@821 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Don't put autolinks in typewriter font in ConTeXt, sincefiddlosopher1-0/+2
ConTeXt has its own way of printing links. git-svn-id: https://pandoc.googlecode.com/svn/trunk@820 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Fixed problems with obfuscateLink introduced by last roundfiddlosopher1-14/+11
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
2007-07-28Man page writer: modified treatment of autolinks,fiddlosopher1-1/+1
in accord with recent change from Str to Code. git-svn-id: https://pandoc.googlecode.com/svn/trunk@816 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28LaTeX writer: include fancyvrb and \VerbatimFootnotesfiddlosopher1-4/+4
line in header only if absolutely needed -- that is, only if there is actually a code block in a footnote. git-svn-id: https://pandoc.googlecode.com/svn/trunk@815 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Simplified HTML writer's treatment of autolinks.fiddlosopher1-8/+8
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
2007-07-28Make URLs and emails in autolinks appear as Code.fiddlosopher3-9/+9
git-svn-id: https://pandoc.googlecode.com/svn/trunk@810 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Fixed a bug in Docbook writer: email links with text were beingfiddlosopher1-1/+6
incorrectly treated as autolinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@809 788f1e2b-df1e-0410-8736-df70ead52e1b