summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org
Commit message (Collapse)AuthorAge
* Org reader: use org-language attribute rather than data-org-language.John MacFarlane2017-08-09
|
* Org reader: use tag-name attribute instead of data-tag-name.John MacFarlane2017-08-09
|
* Rewrote LaTeX reader with proper tokenization.John MacFarlane2017-07-07
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This rewrite is primarily motivated by the need to get macros working properly. A side benefit is that the reader is significantly faster (27s -> 19s in one benchmark, and there is a lot of room for further optimization). We now tokenize the input text, then parse the token stream. Macros modify the token stream, so they should now be effective in any context, including math. Thus, we no longer need the clunky macro processing capacities of texmath. A custom state LaTeXState is used instead of ParserState. This, plus the tokenization, will require some rewriting of the exported functions rawLaTeXInline, inlineCommand, rawLaTeXBlock. * Added Text.Pandoc.Readers.LaTeX.Types (new exported module). Exports Macro, Tok, TokType, Line, Column. [API change] * Text.Pandoc.Parsing: adjusted type of `insertIncludedFile` so it can be used with token parser. * Removed old texmath macro stuff from Parsing. Use Macro from Text.Pandoc.Readers.LaTeX.Types instead. * Removed texmath macro material from Markdown reader. * Changed types for Text.Pandoc.Readers.LaTeX's rawLaTeXInline and rawLaTeXBlock. (Both now return a String, and they are polymorphic in state.) * Added orgMacros field to OrgState. [API change] * Removed readerApplyMacros from ReaderOptions. Now we just check the `latex_macros` reader extension. * Allow `\newcommand\foo{blah}` without braces. Fixes #1390. Fixes #2118. Fixes #3236. Fixes #3779. Fixes #934. Fixes #982.
* Improve code style in lua and org modulesAlbert Krewinkel2017-06-03
|
* Org reader: apply hlint suggestionsAlbert Krewinkel2017-06-03
|
* Org reader: respect export option for tagsAlbert Krewinkel2017-05-31
| | | | | | | Tags are appended to headlines by default, but will be omitted when the `tags` export option is set to nil. Closes: #3713
* Org reader: include tags in headlinesAlbert Krewinkel2017-05-31
| | | | | | | The Emacs default is to include tags in the headline when exporting. Instead of just empty spans, which contain the tag name as attribute, tags are rendered as small caps and wrapped in those spans. Non-breaking spaces serve as separators for multiple tags.
* Org reader: recognize babel result blocks with attributesAlbert Krewinkel2017-05-31
| | | | | | | | Babel result blocks can have block attributes like captions and names. Result blocks with attributes were not recognized and were parsed as normal blocks without attributes. Fixes: #3706
* Org reader: fix module names in haddock commentsAlbert Krewinkel2017-05-31
| | | | | Copy-pasting had lead to haddock module descriptions containing the wrong module names.
* Org reader: Fix cite parsing behaviourHerwig Stuetz2017-05-28
| | | | | | | | | | | | Until now, org-ref cite keys included special characters also at the end. This caused problems when citations occur right before colons or at the end of a sentence. With this change, all non alphanumeric characters at the end of a cite key are ignored. This also adds `,` to the list of special characters that are legal in cite keys to better mirror the behaviour of org-export.
* Parsing: `many1Till`: Check for the end condition before parsingHerwig Stuetz2017-05-28
| | | | | | | | | | | | | | | | | By not checking for the end condition before the first parse, the parser was applied too often, consuming too much of the input. This fixes the behaviour of `testStringWith (many1Till (oneOf "ab") (string "aa")) "aaa"` which before incorrectly returned `Right "a"`. With this change, it instead correctly fails with `Left (PandocParsecError ...)` because it is not able to parse at least one occurence of `oneOf "ab"` that is not `"aa"`. Note that this only affects `many1Till p end` where `p` matches on a prefix of `end`.
* Org reader: subject full doc tree to headline transformationsAlbert Krewinkel2017-05-27
| | | | | | | | | Emacs parses org documents into a tree structure, which is then post-processed during exporting. The reader is changed to do the same, turning the document into a single tree of headlines starting at levelĀ 0. Fixes: #3695
* Move indentWith to Text.Pandoc.Parsing (#3687)Alexander Krotov2017-05-22
|
* Org reader: fix smart parsing behaviorAlbert Krewinkel2017-05-18
| | | | | | | | | | | | | | | | Parsing of smart quotes and special characters can either be enabled via the `smart` language extension or the `'` and `-` export options. Smart parsing is active if either the extension or export option is enabled. Only smart parsing of special characters (like ellipses and en and em dashes) is enabled by default, while smart quotes are disabled. This means that all smart parsing features will be enabled by adding the `smart` language extension. Fine-grained control is possible by leaving the language extension disabled. In that case, smart parsing is controlled via the aforementioned export OPTIONS only. Previously, all smart parsing was disabled unless the language extension was enabled.
* Merge pull request #3677 from labdsf/anylinenewlineJohn MacFarlane2017-05-17
|\ | | | | Move anyLineNewline to Parsing.hs
| * Move anyLineNewline to Parsing.hsAlexander Krotov2017-05-17
| |
* | Org reader: replace `sequence . map` with `mapM`Albert Krewinkel2017-05-16
| |
* | Org reader: put tree parsing code into dedicated moduleAlbert Krewinkel2017-05-16
| |
* | Org reader: add basic file inclusion mechanismAlbert Krewinkel2017-05-14
|/ | | | | | | | | Support for the `#+INCLUDE:` file inclusion mechanism was added. Recognized include types are *example*, *export*, *src*, and normal org file inclusion. Advanced features like line numbers and level selection are not implemented yet. Closes: #3510
* Update dates in copyright noticesAlbert Krewinkel2017-05-13
| | | | | This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
* Replace `repeat' and `take' with `replicate' once moreAlexander Krotov2017-05-12
|
* Drop redundant import of sortAlbert Krewinkel2017-05-06
| | | | This was left in accidentally.
* Org reader: support macrosAlbert Krewinkel2017-05-06
| | | | Closes: #3401
* Org reader: support table.el tablesAlbert Krewinkel2017-05-03
| | | | Closes #3314
* Provide shared F monad functions for Markdown and Org readersAlbert Krewinkel2017-04-30
| | | | | | The `F` monads used for delayed evaluation of certain values in the Markdown and Org readers are based on a shared data type capturing the common pattern of both `F` types.
* Add returnF to Text.Pandoc.ParsingAlexander Krotov2017-04-30
|
* Org reader: Avoid creating nullMeta by applying setMeta directlyAlexander Krotov2017-04-30
|
* Org reader: allow multi-word arguments to src block paramsAlbert Krewinkel2017-04-23
| | | | | | | The reader now correctly parses src block parameter list even if parameter arguments contain multiple words. Closes: #3477
* Org reader: stop adding rundoc prefix to src paramsAlbert Krewinkel2017-04-23
| | | | | | | | | | | Source block parameter names are no longer prefixed with *rundoc*. This was intended to simplify working with the rundoc project, a babel runner. However, the rundoc project is unmaintained, and adding those markers is not the reader's job anyway. The original language that is specified for a source element is now retained as the `data-org-language` attribute and only added if it differs from the translated language.
* Org reader: handle line numbering switch for src blocksAlbert Krewinkel2017-04-23
| | | | | | | The line-numbering switch that can be given to source blocks (`-n` with an start number as an optional parameter) is parsed and translated to a class/key-value combination used by highlighting and other readers and writers.
* Org reader: allow emphasized text to be followed by `[`Albert Krewinkel2017-04-16
| | | | Closes: #3577
* Org reader: convert markup at beginning of footnotesAlbert Krewinkel2017-04-16
| | | | Closes: #3576
* s/safed/saved/Alexander Krotov2017-04-14
|
* Org reader: interpret more meta value as inlinesAlbert Krewinkel2017-03-12
| | | | | | | | | | The values of the following meta variables are now interpreted using org-markup instead of treating them as pure strings: - *keywords*: comma-separated list of inlines - *subtitle*: inline values - *nocite*: inline values; using it multiple times accumulates the values.
* Issue warning for duplicate header identifiers.John MacFarlane2017-03-12
| | | | | | | | | | | | | | | As noted in the previous commit, an autogenerated identifier may still coincide with an explicit identifier that is given for a header later in the document, or with an identifier on a div, span, link, or image. This commit adds a warning in this case, so users can supply an explicit identifier. * Added `DuplicateIdentifier` to LogMessage. * Modified HTML, Org, MediaWiki readers so their custom state type is an instance of HasLogMessages. This is necessary for `registerHeader` to issue warnings. See #1745.
* Org reader: disallow tables on list marker linesAlbert Krewinkel2017-03-08
| | | | Fixes: #3499
* Org reader: don't allow tables inside list items.John MacFarlane2017-03-08
| | | | Closes #3499.
* Stylish-haskell automatic formatting changes.John MacFarlane2017-03-04
|
* Removed --parse-raw and readerParseRaw.John MacFarlane2017-02-06
| | | | | | | | | | | | | | | | | | | | | | | These were confusing. Now we rely on the +raw_tex or +raw_html extension with latex or html input. Thus, instead of --parse-raw -f latex we use -f latex+raw_tex and instead of --parse-raw -f html we use -f html+raw_html
* Shared: rename compactify', compactify'DL -> compactify, compactifyDL.John MacFarlane2017-01-27
|
* Cleanups for rebase.John MacFarlane2017-01-25
|
* Removed readerSmart and the --smart option; added Ext_smart extension.John MacFarlane2017-01-25
| | | | | | | | | | | | | | | | | Now you will need to do -f markdown+smart instead of -f markdown --smart This change opens the way for writers, in addition to readers, to be sensitive to +smart, but this change hasn't yet been made. API change. Command-line option change. Updated manual.
* Working on readers.Jesse Rosenthal2017-01-25
|
* Org reader: allow short hand for single-line raw blocksAlbert Krewinkel2017-01-19
| | | | | | | Single-line raw blocks can be given via `#+FORMAT: raw line`, where `FORMAT` must be one of `latex`, `beamer`, `html`, or `texinfo`. Closes: #3366
* Remove pipe char irking the haddock coverage toolAlbert Krewinkel2017-01-06
| | | | | | Haddock documentation strings must be associated with functions. Remove pipe char from a comment that was moved into a `do` block in `Readers/Org/Inlines.hs`.
* Org reader: accept org-ref citations followed by commasAlbert Krewinkel2017-01-06
| | | | | Bugfix for an issue which, whenever the citation was immediately followed by a comma, prevented correct parsing of org-ref citations.
* Org reader: ensure emphasis markup can be nestedAlbert Krewinkel2017-01-05
| | | | | Nested emphasis markup (e.g. `/*strong and emphasized*/`) was interpreted incorrectly in that the inner markup was not recognized.
* Org reader: respect column width settingsAlbert Krewinkel2016-11-24
| | | | | | | | | | | | | Table column properties can optionally specify a column's width with which it is displayed in the buffer. Some exporters, notably the ODT exporter in org-mode v9.0, use these values to calculate relative column widths. The org reader now implements the same behavior. Note that the org-mode LaTeX and HTML exporters in Emacs don't support this feature yet, which should be kept in mind by users who use the column widths parameters. Closes: #3246
* Un-break Travis buildAlbert Krewinkel2016-11-19
| | | | | | Remove whitespace before function documentation The extra spaced cause problems with documentation tools and Travis tests are failing because of this.
* Org reader: Ensure images in paragraphs are not parsed as figuresAlbert Krewinkel2016-11-19
| | | | | This fixes a regression introduced in 7e5220b57c5a48fabe6e43ba270db812593d3463.