aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org.hs
AgeCommit message (Collapse)AuthorFilesLines
2014-06-16Org reader: make tildes create inline code.John MacFarlane1-4/+4
Closes #1345. Also relabeled 'code' and 'verbatim' parsers to accord with the org-mode manual. I'm not sure what the distinction between code and verbatim is supposed to be, but I'm pretty sure both should be represented as Code inlines in pandoc. The previous behavior resulted in the text not appearing in any output format.
2014-06-16Org reader: fixed #1342.John MacFarlane1-9/+5
This change rewrites `inlineLaTeXCommand` so that parsec will know when input is being consumed. Previously a run-time error would be produced with some input involving raw latex. (I believe this does not affect the last release, as the inline latex reading was added recently.)
2014-05-20Org reader: support for inline LaTeXAlbert Krewinkel1-1/+31
Inline LaTeX is now accepted and parsed by the org-mode reader. Both, math symbols (like \tau) and LaTeX commands (like \cite{Coffee}), can be used without any further escaping.
2014-05-14Org reader: support Pandocs citation extensionAlbert Krewinkel1-2/+53
Citations are defined via the "normal citation" syntax used in markdown, with the sole difference that newlines are not allowed between "[...]". This is for consistency, as org-mode generally disallows newlines between square brackets. The extension is turned on by default and can be turned off via the default syntax-extension mechanism, i.e. by specifying "org-citation" as the input format. Move `citeKey` from Readers.Markdown into Parsing The function can be used by other readers, so it is made accessible for all parsers.
2014-05-14Introduce class HasLastStrPosition, generalize functionsAlbert Krewinkel1-7/+4
Both `ParserState` and `OrgParserState` keep track of the parser position at which the last string ended. This patch introduces a new class `HasLastStrPosition` and makes the above types instances of that class. This enables the generalization of functions updating the state or checking if one is right after a string.
2014-05-10Org reader: Fix block parameter reader, relax constraintsAlbert Krewinkel1-6/+13
The reader produced wrong results for block containing non-letter chars in their parameter arguments. This patch relaxes constraints in that it allows block header arguments to contain any non-space character (except for ']' for inline blocks). Thanks to Xiao Hanyu for noticing this.
2014-05-09Org reader: Fix parsing of blank lines within blocksAlbert Krewinkel1-6/+2
Blank lines were parsed as two newlines instead of just one. Thanks to Xiao Hanyu (@xiaohanyu) for pointing this out.
2014-05-09Org reader: Support arguments for code blocksAlbert Krewinkel1-42/+56
The general form of source block headers (`#+BEGIN_SRC <language> <switches> <header arguments>`) was not recognized by the reader. This patch adds support for the above form, adds header arguments to the block's key-value pairs and marks the block as a rundoc block if header arguments are present. This closes #1286.
2014-05-09Org reader: refactor #+BEGIN..#+END block parsing codeAlbert Krewinkel1-42/+80
2014-05-06Org reader: Read inline code blocksAlbert Krewinkel1-3/+40
Org's inline code blocks take forms like `src_haskell(print "hi")` and are frequently used to include results from computations called from within the document. The blocks are read as inline code and marked with the special class `rundoc-block`. Proper handling and execution of these blocks is the subject of a separate library, rundoc, which is work in progress. This closes #1278.
2014-05-01Org reader: Add support for custom link typesAlbert Krewinkel1-8/+60
Org allows users to define their own custom link types. E.g., in a document with a lot of links to Wikipedia articles, one can define a custom wikipedia link-type via #+LINK: wp https://en.wikipedia.org/wiki/ This allows to write [[wp:Org_mode][Org-mode]] instead of the equivallent [[https://en.wikipedia.org/wiki/Org_mode][Org-mode]].
2014-04-25Org reader: Enable internal linksAlbert Krewinkel1-12/+38
Internal links in Org are possible by using an anchor-name as the target of a link: [[some-anchor][This]] is an internal link. It links <<some-anchor>> here.
2014-04-24Org reader: Read anchors as empty spansAlbert Krewinkel1-0/+25
Anchors (like <<this>>) are parsed as empty spans.
2014-04-24Org reader: Recognize plain and angle linksAlbert Krewinkel1-9/+25
This adds support for plain links (like http://zeitlens.com) and angle links (like <http://moltkeplatz.de>).
2014-04-19Org reader: Allow for compact definition listsAlbert Krewinkel1-2/+2
Use `Text.Pandoc.Shared.compactify'DL` to allow for compact definition lists.
2014-04-19Org reader: Fix parsing of footnotesAlbert Krewinkel1-2/+6
Footnotes can consist of multiple blocks and end only at a header or at the beginning of another footnote. This fixes the previous behavior, which restricted notes to a single paragraph.
2014-04-19Org reader: Fix distinction of images and normal linksAlbert Krewinkel1-2/+2
Fixed a false assumption about the precedence of (&&) vs (||).
2014-04-19Org reader: Apply captions to code blocks and tablesAlbert Krewinkel1-40/+94
The `Table` blocktype already takes the caption as an argument, while code blocks are wrapped in a `Div` block together with a labelling `Span`.
2014-04-18Org reader: Add support for plain LaTeX fragmentsAlbert Krewinkel1-1/+40
This adds support for LaTeX fragments like the following: ``` \begin{equation} \int fg \mathrm{d}x \end{equation} ```
2014-04-18Org reader: Fix parsing of loose listsAlbert Krewinkel1-4/+7
Loose lists (i.e. lists with blankline separated items), were parsed as multiple lists, each containing a single item. This patch fixes this issue.
2014-04-17Org reader: Support more types of '#+BEGIN_<type>' blocksAlbert Krewinkel1-7/+34
Support for standard org-blocks is improved. The parser now handles "HTML", "LATEX", "ASCII", "EXAMPLE", "QUOTE" and "VERSE" blocks in a sensible fashion.
2014-04-17Org reader: Support footnotesAlbert Krewinkel1-2/+64
2014-04-16Org reader: introduce Reader environment around Blocks/InlinesAlbert Krewinkel1-130/+176
This introduces a Reader environment in the style of Text.Pandoc.Parsing.F, but adapted to the Org reader parser.
2014-04-16Org reader: Fix code for subexpression parsingAlbert Krewinkel1-21/+4
2014-04-16Org reader: Better module description, minor style changesAlbert Krewinkel1-6/+6
Use module description analogous to the markdown reader's. Use (<$) where it makes sense.
2014-04-13Merge pull request #1239 from tarleb/org-linebreakJohn MacFarlane1-0/+4
Org linebreaks
2014-04-13Merge pull request #1238 from tarleb/org-figuresJohn MacFarlane1-8/+49
Org reader: Add support for figures
2014-04-12Org reader: Removed ANN pragma.John MacFarlane1-3/+0
This relies on Template Haskell, which causes problems in Windows due to libraries with C dependencies. We need to avoid using TH in pandoc code.
2014-04-12Org reader: Read linebreaksAlbert Krewinkel1-0/+4
Linebreaks are marked by the string `\\` at the end of a line.
2014-04-12Org reader: Add support for figuresAlbert Krewinkel1-8/+49
Support for figures (images with name and caption) is added.
2014-04-11Org reader: Fix parsing of sub-/superscript expressionsAlbert Krewinkel1-10/+37
This fixes the org-reader's handling of sub- and superscript expressions. Simple expressions (like `2^+10`), expressions in parentheses (`a_(n+1)`) and nested sexp (like `a_(nested()parens)`) are now read correctly.
2014-04-10Org reader: Improve code by following HLint recommendationsAlbert Krewinkel1-20/+24
HLint's recommendations for better code are applied to the Org-mode reader code.
2014-04-10Org reader: Support more inline/display math variantsAlbert Krewinkel1-2/+26
Support all of the following variants as valid ways to define inline or display math inlines: - `\[..\]` (display) - `$$..$$` (display) - `\(..\)` (inline) - `$..$` (inline) This closes #1223. Again.
2014-04-09Org reader: Precise rules for the recognition of markupAlbert Krewinkel1-120/+260
The inline parsers have been rewritten using the org source code as a reference. This fixes a couple of bugs related to erroneous markup recognition.
2014-04-07Org reader: Support inline math (like $E=mc^2$)Albert Krewinkel1-6/+16
Closes #1223.
2014-04-06Org reader: Add support for definition listsAlbert Krewinkel1-1/+16
2014-04-06Org reader: Minor code clean-upAlbert Krewinkel1-30/+21
2014-04-05Org reader: Added type signature.John MacFarlane1-0/+1
2014-04-05Org reader: Support inline imagesAlbert Krewinkel1-10/+24
2014-04-05Org reader: Provide more language identifier translationsAlbert Krewinkel1-1/+8
Org-mode and Pandoc use different language identifiers, marking source code as being written in a certain programming language. This adds more translations from identifiers as used in Org to identifiers used in Pandoc. The full list of identifiers used in Org and Pandoc is available through http://orgmode.org/manual/Languages.html and `pandoc -v`, respectively.
2014-04-05Org reader: Fix parsing of nested inlinesAlbert Krewinkel1-7/+20
Text such as /*this*/ was not correctly parsed as a strong, emphasised word. This was due to the end-of-word recognition being to strict as it did not accept markup chars as part of a word. The fix involves an additional parser state field, listing the markup chars which might be parsed as part of a word.
2014-04-05Org reader: Use specialized org parser stateAlbert Krewinkel1-7/+41
The default pandoc ParserState is replaced with `OrgParserState`. This is done to simplify the introduction of new state fields required for efficient Org parsing.
2014-04-05Org reader: Slight cleaning of table parsing codeAlbert Krewinkel1-33/+35
2014-03-04Add a simple Emacs Org-mode readerAlbert Krewinkel1-0/+552
The basic structure of org-mode documents is recognized; however, org-mode features like todo markers, tags etc. are not supported yet.