aboutsummaryrefslogtreecommitdiff
path: root/src/Main.hs
AgeCommit message (Collapse)AuthorFilesLines
2007-11-03Reverted back to state as of r1062. The template haskell changesfiddlosopher1-0/+512
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:fiddlosopher1-512/+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-10-15Removed 'version' constant from Main.hs; added 'pandocVersion' to Text.Pandoc.fiddlosopher1-4/+1
This way all programs that use pandoc libraries will have access to the version number. git-svn-id: https://pandoc.googlecode.com/svn/trunk@1052 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-27Added a writer option for wrapped text and a command-line optionfiddlosopher1-1/+10
'--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-18Main (tabFilter):fiddlosopher1-1/+2
Treat '\r' at end of line as newline (in addition to '\r\n' and '\n'). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1027 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-13Changed pandoc home page to http://johnmacfarlane.net/pandoc/.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1014 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-05Bumped version to 0.45.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@1010 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-09-02Bump version numbers to 0.44, which will be the nextfiddlosopher1-1/+1
bug-fix release (when enough bug fixes have accumulated). git-svn-id: https://pandoc.googlecode.com/svn/trunk@1001 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-30Version bump to 0.43.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@962 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-28Main: Replaced tabsToSpacesInLine and tabFilter with single functionfiddlosopher1-12/+13
tabFilter, which operates on the whole string rather than breaking it into lines. git-svn-id: https://pandoc.googlecode.com/svn/trunk@943 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-28+ Removed tabsToSpaces and tabsInLine from Text.Pandoc.Shared.fiddlosopher1-4/+14
(They were used only in Main.) + Wrote new tabsToSpacesInLine function in Main that changes tabs to spaces and removes DOS line-endings in one pass, for a slight speed improvement. git-svn-id: https://pandoc.googlecode.com/svn/trunk@942 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-23Bumped version numbers to 0.42 in anticipation of nextfiddlosopher1-1/+1
bugfix release. git-svn-id: https://pandoc.googlecode.com/svn/trunk@881 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-23Use UTF8 conversion on the extra files loaded in Main.hsfiddlosopher1-4/+4
(header, before, after). This fixes problems with unicode characters in these files. git-svn-id: https://pandoc.googlecode.com/svn/trunk@879 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-08-19Bump version to 0.41.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@867 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-28Main: Changed putStr to putStrLn -- mainly because MacOS doesn't displayfiddlosopher1-1/+1
the whole output unless there's a line ending. git-svn-id: https://pandoc.googlecode.com/svn/trunk@817 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-26Changed how ASCIIMathML is handled:fiddlosopher1-10/+14
+ -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
2007-07-22Main: Relabeled asciiMathMLLink -> asciiMathML, asciiMathML -> math.fiddlosopher1-4/+4
git-svn-id: https://pandoc.googlecode.com/svn/trunk@767 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15Main.hs: If writer is "context", automatically selectfiddlosopher1-1/+2
smart quotes option. web/demos: Removed redundant -S in context writer demo. git-svn-id: https://pandoc.googlecode.com/svn/trunk@723 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15If output file has .ctx or .context extension,fiddlosopher1-0/+2
assume it is ConTeXt format unless otherwise specified. git-svn-id: https://pandoc.googlecode.com/svn/trunk@720 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15Merged branches/context: addition of a ConTeXt writerfiddlosopher1-0/+1
<http://www.pragma-ade.nl/>. + Text.Pandoc.Writers.ConTeXt added. + Text.Pandoc modified to export the basic ConTeXt writer. + Main.hs modified to recognize 'context' as a writer. + ConTeXtHeader added to headers + DefaultHeaders.hs template modified to include ConTeXt header + Tests added (writer.context, tables.context), and runtests.pl modified to run them + pandoc.cabal updated to include Text.Pandoc.Writers.ConTeXt. git-svn-id: https://pandoc.googlecode.com/svn/trunk@716 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-13Changed encodeUTF8 to toUTF8, decodeUTF8 to fromUTF8,fiddlosopher1-7/+5
for clarity. git-svn-id: https://pandoc.googlecode.com/svn/trunk@692 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12Main: use Text.Pandoc to simplify list of imported modules.fiddlosopher1-24/+9
git-svn-id: https://pandoc.googlecode.com/svn/trunk@689 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12If writer == "s5", don't set table of contents option.fiddlosopher1-1/+2
(The TOC would have to be put on a slide, but in most cases it won't fit anyway.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@678 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12Changed order of options, for aesthetic reasons.fiddlosopher1-5/+5
git-svn-id: https://pandoc.googlecode.com/svn/trunk@677 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-10Recognize output filenames with any single-digit extension as manfiddlosopher1-1/+1
format. git-svn-id: https://pandoc.googlecode.com/svn/trunk@668 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07Adjusted copyright notices to 2006-7; usefiddlosopher1-4/+4
real email address instead of lamely attempting to obfuscate. git-svn-id: https://pandoc.googlecode.com/svn/trunk@640 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-07+ Introduced writerIgnoreNotes option in WriterOptions. This is neededfiddlosopher1-0/+1
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
2007-07-07Added writerTableOfContents to WriterOptions, and added afiddlosopher1-0/+10
--table-of-contents/--toc command-line option to Main.hs. git-svn-id: https://pandoc.googlecode.com/svn/trunk@632 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-06-30Modified Main.hs and Pandoc.cabal to add man pagefiddlosopher1-0/+3
writer. git-svn-id: https://pandoc.googlecode.com/svn/trunk@607 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-22Resolved issue #10: instead of adding "\n\n" to thefiddlosopher1-1/+1
end of strings in Main, do it in readMarkdown and readRST. (Note: the point of this is to ensure that a block at the end of the file gets treated as if it has blank space after it, which is generally what is wanted.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@588 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-10Extensive changes stemming from a rethinking of the Pandoc datafiddlosopher1-11/+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
2007-03-03Added --inline-links option to force links in HTML to be parsedfiddlosopher1-6/+15
as inline links, rather than reference links. (Addresses Issue #4.) git-svn-id: https://pandoc.googlecode.com/svn/trunk@554 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-26Modified HTML writer to use the Text.XHtml library. This resultsfiddlosopher1-7/+8
in cleaner, faster code, and it makes it easier to use Pandoc in other projects, like wikis, that use Text.XHtml. Two functions are now provided, writeHtml and writeHtmlString: the former outputs an Html structure, the latter a rendered string. The S5 writer is also changed, in parallel ways (writeS5, writeS5String). The Html header is now written programmatically, so it has been removed from the 'headers' directory. The S5 header is still needed, but the doctype and some of the meta declarations have been removed, since they are written programatically. The INSTALL file and cabalize have been updated to reflect the new dependency on the xhtml package. git-svn-id: https://pandoc.googlecode.com/svn/trunk@549 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-31Use "gaps" in copyrightMessage string for cleaner code formatting.fiddlosopher1-1/+4
git-svn-id: https://pandoc.googlecode.com/svn/trunk@521 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-15Added support for tables in markdown reader and in LaTeX,fiddlosopher1-2/+8
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
2007-01-09Moved up processing of --dump-args so that output file won'tfiddlosopher1-7/+7
be created first! git-svn-id: https://pandoc.googlecode.com/svn/trunk@465 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-08Have pandoc return exit code 2 whenever a usage message isfiddlosopher1-3/+3
produced, even if it's because a bad option was specified. git-svn-id: https://pandoc.googlecode.com/svn/trunk@455 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-08Changes to Pandoc's options to facilitate wrapper scripts:fiddlosopher1-19/+30
+ removed -d/--debug option + added --dump-args option, which prints the name of the output file (or '-' for STDOUT) and all the command-line arguments (excluding Pandoc options and their arguments), one per line, then exits. Note that special wrapper options will be treated as arguments if they follow '--' at the end of the command line. Thus, pandoc --dump-args -o foo.html foo.txt -- -e latin1 will print the following to STDOUT: foo.html foo.txt -e latin1 + added --ignore-args option, which causes Pandoc to ignore all (non-option) arguments, including any special options that occur after '--' at the end of the command line. + '-' now means STDIN as the name of an input file, STDOUT as the name of an output file. So, pandoc -o - - will take input from STDIN and print output to STDOUT. Note that if multiple '-o' options are specified on the same line, the last one takes precedence. So, in a script, pandoc "$@" -o - will guarantee output to STDOUT, even if the '-o' option was used. + documented these changes in man pages, README, and changelog. git-svn-id: https://pandoc.googlecode.com/svn/trunk@454 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06Allow '-S' option to be specified together with '--strict', if desired.fiddlosopher1-2/+1
Thus 'pandoc -S --strict -r markdown -w html' can replace the Markdown.pl/Smartypants combination. git-svn-id: https://pandoc.googlecode.com/svn/trunk@438 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-06Merged changes from 'quotes' branch since r431. Smart typographyfiddlosopher1-3/+3
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
2007-01-02Modified main 'pandoc' program so that if it is called with programfiddlosopher1-7/+18
name = 'hsmarkdown' (e.g. through a symlink, on a system with real symbolic links), it will translate markdown to HTML in strict mode and interpret all command-line options as arguments, like Markdown.pl. git-svn-id: https://pandoc.googlecode.com/svn/trunk@405 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-02Change 'HtmlEntities' module to 'Entities'. Adjusted callingfiddlosopher1-0/+1
code accordingly. git-svn-id: https://pandoc.googlecode.com/svn/trunk@395 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-01-01Merged changes from docbook branch since r363.fiddlosopher1-1/+7
git-svn-id: https://pandoc.googlecode.com/svn/trunk@386 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-31Changed usage message so that it is more compact (and slightlyfiddlosopher1-34/+32
less informative). It's important that it be able to fit on one screen. git-svn-id: https://pandoc.googlecode.com/svn/trunk@351 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-30Merged 'strict' branch from r324. This adds a '--strict'fiddlosopher1-13/+25
option to pandoc, which forces it to stay as close as possible to official Markdown syntax. git-svn-id: https://pandoc.googlecode.com/svn/trunk@347 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-28+ Removed the convenience symlinks (which don't work on Windows underfiddlosopher1-75/+82
Cygwin, due to Windows' lack of true symbolic links). + Modified the wrappers to use 'pandoc' instead of the symlinks. + Modified the Makefile to remove all references to the symlinks. + Removed code from Main.hs that made pandoc's behavior depend on the name of the calling program. + Added code to Main.hs that sets default reader and writer based on extensions of input and output filenames (if provided). (Thanks to roktas for the idea.) + Modified README and man pages accordingly. + Removed WINDOWS-README target from Makefile. It is no longer needed now that we don't have the symlinks. git-svn-id: https://pandoc.googlecode.com/svn/trunk@295 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-22Merged changes from branches/wrappers since r177.fiddlosopher1-26/+116
Summary of main changes: + Added -o/--output and -d/--debug options to pandoc. + Modified pandoc to behave differently depending on the name of the program. For example, if the program name is 'html2latex', the default reader will be html and the default writer latex. + Removed most of the old wrappers, replacing them with symlinks to pandoc. + Rewrote markdown2pdf and created a new wrapper web2markdown, with the functionality of the old html2markdown script. These new scripts exploit pandoc's -d option to avoid having to do complex command-line parsing. + Revised man pages and documentation appropriately. git-svn-id: https://pandoc.googlecode.com/svn/trunk@279 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20Added license text to top of source files.fiddlosopher1-0/+18
git-svn-id: https://pandoc.googlecode.com/svn/trunk@258 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20Changed 'stability' from 'provisional' to 'alpha'.fiddlosopher1-1/+1
git-svn-id: https://pandoc.googlecode.com/svn/trunk@257 788f1e2b-df1e-0410-8736-df70ead52e1b
2006-12-20Changed 'status' in comment headers from 'unstable' to 'provisional'fiddlosopher1-1/+1
(which seems to be the term that is used in this context). git-svn-id: https://pandoc.googlecode.com/svn/trunk@255 788f1e2b-df1e-0410-8736-df70ead52e1b