Commit graph

4804 commits

Author SHA1 Message Date
fiddlosopher
4beb0b9130 Superscript and Subscript support for RST reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@777 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 21:26:22 +00:00
fiddlosopher
c1f397622d Added a "try" to the end parser in enclosed (Text.Pandoc.ParserCombinators).
This makes errors in its use less likely. Removed some now-unneeded try's
in calling code.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@776 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 21:01:17 +00:00
fiddlosopher
3ca9932ca6 Added subscript and superscript support to LaTeX reader.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@775 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 20:30:07 +00:00
fiddlosopher
bb5ac55f67 Man writer: Use ~ and ^ for subscripts and superscripts.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@770 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 20:13:43 +00:00
fiddlosopher
7006d9a044 HTML writer: Use a record for state, instead of a tuple, for
easy extensibility.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@769 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 20:00:49 +00:00
fiddlosopher
b4d289c65e HTML writer: include css for .strikethrough only if strikethrough
is actually used in the document.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@768 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 19:32:39 +00:00
fiddlosopher
9ddd464a7e Added ~ to the list of characters the markdown
writer should backslash-escape.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@765 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 18:33:41 +00:00
fiddlosopher
4905ebadb3 LaTeX reader: Added clauses for tilde and caret.
Tilde is \ensuremath{\sim}, and caret is \^{},
not \^ as before.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@764 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 18:26:10 +00:00
fiddlosopher
b8e1e53053 Cleaned up character escaping in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@763 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 18:24:34 +00:00
fiddlosopher
b19c36970e Removed an extra occurance of escapedChar in definition
of inline.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@762 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 17:51:15 +00:00
fiddlosopher
9f38f9d039 Man writer:
+ Make sure to include "" if no section is specified
  in a man page TH line.
+ Updated man writer tests.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@758 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 16:17:20 +00:00
fiddlosopher
062cdfe7de Changed text to char for one character strings
in RST, Man, and Docbook writers.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@757 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 16:10:48 +00:00
fiddlosopher
2b3c2d43ef Markdown writer: Substituted char for text for single characters.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@756 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 16:08:19 +00:00
fiddlosopher
6bb6dd2bfd + Added support for superscript, subscript, and
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
2007-07-22 16:05:38 +00:00
fiddlosopher
d03ec5a4a2 Added support for strikeout (\sout) to latex
reader.  (Thanks to Bradley Sif for the patch.)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@754 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-22 05:14:43 +00:00
fiddlosopher
a2194f23db Added support for Strikeout, Superscript, and Subscript to
HTML reader.  Thanks to Bradley Sif for the patch for
Strikeout (Issue #18).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@753 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 22:54:40 +00:00
fiddlosopher
44b11214ba + Added support for Strikeout, Superscript, and
Subscript in markdown reader.
+ Also replaced constants like emphStart with literals. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@752 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 22:52:07 +00:00
fiddlosopher
dc60aa3aea + Added Strikeout support to Markdown writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@751 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 22:07:10 +00:00
fiddlosopher
9b664073d5 Moved failIfStrict from Markdown reader to
Text.Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@750 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 21:55:19 +00:00
fiddlosopher
f0fb4c496b Changes to functions for character escaping:
+ Removed escapeCharAsString
+ Added escapeStringUsing
+ Changed backslashEscape to backslashEscapes, which
  now returns an association list of escapes to be
  passed to escapeStringUsing


git-svn-id: https://pandoc.googlecode.com/svn/trunk@748 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 21:34:13 +00:00
fiddlosopher
2f7a38e1ab Changed system for indicating man page title, section,
header and footer.  Documented in README.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@745 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 20:30:40 +00:00
fiddlosopher
ec0445de0a Added Strikeout, Superscript, and Subscript to
refsMatch function in Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@742 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 19:09:04 +00:00
fiddlosopher
a009a4b387 Added Strikeout, Superscript, and Subscript as
Inline elements (Pandoc.Definition).


git-svn-id: https://pandoc.googlecode.com/svn/trunk@741 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-21 19:07:15 +00:00
fiddlosopher
e02fb21452 Refactored character escaping in Text.Pandoc.Writers.Markdown using
escapeCharAsString.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@739 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-19 08:09:17 +00:00
fiddlosopher
7d2c9c6fe6 Added escapeCharAsString to Text.Pandoc.Shared.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@738 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-19 08:08:51 +00:00
fiddlosopher
48d67d0d1f Simplified inlinesInBalanced, using lookAhead.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@732 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-16 07:22:17 +00:00
fiddlosopher
7e1370aa87 Markdown reader: Added inlinesInBalanced parser combinator to
unify treatment of embedded brackets in links and inline footnotes.
Note that the solution adopted here causes one of John Gruber's
markdown tests to fail:
  [with_underscore](/url/with_underscore)
Here the whole phrase "underscore](/url/with" is treated as
emphasized. The previous version of the markdown reader handled
this the way Gruber's script handles it, but it ran into trouble
on the following:
  [link with verbatim `]`](/url)
where the inner ] was treated as the end of the reference link
label. I don't see any good way to handle both cases in the framework
of pandoc, so I choose to require an escape in the first example:
  [with\_underscore](/url/with_underscore)


git-svn-id: https://pandoc.googlecode.com/svn/trunk@729 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15 23:53:22 +00:00
fiddlosopher
8e71c4c388 Added charsInBalanced parser combinator to Text.Pandoc.ParserCombinators.
This is not currently used, but should be useful in parsing strings
containing balanced pairs of brackets or parentheses.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@728 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15 23:48:17 +00:00
fiddlosopher
2f928d4c9d ConTeXt writer changes:
+ Use defined blockquote environment for block quotes (smaller
  font, no indent, narrower text)
+ Changed default font to 12pt
+ Changed default page layout


git-svn-id: https://pandoc.googlecode.com/svn/trunk@725 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15 15:08:27 +00:00
fiddlosopher
465b2d791e Merged branches/context: addition of a ConTeXt writer
<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-15 02:56:34 +00:00
fiddlosopher
78aeebc143 Removed an unused function in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@714 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-15 02:48:21 +00:00
fiddlosopher
8ce4b2fb62 Simplified special character escaping code in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@705 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-14 17:59:06 +00:00
fiddlosopher
ab74f97422 Small comment fix in LaTeX writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@704 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-14 17:28:26 +00:00
fiddlosopher
a786f43e8c Change to footnotes in HTML writer: Instead of putting the footnote
backlink on a line by itself, after the content of the note,
we now put it at the end of the last paragraph of the footnote.
This saves space and looks better.  More specifically:
+ If the last block of the note is a Para or Plain block, the
  backlink is put at the end of that block's contents.
+ Otherwise, the backlink is put in a separate Plain block by
  itself, after the footnote's contents. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@697 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-14 03:37:41 +00:00
fiddlosopher
30375bb847 Changed encodeUTF8 to toUTF8, decodeUTF8 to fromUTF8,
for clarity.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@692 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-13 06:34:33 +00:00
fiddlosopher
e962c76f05 HTML reader: haddock comment fix.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@690 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12 08:31:39 +00:00
fiddlosopher
a9bd39b10e Export NoteTable in Text.Pandoc.Shared.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@688 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12 08:30:17 +00:00
fiddlosopher
4f78aa9eca Change to defaultWriterOptions: standalone is False by default.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@685 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-12 07:06:25 +00:00
fiddlosopher
1780228b7c Markdown reader: Parse bracketed text in inline footnotes. Previously,
"test^[my [note] contains brackets]" would yield a note with contents
"my [note". Now it yields a note with contents "my [note] contains
brackets".  New function: inlinesInBrackets.

Resolves Issue 14. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@665 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 06:51:06 +00:00
fiddlosopher
d58dca502e RST reader: Allow hyperlink target URIs to be split over multiple
lines, and to start on the line after the reference.
Resolves Issue 7. 


git-svn-id: https://pandoc.googlecode.com/svn/trunk@664 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 06:23:59 +00:00
fiddlosopher
655363da51 Moved Text.ParserCombinators.Pandoc ->
Text.Pandoc.ParserCombinators.  This way, all the
Pandoc modules are in one place.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@663 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 03:39:25 +00:00
fiddlosopher
622d4e5223 Added type declaration for hsepBlocks in
Text.Pandoc.Blocks.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@662 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 03:38:03 +00:00
fiddlosopher
69072efc00 Text.Pandoc.Blocks:
+ Fixed a bug in hPad, which previously padded the rightmost
  cell.  This is fixed by introducing a case for a singleton
  list.
+ Fixed Markdown writer so that the space after a table is not
  nested two spaces.
+ Adjusted Markdown table tests accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@660 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 01:36:53 +00:00
fiddlosopher
0ceb538ecd Markdown writer:
Fixed a small problem with lengths of dashed lines in tables.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@659 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 01:24:49 +00:00
fiddlosopher
ad7bb70cce Added --toc support to Markdown writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@658 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 01:14:35 +00:00
fiddlosopher
56efd6176f Added support for --toc to RTF writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@657 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 00:51:07 +00:00
fiddlosopher
489a2bb1d9 Moved isHeaderBlock from Text.Pandoc.Writers.HTML
to Text.Pandoc.Shared.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@656 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-09 00:50:14 +00:00
fiddlosopher
2d4a22d0be Regularized the scheme for unique header identifiers in HTML writer:
- punctuation is now all removed (except -)
 - spaces are turned into -
 - all lowercase
This scheme should be fairly predictable.
Updated tests accordingly.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@655 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-08 17:33:03 +00:00
fiddlosopher
7f5638853b HTML writer changes:
+ change in scheme for construction of unique identifiers for headers:
  - all lowercase
  - spaces turn into -, not _
+ TOC items now have their own identifiers, starting with TOC-
+ when there is a TOC, headers link back to the corresponding TOC items,
  rather than the top of the TOC.


git-svn-id: https://pandoc.googlecode.com/svn/trunk@653 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-08 17:09:17 +00:00
fiddlosopher
c3fb1dd4ea Added --toc support to RST writer.
git-svn-id: https://pandoc.googlecode.com/svn/trunk@652 788f1e2b-df1e-0410-8736-df70ead52e1b
2007-07-08 16:48:54 +00:00