Commit graph

7132 commits

Author SHA1 Message Date
Albert Krewinkel
c4cf6d237f
Org reader: support archived trees export options
Handling of archived trees can be modified using the `arch` option.
Archived trees are either dropped, exported completely, or collapsed to
include just the header when the `arch` option is nil, non-nil, or
`headline`, respectively.
2016-07-01 23:05:33 +02:00
Albert Krewinkel
1ebaf6de11
Org reader: refactor comment tree handling
Comment trees were handled after parsing, as pattern matching on lists
is easier than matching on sequences.  The new method of reading
documents as trees allows for more elegant subtree removal.
2016-07-01 23:05:32 +02:00
Albert Krewinkel
17484ed01a
Org reader: parse as headlines, convert to blocks
Emacs org-mode is based on outline-mode, which treats documents as trees
with headlines are nodes.  The reader is refactored to parse into a
similar tree structure.  This simplifies transformations acting on
document (sub-)trees.
2016-07-01 23:05:32 +02:00
Albert Krewinkel
2f8d6755f4
Org reader: improve tag and properties type safety
Specific newtype definitions are used to replace stringly typing of tags
and properties.  Type safety is increased while readability is improved.
2016-07-01 23:05:32 +02:00
Alex Ivkin
7fdcd9a6e2 Added ZimWiki format to documentation and cabal description. 2016-07-01 00:12:25 -07:00
Alex Ivkin
a73c95f61d Added Zim Wiki writer, template and tests. 2016-06-30 23:59:43 -07:00
Jesse Rosenthal
b103f829f0 Docx writer: set paragraph to FirstPara after display math
We treat display math like block quotes, and apply FirstParagraph style
to paragraphs that follow them. These can be styled as the user
wishes. (But, when the user is using indentation, this allows for
paragraphs to continue after display math without indentation.)
2016-07-01 01:14:16 -04:00
Jesse Rosenthal
2c62f0e122 Writers: treat SoftBreak as space for stripping
In Writers.Shared, we strip leading and trailing spaces for display
math. Since SoftBreak's are treated as spaces, we should strip those
too.
2016-07-01 00:52:52 -04:00
John MacFarlane
3429fa6438 LaTeX reader: fixed \cite so it is a NormalCitation not AuthorInText. 2016-06-29 07:59:00 -07:00
John MacFarlane
a349814665 Merge pull request #3001 from tarleb/org-figure-label
Org reader: support figure labels
2016-06-26 17:51:51 -07:00
John MacFarlane
7ded9d4af0 Include table of contents in README.html in Windows package. 2016-06-26 17:24:15 -07:00
Albert Krewinkel
0f3f5ce1a1 Org reader: support figure labels
Figure labels given as `#+LABEL: thelabel` are used as the ID of the
respective image.  This allows e.g. the LaTeX to add proper `\label`
markup.

This fixes half of #2496 and #2999.
2016-06-26 20:42:22 +02:00
John MacFarlane
38c97320ef Textile reader: Fix overly aggressive interpretation as images.
Spaces are not allowed in the image URL in textile.

Closes #2998.
2016-06-25 14:04:47 -07:00
John MacFarlane
0f9c6c4db0 Added secnumdepth variable to LaTeX template.
Closes #2920.
2016-06-25 13:13:09 -07:00
John MacFarlane
d283f9c864 Fixed RST links with no explicit link text.
The link

    `<foo>`_

should have `foo` as both its link text and its URL.

See RST spec at
<http://docutils.sourceforge.net/docs/ref/rst/restructuredtext.html#embedded-uris-and-aliases>

"The reference text may also be omitted, in which case the URI will be
duplicated for use as the reference text. This is useful for relative
URIs where the address or file name is also the desired reference text:

See `<a_named_relative_link>`_ or `<an_anonymous_relative_link>`__
for details."

Closes Debian #828167 -- reported by Christian Heller.
2016-06-25 10:56:37 -07:00
John MacFarlane
a4294800bf Make --webtex work with the Markdown writer.
Closes #1177.  This is a convenient option for people using
websites whose Markdown flavors don't provide for math.
2016-06-24 14:57:21 -07:00
John MacFarlane
5bdf217135 Added texmath 0.8.6.4 to windows/stack.yaml. 2016-06-24 10:45:01 -07:00
John MacFarlane
69e59e7f29 Process markdown extensions on command line in L->R order.
Previously they were processed, very unintuitively, in R->L
order, so that `markdown-tex_math_dollars+tex_math_dollars`
had `tex_math_dollars` disabled.

Closes #2995.
2016-06-23 23:04:42 -07:00
John MacFarlane
7f4ee830c9 Improved Windows installer - don't ignore properties set on command-line.
See #2708.  Needs testing to see if this resolves the issue.

Thanks to @nkalvi.
2016-06-23 11:09:25 -07:00
John MacFarlane
a820c1bd1c Textile reader: fixed attributes.
Attributes can't be followed by a space.

So,

    _(class)emph_

but

    _(noclass) emph_

Closes #2984.
2016-06-23 10:28:54 -07:00
John MacFarlane
139d418d4b Markdown writer: use raw HTML for simple, pipe tables with linebreaks.
Markdown line breaks involve a newline, and simple and pipe
tables can't contain one.

Closes #2993.
2016-06-23 10:00:33 -07:00
Jesse Rosenthal
5fac8266d8 README: update to include track-changes comments. 2016-06-23 10:50:46 -04:00
Jesse Rosenthal
7980631a0b Docx reader: add tests for comments
We test for comments, using all track-changes options. Note that we
should only output comments if `--track-changes=all`. We also test for
emitting warnings if there is complicated formatting.
2016-06-23 10:50:46 -04:00
Jesse Rosenthal
5d48a62b74 Docx reader tests: Add tests for warnings.
We test to see if we emit any warnings.
2016-06-23 10:50:46 -04:00
Jesse Rosenthal
032ba8dd0c Docx reader: Add warning for advanced comment formatting.
We can't guarantee we'll convert every comment correctly, though we'll
do the best we can. This warns if the comment includes something other
than Para or Plain.
2016-06-23 10:50:46 -04:00
Jesse Rosenthal
5f0cd89129 docx reader: enable warnings in top-level reader
Previously we had only allowed for warnings in the parser. Now we allow
for them in the `Docx.hs` as well. The warnings are simply concatenated.
2016-06-23 10:50:46 -04:00
Jesse Rosenthal
8bb739f7ff Docx reader: add simple comment functionality.
This adds simple track-changes comment parsing to the docx reader. It is
turned on with `--track-changes=all`. All comments are converted to
inlines, which can list some information. In the future a warning will
be added for comments with formatting that seems like it will be
excessively denatured.

Note that comments can extend across blocks. For that reason there are
two spans: `comment-start` and `comment-end`. `comment-start` will
contain the comment. `comment-end` will always be empty. The two will be
associated by a numeric id.
2016-06-23 10:50:46 -04:00
Jesse Rosenthal
cbc2c15f0f Shared: Add BlockQuote to blocksToInlines 2016-06-23 10:50:46 -04:00
Jesse Rosenthal
2b701f9389 Shared: introduce blocksToInlines function
This is a lossy function for converting `[Block] -> [Inline]`. Its main
use, at the moment, is for docx comments, which can contain arbitrary
blocks (except for footnotes), but which will be converted to spans.

This is, at the moment, pretty useless for everything but the basic
`Para` and `Plain` comments. It can be improved, but the docx reader
should probably emit a warning if the comment contains more than this.
2016-06-23 10:50:46 -04:00
John MacFarlane
319a56aefc Merge pull request #2992 from tarleb/org-partial-functions
Org reader: remove partial functions
2016-06-22 12:51:37 -07:00
John MacFarlane
ba7868765a HTML writer: Better support for raw LaTeX environments.
Previously we just passed all raw TeX through when MathJax
was used for HTML math.  This passed through too much.
With this patch, only raw LaTeX environments that MathJax
can handle get passed through.

This patch also causes raw LaTeX environments to be treated
as math, when possible, with MathML and WebTeX output.

Closes #2758.
2016-06-22 11:47:44 -07:00
John MacFarlane
b06d6c1ff8 Update texmath lower bound. 2016-06-22 11:45:32 -07:00
Albert Krewinkel
7df656089f Org reader: remove partial functions
Partial functions like `head` lead to avoidable errors and should be
avoided.  They are replaced with total functions.

This fixes #2991.
2016-06-21 23:51:15 +02:00
John MacFarlane
175cc2d44d Implement RawInline and RawBlock in sample lua custom writer.
Closes #2985.
2016-06-20 11:55:43 -07:00
John MacFarlane
58d60b1c85 Changed email-obfuscation default to no obfuscation.
- `writerEmailObfuscation` in `defaultWriterOptions` is now
  `NoObfuscation`
- the default for the command-line `--email-obfuscation` option is
  now `none`.

Closes #2988.
2016-06-20 10:37:23 -07:00
John MacFarlane
f04b26d481 Merge pull request #2979 from tarleb/doc-update
Documentation updates
2016-06-14 20:41:24 -06:00
John MacFarlane
15d2c09ba1 Merge pull request #2980 from tarleb/org-raw-inlines
Org reader: raw inlines in arbitrary formats
2016-06-14 20:21:37 -06:00
John MacFarlane
5ea3cc647b Merge pull request #2981 from felixonmars/patch-1
Allow tagsoup 0.14
2016-06-14 19:40:14 -06:00
Felix Yan
f0265d4f34 Allow tagsoup 0.14
Building with the new release went fine here, and it works correctly.
2016-06-14 07:44:09 -05:00
Albert Krewinkel
96516e4d8a Document Org mode as a format containing raw HTML
Raw HTML is kept when the output format is Emacs Org mode.
2016-06-14 00:06:41 +02:00
Albert Krewinkel
29552eff3e Org reader: support arbitrary raw inlines
Org mode allows arbitrary raw inlines ("export snippets" in Emacs
parlance) to be included as `@@format:raw foreign format text@@`.

Support for this features is added to the Org reader.
2016-06-13 23:53:14 +02:00
Albert Krewinkel
cf2502de8f Org writer: support arbitrary raw inlines
Org mode allows arbitrary raw inlines ("export snippets" in Emacs
parlance) to be included as `@@format:raw foreign format text@@`.

Support for this features is added to the Org writer.
2016-06-13 23:13:05 +02:00
Albert Krewinkel
98b081b0db Document Org mode as a format containing raw TeX
Raw TeX is kept verbatim when the output format is Emacs Org mode.
2016-06-12 21:33:06 +02:00
Albert Krewinkel
018e8f5c36 Document MultiMarkdown as input/output format
MultiMarkdown was only mentioned as a supported Markdown dialect but not
as a possible input or output format.  A brief mention is added
everywhere the other supported markdown dialects are mentioned.

This closes #2973.
2016-06-12 21:25:14 +02:00
John MacFarlane
43382cead2 trypandoc: call results 'html' instead of 'result'.
This is for better compatibility with babelmark2.
2016-06-07 23:37:48 -07:00
John MacFarlane
3e06172a00 Merge pull request #2968 from IvoBCD/docbook5-xlink-ns
Docbook writer: Declare xlink namespace in Docbook5 output
2016-06-07 11:27:33 -07:00
John MacFarlane
4136ec0f4a latex template: fix for obscure hyperref/xelatex issue.
Here's a minimal case:

    \documentclass[]{article}
    \usepackage{hyperref}
    \begin{document}
    \section{\%á}
    \end{document}

Without this change, this fails on the second invocation of xelatex.
See https://tex.stackexchange.com/questions/313266/and-non-ascii-characters-in-headings

This affects inputs this like

    # %á

with pdf output via xelatex.
2016-06-07 10:11:48 -07:00
Ivo Clarysse
240cdfd1b3 Docbook writer: Declare xlink namespace in Docbook5 output 2016-06-07 06:03:06 -07:00
John MacFarlane
a184aec707 Merge pull request #2964 from tarleb/org-berkeley-ref
Org reader: "Berkeley style" citation support
2016-06-05 11:58:47 -07:00
Albert Krewinkel
8a9f5915ab Org reader: add support for "Berkeley-style" cites
A specification for an official Org-mode citation syntax was drafted by
Richard Lawrence and enhanced with the help of others on the orgmode
mailing list.  Basic support for this citation style is added to the
reader.

This closes #1978.
2016-06-05 11:28:57 +02:00