Commit graph

3233 commits

Author SHA1 Message Date
John MacFarlane
0cb7362f62 Removed --strict, added extensions to writer/reader names.
* The `--strict` option has been removed.
* Instead of using `--strict`, one can now use `strict` instead of
  `markdown` as an input or output format name.
* The `--enable` and `--disable` optinos have been removed.
* It is now possible to enable or disable specific extensions
  by appending them (with '+' or '-') to the writer or reader
  name.  For example `pandoc -f markdown-footnotes+hard_line_breaks`.
* The lhs extensions are now implemented this way, too; you can
  use either `+lhs` or `+literate_haskell`.
2012-08-09 20:24:05 -07:00
John MacFarlane
71e0c206c1 Added getReader, getWriter to Text.Pandoc. 2012-08-09 19:11:19 -07:00
John MacFarlane
41e0075789 Removed --enable, --disable options. 2012-08-09 18:38:02 -07:00
John MacFarlane
a740de0508 Use safeRead instead of using reads directly (various modules). 2012-08-09 08:11:28 -07:00
John MacFarlane
10cdd59fa8 Added safeRead to Text.Pandoc.Shared. 2012-08-09 07:52:39 -07:00
John MacFarlane
244dae8da8 Added parseFormatSpec to Text.Pandoc. 2012-08-09 07:42:40 -07:00
John MacFarlane
dfa4b76630 Changes to literate haskell options.
- Removed writerLiterateHaskell from WriterOptions.
- Removed readerLiterateHaskell from ReaderOptions.
- Added Ext_literate_haskell to Extensions.  Test for this
  instead of the above.
- Removed failUnlessLHS from Shared.

Note:  At this point, +lhs and .lhs extension no longer has any effect.
Need to fix.
2012-08-08 23:18:19 -07:00
John MacFarlane
34f1f9716b Makefile: Require pandoc-types before citeproc-hs. 2012-08-08 18:01:22 -07:00
John MacFarlane
bba08126b4 Temporarily removed travis build instructions. 2012-08-08 15:36:57 -07:00
John MacFarlane
1f940ee395 Changed heading in README so we don't have two "Citations" sections. 2012-08-08 15:36:33 -07:00
John MacFarlane
db2106c57d Added Makefile for development. 2012-08-07 22:49:56 -07:00
John MacFarlane
6561ce0ec1 Markdown reader: Modified to use Builder from pandoc-types 1.10.*. 2012-08-07 22:49:15 -07:00
John MacFarlane
7cfec2bcd9 Require pandoc-types 1.10.*. 2012-08-07 22:48:48 -07:00
John MacFarlane
f9f6e5ec6f Made pandocExtensions default for reader/writer options. 2012-08-07 13:17:30 -07:00
John MacFarlane
8a101cffe3 Support hard_line_breaks markdown extension.
* Added Ext_hard_line_breaks.
* Added section in README on non-pandoc extensions.
* Exported pandocExtensions and strictExtensions in Text.Pandoc.Options.

Closes #514.
2012-08-06 22:14:35 -07:00
John MacFarlane
dc071f807d Markdown writer: Tables now sensitive to table extension options.
Ext_simple_table, Ext_multiline_tables, Ext_pipe_tables.
Simple tables are preferred over pipe tables when both are
enabled.  If no appropriate table style is available,
a raw HTML table is used.

So far there is no option for output of grid tables.
2012-08-05 10:23:30 -07:00
John MacFarlane
81125e8f4e Documented styles used in reference docx 2012-08-05 09:18:56 -07:00
John MacFarlane
437b9ec5a4 Started making markdown table writer sensitive to options.
So far incomplete.
2012-08-05 00:02:08 -07:00
John MacFarlane
3f913c0cc5 Don't include empty captions in figures.
Closes #581.
2012-08-04 11:34:01 -07:00
John MacFarlane
c19c6fdc50 Markdown reader: look for raw html/latex blocks before tables.
Otherwise the following gets parsed as a table:

\begin{code}
--------------
-- My comment.
\end{code}

Closes #578.
2012-08-04 10:49:05 -07:00
John MacFarlane
64f1d68d4e Don't use escaped line breaks in plain output. 2012-08-02 22:22:52 -07:00
John MacFarlane
b6ab2d3cb8 Made markdown writer sensitive to Ext_subscript/superscript/strikeout.
HTML is used if these are disabled.
2012-08-02 21:40:54 -07:00
John MacFarlane
aef0f1d7c7 Made markdown writer sensitive to Ext_definition_lists.
IF not set, definition lists will be rendered as regular
paragraphs, with the term set off by a line break.
2012-08-02 21:35:02 -07:00
John MacFarlane
03b1ba546f Made markdown writer sensitive to Ext_startnum, Ext_fancy_lists. 2012-08-02 21:20:31 -07:00
John MacFarlane
d21304bab0 Made markdown reader sensitive to Ext_raw_tex. 2012-08-02 21:14:43 -07:00
John MacFarlane
214fef9e27 Made markdown writer sensitive to Ext_table_captions. 2012-08-02 21:07:40 -07:00
John MacFarlane
b98049ee6c Made markdown writer sensitive to Ext_pandoc_title_blocks. 2012-08-02 21:03:54 -07:00
John MacFarlane
1d7fd8012d Made markdown writer sensitive to Ext_footnotes.
If footnotes not enabled, footnotes are formatted like normal
markdown paragraphs, with a marker like [3].
2012-08-02 21:00:02 -07:00
John MacFarlane
2403ca86f9 Markdown reader: Import <> from Text.Pandoc.Builder.
This way the module will work with versions of Data.Monoid
that don't export <>.
2012-08-02 17:25:57 -07:00
John MacFarlane
33fd791ea1 Made F a newtype, moved definitions to Parser.
Parser now exports F(..), askF, asksF, runF.
2012-08-02 17:12:20 -07:00
John MacFarlane
ebd72e7ba6 Improved implementation of pipe tables. 2012-08-01 23:34:48 -07:00
John MacFarlane
a1677b612b Parsing: removed duplication of Key and Key'.
Now we just use the former Key' (string contents),
renamed Key.  lookupKeySrc and fromKey are no longer
eport.  Key', toKey' and KeyTable' have become Key,
toKey, and KeyTable.
2012-08-01 22:40:07 -07:00
John MacFarlane
fadc7b0d87 Major rewrite of markdown reader.
* Use Builder's Inlines/Blocks instead of lists.

* Return values in the reader monad, which are then
  run (at the end of parsing) against the final
  parser state.  This allows links, notes, and
  example numbers to be resolved without a second
  parser pass.

* An effect of using Builder is that everything is
  normalized automatically.

* New exports from Text.Pandoc.Parsing:
  widthsFromIndices, NoteTable', KeyTable', Key', toKey',
  withQuoteContext, singleQuoteStart, singleQuoteEnd, doubleQuoteStart,
  doubleQuoteEnd, ellipses, apostrophe, dash

* Updated opendocument tests.

* Don't derive Show for ParserState.

* Benchmarks:  markdown reader takes 82% of the time it took before.
  Markdown writer takes 92% of the time (here the speedup is probably
  due to the fact that everything is normalized by default).
2012-08-01 21:45:40 -07:00
John MacFarlane
973c7ecacf Removed commented-out pandoc2 code.
This will be developed in a branch, noreparsing.
2012-07-27 21:04:38 -07:00
John MacFarlane
c76ef95308 Parser: Changed types to use type alias Parser, not Parsec. 2012-07-27 20:50:03 -07:00
John MacFarlane
0380aa63d5 Updated extension labels in README. 2012-07-27 19:04:27 -07:00
John MacFarlane
eb99b7e7b9 Commented out extensions that don't yet do anything. 2012-07-27 19:04:11 -07:00
John MacFarlane
7905feac3f Removed deprecated writerXeTeX. 2012-07-27 16:01:17 -07:00
John MacFarlane
f0b9d52fd3 Markdown reader: Added sensitivity to Ext_example_lists. 2012-07-27 16:00:27 -07:00
John MacFarlane
ec7c1631a5 More documentation of extensions 2012-07-27 16:00:22 -07:00
John MacFarlane
b516082997 Markdown reader: Check fancy_lists and startnum extensions. 2012-07-27 15:45:47 -07:00
John MacFarlane
6e548b8a8f Started documenting individual syntax extensions in README. 2012-07-27 15:45:30 -07:00
John MacFarlane
fc738c6315 Benchmark: default to sample size of 20 for speed. 2012-07-27 11:13:18 -07:00
John MacFarlane
5b6e70c3b5 Use README + testsuite in benchmarks. 2012-07-27 11:06:24 -07:00
John MacFarlane
38c452b342 Added --disable and --enable options for markdown extensions. 2012-07-27 10:49:53 -07:00
John MacFarlane
b98219773b Replaced writerStrict with writerExtensions in WriterOptions.
Still have not implemented individual tests for all the extensions
in the markdown writer.
2012-07-27 09:18:51 -07:00
John MacFarlane
00dc1e715e Moved WriterOptions and associated types Shared -> Options. 2012-07-26 22:59:56 -07:00
John MacFarlane
6d7f0a1b81 Fixed whitespace errors. 2012-07-26 22:32:53 -07:00
John MacFarlane
e797ab9136 Textile reader: Replace failIfStrict with guardEnabled. 2012-07-26 22:21:00 -07:00
John MacFarlane
14c911ba06 Parsing: Removed failIfStrict. 2012-07-26 22:20:44 -07:00