aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Markdown.hs
AgeCommit message (Collapse)AuthorFilesLines
2014-08-16Markdown writer: don't escape $, ^, ~ when extensions are deactivated.John MacFarlane1-5/+16
`tex_math_dollars`, `superscript`, and `subscript` extensions, respectively. Closes #1127.
2014-08-08Plain writer: Use ALL CAPS for level 1 headers.John MacFarlane1-1/+4
2014-08-08Markdown writer: Respect -raw_html.John MacFarlane1-12/+14
pandoc -t markdown-raw_html should not emit any raw HTML, even span and div tags that go with pandoc Span and Div elements. Cleaned up a bit of the logic with extensions and plain.
2014-08-04Use `stripPrefix` where appropriate.Artyom Kazak1-2/+3
2014-08-03Correctly implement capitalisation.Artyom Kazak1-7/+3
Using `map toUpper` to capitalise text is wrong, as e.g. “Straße” should be converted to “STRASSE”, which is 1 character longer. This commit adds a `capitalize` function and replaces 2 identical implementations in different modules (`toCaps` and `capitalize`) with it.
2014-07-27Markdown writer: Separate adjacent lists of the same kind with comment.John MacFarlane1-3/+9
Closes #1458.
2014-07-27Markdown writer: More improvements to 'plain' output, updated tests.John MacFarlane1-21/+26
Math now appears in unicode if possible, without the distracting italics around identifiers. Blank lines around headers are more consistent. Footnotes appear in regular [n] style.
2014-07-27Markdown writer: Better 'plain' output.John MacFarlane1-83/+101
We now largely follow the style of Project Gutenberg. Emphasis is rendered with `_underscores_`, strong with ALL CAPS. The appearance of horizontal rules has changed (even in regular markdown) to a line across the whole page. Headings are rendered differently, using space to set them off.
2014-07-27Markdown writer: Update definition lists.John MacFarlane1-2/+13
They now behave like the new reader does. The old behavior can be activated with the `compact_definition_lists` extension.
2014-07-21Markdown writer: Avoid wrapping that might start a list.John MacFarlane1-1/+5
Or a blockquote or header. Closes #1013.
2014-07-19Renamed readTeXMath' to avoid name conflict with texmath 0.6.7Matthew Pickering1-3/+3
Also removed deprecated readTeXMath.
2014-07-13Markdown writer: Use span with style for SmallCaps. (#1360)John MacFarlane1-1/+8
2014-07-13Markdown writer: use Span instead of (hackish) SmallCaps in plainify.John MacFarlane1-9/+10
2014-07-13Use renderTags' for all tag rendering.John MacFarlane1-2/+2
This properly handles tags that should be self-closing. Previously `<hr/>` would appear in EPUB output as `<hr></hr>`. Closes #1420.
2014-07-11Markdown writer: don't use braced attributes for fenced code.John MacFarlane1-2/+2
Removed `Ext_fenced_code_attributes` from `markdown_github` extensions. If this extension is not set, the first class attribute will be printed after the opening fence as a bare word. Closes #1416.
2014-06-03Markdown writer: Prettier pipe tables.John MacFarlane1-8/+16
Columns are now aligned. Closes #1323.
2014-05-09Update copyright notices for 2014, add missing noticesAlbert Krewinkel1-2/+2
2014-04-24Markdown writer: Use proper escapes to avoid unwanted lists.John MacFarlane1-11/+16
Previously we used 0-width spaces, an ugly hack. Closes #980.
2014-03-30Markdown writer: Use longer backtick fences if needed.John MacFarlane1-1/+5
If the content contains a backtick fence and there are attributes, make sure longer fences are used to delimit the code. Note: This works well in pandoc, but github markdown is more limited, and will interpret the first string of three or more backticks as ending the code block. Closes #1206.
2013-12-19HLint: use `elem` and `notElem`Henry de Valence1-5/+6
Replaces long conditional chains with calls to `elem` and `notElem`.
2013-12-09Don't use tilde code blocks with braced attributes in gfm output.John MacFarlane1-9/+9
A consequence of this change is that the backtick form will be preferred in general if both are enabled. I think that is good, as it is much more widespread than the tilde form. Closes #1084.
2013-11-30Markdown writer: Fix rendering of tight sublists.John MacFarlane1-1/+8
E.g. - foo - bar - baz Previously a spurious blank line was included before the last item. Closes #1050.
2013-11-06Don't print `<span>` tags in 'plain' output.John MacFarlane1-1/+4
2013-11-01TexMath: Export readTeXMath', which attends to display/inline.John MacFarlane1-3/+3
Deprecate readTeXMath, and use readTeXMath' in all the writers. Require texmath >= 0.6.5.
2013-10-16Use isURI instead of isAbsoluteURI.John MacFarlane1-2/+2
It allows fragments identifiers.
2013-09-19Markdown reader: small code improvement.John MacFarlane1-5/+5
2013-09-12Markdown writer: Print references if output is 'plain'.John MacFarlane1-1/+2
2013-09-06Markdown writer: Fixed bugs in YAML header output.John MacFarlane1-3/+3
2013-08-20Create Cite element even if no matching reference in the biblio.John MacFarlane1-14/+21
* Add ??? as fallback text for non-resolved citations. * Biblio: Put references (including a header at the end of the document, if one exists) inside a Div with class "references". This gives some control over styling of references, and allows scripts to manipulate them. * Markdown writer: Print markdown citation codes, and disable printing of references, if `citations` extension is enabled. NOTE: It would be good to improve what citeproc-hs does for a nonexistent key.
2013-08-18Adjusted writers and tests for change in parsing of div/span.John MacFarlane1-5/+12
Textile, MediaWiki, Markdown, Org, RST will emit raw HTML div tags for divs. Otherwise Div and Span are "transparent" block containers.
2013-08-10Use walk, walkM in place of bottomUp, bottomUpM when possible.John MacFarlane1-4/+4
They are significantly faster.
2013-08-08Preliminary support for new Div and Span elements in writers.John MacFarlane1-0/+3
Currently these are "transparent" containers, except in HTML, where they produce div and span elements with attributes.
2013-07-02Rename `Ext_yaml_title_block` -> `Ext_yaml_metadata_block`.John MacFarlane1-4/+4
2013-07-02Markdown writer: Changed condition for rendering title block.John MacFarlane1-4/+3
Previously it was only rendered if title, author, or date set. Now any metadata field can be set.
2013-07-02Write full metadata in MMD style title blocks.John MacFarlane1-7/+23
2013-07-01Markdown writer: Commas are okay in plain yaml scalars.John MacFarlane1-1/+1
It's just commas with brackets that can cause problems.
2013-07-01Markdown writer: Render yaml title block fields in alpha order.John MacFarlane1-2/+3
This makes the output predictable; previously it varied across implementations.
2013-07-01Created Text.Pandoc.Writers.Shared, improved metaToJSON.John MacFarlane1-7/+5
* Text.Pandoc.Writers.Shared contains shared functions used only in writers. * metaToJSON now takes a WriterOptions parameter, and will return an empty object if standalone is not specified.
2013-07-01Improvements to yaml title block writer.John MacFarlane1-24/+37
2013-07-01Revert "Markdown writer: Don't include variables in metadata."John MacFarlane1-41/+35
This reverts commit 0ec8573347d53e0cba70552a50dba697f39216b6.
2013-07-01Markdown writer: Don't include variables in metadata.John MacFarlane1-35/+41
2013-06-30Markdown writer: Support yaml title block.John MacFarlane1-8/+30
2013-06-29Metadata changes: Variables now completely shadow metadata.John MacFarlane1-2/+2
Previously if you set a value both in metadata and with a variable, they'd be combined into a list. Now the variable replaces the value in document metadata. If many variables with the same name are set, a list is created. Shared: metaToJSON now has an argument for a variable list.
2013-06-27Writers: Use defField for defaults.John MacFarlane1-3/+3
This way explicitly specified fields not overridden. Fixes a problem e.g. with specifying a documentclass via the command line using -V.
2013-06-24Use new flexible metadata type.John MacFarlane1-21/+26
* Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
2013-06-11Markdown writer: Don't wrap attributes in fenced code blocks.John MacFarlane1-2/+2
2013-04-14Markdown/RST writers: Only autolink absolute URIs.John MacFarlane1-1/+3
This fixes a regression and closes #830. $ echo '<a href="x">x</a>' | pandoc -f html -t markdown <x>
2013-04-08Markdown writer: Put multiple authors on separate lines in titleblock.John MacFarlane1-1/+1
Also, don't wrap long author entries, as new lines get treated as new authors.
2013-03-28Allow simple tables to be printed as grid tables.John MacFarlane1-11/+14
if other table options are disabled. This means you can do pandoc -t markdown-pipe_tables-simple_tables-multiline_tables and all tables will render as grid tables.
2013-03-17Markdown writer: New approach for citations.John MacFarlane1-14/+4
* Reverts 1.11 change that caused citations to be rendered as markdown citations, even if `--biblio` was specified, unless `citation` extension is disabled. Now, formatted citations are always printed if `--biblio` was specified. If you want to reformat markdown keeping pandoc markdown citations intact, just don't specify `--biblio`. * Reverted now unnecessary changes to Text.Pandoc.Biblio adding the raw block to mark the bibliography, and to Text.Pandoc.Writers.Markdown to remove the bibliography if `citations` not specified. * If the content of a `Cite` inline is a `RawInline "latex"`, which means that a LaTeX citation command was parsed and `--biblio` wasn't specified, then render it as a pandoc markdown citation. This means that `pandoc -f latex -t markdown`, without `--biblio`, will convert LaTeX citation commands to pandoc markdown citations.