Commit graph

493 commits

Author SHA1 Message Date
fiddlosopher
ffd7248af8 Fixed export declarations; removed unneeded import of
Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@585 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-15 16:22:29 +00:00
fiddlosopher
e15fd3bf86 Moved escape and nullBlock parsers from ParserCombinators/Pandoc
to Pandoc/Shared.  Reason:  ParserCombinators/Pandoc is for
general-purpose parsers that don't require Pandoc.Definition.
Also removed some unnecessary imports from Pandoc/Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@584 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-15 16:20:07 +00:00
fiddlosopher
24ee5f1f49 Updated test suite to reflect new prettyprinted native
Table format.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@583 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-13 22:18:47 +00:00
fiddlosopher
944740ce5c Added Table to prettyBlock in Shared.hs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@582 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-13 01:33:10 +00:00
fiddlosopher
92845a9834 Added Text.Pandoc module that exports basic readers, writers,
definitions, and utility functions.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@581 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-11 22:57:45 +00:00
fiddlosopher
23df0ed176 Extensive changes stemming from a rethinking of the Pandoc data
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-04-10 01:56:50 +00:00
fiddlosopher
74e7497226 Fixed bug in email obfuscation (issue #15). If the text to be obfuscated
contains an entity, this needs to be decoded before obfuscation.
Thanks to thsutton for the patch.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@579 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-04-08 21:04:47 +00:00
fiddlosopher
571c3b4173 Removed Blank block element as unnecessary.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@578 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-17 20:23:47 +00:00
fiddlosopher
9b3d5d88c2 Consolidated 'text', 'special', and 'inline' into 'inline'.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@577 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-17 17:25:28 +00:00
fiddlosopher
cdf7c78b5f Added trys to two list start routines. Reason:
<|> only parses second parser when first hasn't consumed
input.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@576 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-16 06:05:43 +00:00
fiddlosopher
0d2e5eab79 Added clauses for DefinitionList and Table to replaceReferenceLinks in
Text/Pandoc/Shared.hs. This ensures that reference-style links inside
tables and definition lists will be handled properly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@575 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-12 00:36:41 +00:00
fiddlosopher
d55346ca9a Simplified keyTable, using assumption that key blocks are not
inside other block elements (an assumption that the Markdown
reader uses in making its initial pass anyway).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@574 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-12 00:23:39 +00:00
fiddlosopher
7bf7aba7e7 Changes to Markdown reader relating to definition lists:
+ fixed bug in indentSpaces (which didn't properly handle
  cases with mixed spaces and tabs)
+ rewrote definition list code to conform to new syntax
+ include definition lists in list block
+ failIfStrict on definition lists


git-svn-id: https://pandoc.googlecode.com/svn/trunk@572 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 07:56:29 +00:00
fiddlosopher
aca046702e Added support for DefinitionList blocks to HTML writer.
Cleaned up bullet and ordered list code by using
ordList and unordList instead of raw olist and ulist.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@571 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 07:54:47 +00:00
fiddlosopher
44cec96e61 New syntax documentation for definition lists. Now we
require a ':' at the beginning of the definition; otherwise,
too many false positives for definition lists. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@570 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 07:53:21 +00:00
fiddlosopher
2e794fdf37 Fixed bug in HTML email obfuscation using --strict mode.
The problem is that the "href" function escapes &, so
(href "&#108;") is 'href="&amp;#108;"'.  Fixed by using
primHtml for the whole link.  Resolves issue 9.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@569 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-11 00:19:15 +00:00
fiddlosopher
115cad8882 Changed syntax of definition lists in Markdown parser:
+ definition blocks must be indented throughout (not
    just in first line)
  + compact lists can be formed by leaving no blank line
    between a definition and the next term


git-svn-id: https://pandoc.googlecode.com/svn/trunk@568 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 20:45:19 +00:00
fiddlosopher
d277baebe4 Added documentation for definition lists.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@567 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 20:43:59 +00:00
fiddlosopher
5ec31cc727 Added parser for definition lists, derived from reStructuredText
syntax:

term 1
    Definition 1

    Paragraph 2 of definition 1.

term 2
    There must be whitespace between entries.
    Any kind of block may serve as a definition,
    but the first line of each block must be indented.

terms can contain any *inline* elements
    If you want to be lazy, you can just
indent the first line of the definition block.



git-svn-id: https://pandoc.googlecode.com/svn/trunk@566 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:48:16 +00:00
fiddlosopher
0ce965f34c Modified prettyPandoc to handle DefinitionList elements.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@565 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:45:00 +00:00
fiddlosopher
68cd976838 Added definition for DefinitionList block element.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@564 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-10 17:44:27 +00:00
fiddlosopher
d5f9b1dbb4 Change in ordered lists in Markdown reader:
+ Lists may begin with lowercase letters only, and only 'a' through
    'n'. Otherwise first initials and page references (e.g., p. 400)
    are too easily parsed as lists.
  + Numbers beginning list items must end with '.' (not ')', which is
    now allowed only after letters).
NOTE:  This change may cause documents to be parsed differently.
Users should take care in upgrading.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@561 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-09 02:37:49 +00:00
fiddlosopher
f1191f029a More smart quote adjustments:
+ remove support for all-caps contractions (too
  much potential for conflict with things like
  'M. Mitterand')
+ add support for 'm as a contraction


git-svn-id: https://pandoc.googlecode.com/svn/trunk@560 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-07 20:53:37 +00:00
fiddlosopher
42ade05ebe Smart quote parsing in Markdown reader:
treat ' followed by ll, re, ve, then a
non-letter, as a contraction.  (e.g.
I've, you're, he'll)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@559 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-07 03:01:43 +00:00
fiddlosopher
402016df28 Fixed bug in noscript part of email obfuscation:
& instead of &amp;


git-svn-id: https://pandoc.googlecode.com/svn/trunk@557 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-04 07:40:22 +00:00
fiddlosopher
21ba6b08f2 Made image parsing in HTML reader sensitive to the
--inline-links option.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@556 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-03-03 18:25:49 +00:00
fiddlosopher
31c030e3a5 Added --inline-links option to force links in HTML to be parsed
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-03-03 18:19:31 +00:00
fiddlosopher
f99cedd236 Strip executable binaries before installing.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@551 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-27 07:16:20 +00:00
fiddlosopher
463a0e5c3e Changes to test suite for new XHTML output.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@550 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-27 07:05:11 +00:00
fiddlosopher
59065c103f Modified HTML writer to use the Text.XHtml library. This results
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-02-26 19:08:10 +00:00
fiddlosopher
e0303dfc79 'cp -a' does not work in BSD. Replace with 'cp -R'.
Note that we don't want user and group to be preserved,
anyway.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@547 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-23 17:31:46 +00:00
fiddlosopher
e9d66b8ed8 Modified changelog: note on defaultWriterOptions.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@546 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-21 01:23:11 +00:00
fiddlosopher
3456355174 Added defaultWriterOptions to Shared.hs.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@545 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-21 01:22:08 +00:00
fiddlosopher
90390b65f4 Modified changelog to incorporate changes since the 0.3 release.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@544 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-20 01:21:42 +00:00
fiddlosopher
06ff1feea0 Use 'highlight' to produce syntax-highlighted versions of
xml, html, and tex demo pages (in website /examples/).
Add links so that html files can be viewed as web pages
(without syntax highlighting).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@543 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-19 04:47:12 +00:00
fiddlosopher
8138fc48ae Change extensions of example text files in website demo to
'.text' -- the only reason for this is that I use '.txt' for
page source files, and generally exclude them from being uploaded
to the website.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@542 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-19 02:03:40 +00:00
fiddlosopher
7d3382e9f0 In writing Markdown, print unicode nonbreaking space
(160) as "&nbsp;", since otherwise it is hard to distinguish
from a regular space.  (Addresses Issue #3.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@541 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-17 04:57:41 +00:00
fiddlosopher
7a04caeea8 Escape non-breaking space in SGML as '&nbsp;' instead of
printing a unicode non-breaking space, which is
hard to distinguish visually from a regular space.
(Resolves issue #3.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@540 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-17 03:40:28 +00:00
fiddlosopher
1855af4be5 Refactored str and strong in Markdown reader, for clarity.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@539 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 02:27:36 +00:00
fiddlosopher
87eb8be143 Got rid of two unneeded 'getState's. Note that
lookAhead automatically saves and restores the state.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@538 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:43:12 +00:00
fiddlosopher
9ad7c73b57 Use lookAhead instead of getInput/setInput in RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@537 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:33:35 +00:00
fiddlosopher
d3efa4aa8a Use lookAhead parser for the "first pass" looking for
reference keys in Markdown parser, instead of parsing
normally, then using setInput to reset input.  Slight
performance improvement. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@536 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:22:02 +00:00
fiddlosopher
ae19b94fd1 Removed followedBy' parser from Text/ParserCombinators/Pandoc,
replacing it with the 'lookAhead' parser from
Text/ParserCombinators/Parsec.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@535 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-15 01:10:15 +00:00
fiddlosopher
0114f68d21 Introduced a new map, reverseEntityTable, for lookups
of entity by character, in Entities.hs. This yields a 
small performance improvement.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@534 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 18:02:51 +00:00
fiddlosopher
1266b189a1 Changed Entities.hs to use Data.Map rather than
an association list, for a slight performance boost.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@532 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 17:39:06 +00:00
fiddlosopher
5a9b7c229d Added freebsd directory, with freebsd port, to repository.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@531 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 17:09:17 +00:00
fiddlosopher
7f65a4e914 Fixed issue #8: slow performance in parsing inline literals in
RST reader.  The problem was that ``#`` was seen by
'inline' as a potential link or image.  Fix:  insert
'notFollowedBy (char '`')' in link parsers.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@529 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-14 06:57:23 +00:00
fiddlosopher
6e467c26c4 Replaced "choice [(try (string ...), ...]" idiom with
"oneOfStrings" in LaTeX reader.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@528 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 17:18:20 +00:00
fiddlosopher
f3437dd27c + Added some needed "try"s before multicharacter parsers,
especially in "option" contexts.
+ Removed the "try" from the "end" parser in "enclosed"
  (Text.Pandoc.Shared).  Now "enclosed" behaves like
  "option", "manyTill", etc.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@527 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 17:14:11 +00:00
fiddlosopher
73cbae7202 Added 'try' in front of 'string', where needed, or
used a different parser, in RST reader. This fixes
a bug where ````` would not be correctly parsed as
a verbatim `.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@526 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-02-12 03:53:14 +00:00