Commit graph

2198 commits

Author SHA1 Message Date
John MacFarlane
6aa5010617 Pretty: Added braces and brackets. 2010-12-19 10:13:11 -08:00
John MacFarlane
89bf312765 LaTeX writer: Use \paragraph, \subparagraph for level 4,5 headers. 2010-12-18 15:05:21 -08:00
John MacFarlane
543aa28c38 Added new prettyprinting module.
* Added Text.Pandoc.Pretty.
  This is better suited for pandoc than the 'pretty' package.
  One advantage is that we now get proper wrapping; Emph [Inline]
  is no longer treated as a big unwrappable unit. Previously
  we only got breaks for spaces at the "outer level." We can also
  more easily avoid doubled blank lines.  Performance is
  significantly better as well.

* Removed Text.Pandoc.Blocks.
  Text.Pandoc.Pretty allows you to define blocks and concatenate
  them.

* Modified markdown, RST, org readers to use Text.Pandoc.Pretty
  instead of Text.PrettyPrint.HughesPJ.

* Text.Pandoc.Shared:  Added writerColumns to WriterOptions.

* Markdown, RST, Org writers now break text at writerColumns.

* Added --columns command-line option, which sets stColumns
  and writerColumns.

* Table parsing:  If the size of the header > stColumns,
  use the header size as 100% for purposes of calculating
  relative widths of columns.
2010-12-17 13:39:17 -08:00
John MacFarlane
2a075e9d7a test-pandoc: removed need to depend on MissingH. 2010-12-15 18:07:36 -08:00
John MacFarlane
605648cbbf Added 'tests' Cabal flag.
+ This ensures that test-pandoc gets built.
+ 'cabal test' now runs this.
+ The old tests/RunTests.hs has been removed, and
  src/test-pandoc.hs added.
2010-12-15 17:54:51 -08:00
John MacFarlane
63cf37a9ca HTML reader: allow : in tags.
Resolves Issue #274.
2010-12-15 14:15:53 -08:00
Nathan Gass
a312d2a8ae Use top-level header at end as bibliography title for natbib and biblatex output. 2010-12-15 10:21:56 -08:00
Nathan Gass
8f60176511 Remove punctuation at start of suffix for natbib and biblatex output.
This is necessary as the latex citation commands include there own
punctuation, which resulted in doubled commas for markdown documents
where citeproc output works correctly.
2010-12-15 10:21:53 -08:00
Nathan Gass
43fee5e7f7 Support multiple bibliography files with natbib and biblatex output. 2010-12-15 10:21:47 -08:00
John MacFarlane
63d5e0c5f9 Added 'normalize' to Text.Pandoc.Shared. 2010-12-14 20:04:37 -08:00
Nathan Gass
53cb199bab Added normalize funcion to latex citation tests.
This is necessary because converting from markdown to latex correctly
changes hyphens to en-dashes and some spaces to non-breaking spaces.
Converting back to markdown does not undo this changes, and so the
tests have to undo them.
2010-12-14 19:41:22 -08:00
John MacFarlane
3ac6f72f98 Fixed preamble parsing in LaTeX reader. 2010-12-14 19:34:28 -08:00
Nathan Gass
34d30efc5c Added citation tests.
Added tests for latex  citation writer and reader,
markdown citation writer and additional markup in citations.
2010-12-14 18:38:40 -08:00
John MacFarlane
128cf46089 Fixed regression in parsing _emph_
There was a bug in parsing '_emph_, ...':  when followed by
a comma, underscore emphasis did not register.  (Thanks to
gwern for pointing this out.)

This bug was introduced by the change in
c66921f2ac
2010-12-14 18:23:26 -08:00
Nathan Gass
2e728df756 Moved special handling of punctuation in suffix out of markdown reader.
This allows different writers to handle punctuation in the suffix
differently.
2010-12-13 20:50:29 -08:00
Nathan Gass
c2d3796439 Added support for latex cite commands in latex reader. 2010-12-13 20:48:19 -08:00
Nathan Gass
e8679c04c7 Disabled colored boxes around cites in latex template. 2010-12-13 20:43:17 -08:00
Nathan Gass
c81495a07a Added option to write citation markup in markdown writer. 2010-12-13 20:42:58 -08:00
Nathan Gass
48600fd547 Added support to write natbib or biblatex citations in latex output. 2010-12-13 20:41:37 -08:00
John MacFarlane
1a4a0d0283 Markdown reader: Further fix to abbrevs. 2010-12-13 20:05:50 -08:00
John MacFarlane
7b4d3c77ec Markdown reader: Fixed abbrev handler to allow abbrev at end of line.
E.g., Mr.
Frank.
2010-12-13 20:04:11 -08:00
John MacFarlane
3822d6c440 Markdown reader: Fixed referenceKey parser to allow space after newline. 2010-12-13 20:03:59 -08:00
John MacFarlane
dfbb4d3994 Fixed inlineListToIdentifier to treat '\160' as ' '. 2010-12-13 20:03:52 -08:00
John MacFarlane
999a4733f3 Fixed table in README. 2010-12-13 20:03:44 -08:00
John MacFarlane
a102fed2b8 Fixed internal link in README. 2010-12-13 20:03:35 -08:00
John MacFarlane
71e0557e61 Markdown reader: Fixed regression in reference key parser.
* The recent change allowing spaces and newlines in the URL
  caused problems when reference keys are stacked up without
  blank lines between. This is now fixed.
* Added test.
2010-12-13 20:03:12 -08:00
John MacFarlane
77cb199d45 Benchmark: use nf for writers.
whnf gives inaccurate results.
2010-12-12 23:24:02 -08:00
John MacFarlane
3748dfeb91 Markdown reader: fix superscripts with links.
Moved inlineNote parser after superscript parser,
so ^[link](/foo)^ gets recognized as a superscripted
link, not an inline note followed by garbage.

Thanks to Conal Elliott for pointing out the problem.
2010-12-12 20:30:55 -08:00
John MacFarlane
250aa20250 Recognize .json extension as json reader/writer. 2010-12-12 20:30:26 -08:00
John MacFarlane
c6b79d794e Removed deprecated -C/--custom-header option.
Use --template instead.
2010-12-11 00:22:34 -08:00
John MacFarlane
f5c2082304 Added JSON reader and writer.
The JSON reader is about 20x faster than the native reader.
So this can be a good way to serialize a pandoc document.
2010-12-11 00:06:03 -08:00
John MacFarlane
dab645440a Added Benchmark.hs to extra-source-files. 2010-12-10 23:58:02 -08:00
John MacFarlane
4c7f7853a7 Added Benchmark.hs, testing all readers + writers using criterion. 2010-12-10 23:35:31 -08:00
John MacFarlane
2dfb45950e LaTeX reader: Improved parsing of preamble.
Previously you'd get unexpected behavior on a document that
contained '\begin{document}' in, say, a verbatim block.
2010-12-10 23:21:24 -08:00
John MacFarlane
9602f73f2a Moved 'readers' and 'writers' to Text.Pandoc.
This allows library users to avoid repetitive case statements...
2010-12-10 17:30:32 -08:00
John MacFarlane
de6452c0d1 Markdown reader: small cosmetic code improvements. 2010-12-10 16:26:35 -08:00
John MacFarlane
5770ceca36 Removed HTML sanitization.
This is better done on the resulting HTML; use the xss-sanitize library
for this.  xss-sanitize is based on pandoc's sanitization, but improves
it.

- Removed stateSanitize from ParserState.
- Removed --sanitize-html option.
2010-12-10 12:26:03 -08:00
John MacFarlane
17d48cf4af Markdown reader: Allow linebreaks in URLs (treat as spaces).
Also, a string of consecutive spaces or tabs is now parsed
as a single space. If you have multiple spaces in your URL,
use %20%20.
2010-12-10 12:14:51 -08:00
John MacFarlane
ee0a0953de Markdown reader: Rewrote para parser for better efficiency.
This change avoids repeated parsing of inline lists for 'plain'
blocks.
2010-12-10 10:47:46 -08:00
John MacFarlane
167eeef6cb Added json format for reading and writing.
This is faster to parse than native.
2010-12-09 10:40:31 -08:00
paul.rivier
bb609a85e3 textile redcloth definition lists 2010-12-09 09:25:46 -08:00
John MacFarlane
88a40685b8 Textile reader: better treatment of acronyms.
We now parse PBS(Public Broadcasting System) as if it were
"PBS (Public Broadcasting System)".
2010-12-09 08:52:09 -08:00
John MacFarlane
9ead748cc9 RST reader: Added footnote suppport.
Resolves issue #258.

Note that there are some differences in how docutils and
pandoc treat footnotes.  Currently pandoc ignores the numeral
or symbol used in the note; footnotes are put in an auto-numbered
ordered list.
2010-12-08 08:39:50 -08:00
John MacFarlane
91978d2201 Markdown reader: minor footnote changes.
Don't skipNonindentSpaces in noteMarker, since it's also
used in the inline note parser.
2010-12-08 08:17:16 -08:00
John MacFarlane
f02080b62d Textile reader: Implemented footnotes. 2010-12-08 00:44:46 -08:00
John MacFarlane
200ea33641 Made --smart work with RST reader. 2010-12-07 21:49:10 -08:00
John MacFarlane
5e35eb309f Make --smart work in HTML reader. 2010-12-07 21:24:35 -08:00
John MacFarlane
33ba35da9f Smart punctuation: recognize entities.
Now “Hi” gets parsed as a Quoted DoubleQuote inline.
2010-12-07 20:44:43 -08:00
John MacFarlane
3a5fceeef9 Rewrote normalizeSpaces (mostly aesthetic reasons). 2010-12-07 20:10:21 -08:00
John MacFarlane
e20052a1ba Markdown reader: Moved smartPunctuation parser, for slight speed bump. 2010-12-07 20:09:40 -08:00