summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Readers/Org
Commit message (Collapse)AuthorAge
* Org reader: allow changing emphasis syntaxAlbert Krewinkel2018-02-21
| | | | | | | | | | | | | | | | The characters allowed before and after emphasis can be configured via `#+pandoc-emphasis-pre` and `#+pandoc-emphasis-post`, respectively. This allows to change which strings are recognized as emphasized text on a per-document or even per-paragraph basis. The allowed characters must be given as (Haskell) string. #+pandoc-emphasis-pre: "-\t ('\"{" #+pandoc-emphasis-post: "-\t\n .,:!?;'\")}[" If the argument cannot be read as a string, the default value is restored. Closes: #4378
* hlint code improvements.John MacFarlane2018-01-19
|
* Update copyright notices to include 2018Albert Krewinkel2018-01-05
|
* Org reader: support minlevel option for includesAlbert Krewinkel2017-12-28
| | | | | | | | | The level of headers in included files can be shifted to a higher level by specifying a minimum header level via the `:minlevel` parameter. E.g. `#+include: "tour.org" :minlevel 1` will shift the headers in tour.org such that the topmost headers become level 1 headers. Fixes: #4154
* Org reader: fix asterisks-related parsing errorAlbert Krewinkel2017-12-20
| | | | | | A parsing error was fixed which caused the org reader to fail when parsing a paragraph starting with two or more asterisks. Fixes: #4180
* Org reader: allow empty list itemsAlbert Krewinkel2017-11-22
| | | | Fixes: #4090
* Automatic reformating by stylish-haskell.John MacFarlane2017-10-27
|
* Consistent underline for Readers (#2270)hftf2017-10-27
| | | | | | | | | | | | | | * Added underlineSpan builder function. This can be easily updated if needed. The purpose is for Readers to transform underlines consistently. * Docx Reader: Use underlineSpan and update test * Org Reader: Use underlineSpan and add test * Textile Reader: Use underlineSpan and add test case * Txt2Tags Reader: Use underlineSpan and update test * HTML Reader: Use underlineSpan and add test case
* Org reader: end footnotes after two blank linesAlbert Krewinkel2017-10-08
| | | | | Footnotes can not only be terminated by the start of a new footnote or a header, but also by two consecutive blank lines.
* Org reader: support `\n` export optionAlbert Krewinkel2017-10-02
| | | | | | | The `\n` export option turns all newlines in the text into hard linebreaks. Closes #3950
* Org reader: update emphasis border charsAlbert Krewinkel2017-09-25
| | | | | | | | | | The org reader was updated to match current org-mode behavior: the set of characters which are acceptable to occur as the first or last character in an org emphasis have been changed and now allows all non-whitespace chars at the inner border of emphasized text (see `org-emphasis-regexp-components`). Fixes: #3933
* 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