aboutsummaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Writers/Org.hs
AgeCommit message (Collapse)AuthorFilesLines
2020-11-18Replace org #+KEYWORDS with #+keywordsTEC1-16/+16
As of ~2 years ago, lower case keywords became the standard (though they are handled case insensitive, as always): https://code.orgmode.org/bzg/org-mode/commit/13424336a6f30c50952d291e7a82906c1210daf0 Upper case keywords are exclusive to the manual: - https://orgmode.org/list/871s50zn6p.fsf@nicolasgoaziou.fr/ - https://orgmode.org/list/87tuuw3n15.fsf@nicolasgoaziou.fr/
2020-11-18Update org supported languages and identifiersTEC1-7/+11
according to the current list contained in https://orgmode.org/worg/org-contrib/babel/languages/index.html
2020-07-31Org writer: don't force blank line after headersAlbert Krewinkel1-1/+1
Closes: #6554
2020-05-17Org writer: clean-up Div handlingAlbert Krewinkel1-30/+59
2020-04-28Support new Underline element in readers and writers (#6277)Vaibhav Sagar1-0/+3
Deprecate `underlineSpan` in Shared in favor of `Text.Pandoc.Builder.underline`.
2020-04-15Adapt to the newest Table type, fix some previous adaptation issuesdespresc1-1/+1
- Writers.Native is now adapted to the new Table type. - Inline captions should now be conditionally wrapped in a Plain, not a Para block. - The toLegacyTable function now lives in Writers.Shared.
2020-04-15Implement the new Table typedespresc1-1/+2
2020-03-22Finer grained imports of Text.Pandoc.Class submodules (#6203)Albert Krewinkel1-1/+1
This should speed-up recompilation after changes in `Text.Pandoc.Class`, as the number of modules affected by a change will be smaller in general. It also offers faster insights into the parts of `T.P.Class` used within a module.
2020-03-15Use implicit Prelude (#6187)Albert Krewinkel1-2/+0
* Use implicit Prelude The previous behavior was introduced as a fix for #4464. It seems that this change alone did not fix the issue, and `stack ghci` and `cabal repl` only work with GHC 8.4.1 or newer, as no custom Prelude is loaded for these versions. Given this, it seems cleaner to revert to the implicit Prelude. * PandocMonad: remove outdated check for base version Only base versions 4.9 and later are supported, the check for `MIN_VERSION_base(4,8,0)` is therefore unnecessary. * Always use custom prelude Previously, the custom prelude was used only with older GHC versions, as a workaround for problems with ghci. The ghci problems are resolved by replacing package `base` with `base-noprelude`, allowing for consistent use of the custom prelude across all GHC versions.
2020-03-13Update copyright year (#6186)Albert Krewinkel1-2/+2
* Update copyright year * Copyright: add notes for Lua and Jira modules
2020-02-07Resolve HLint warningsAlbert Krewinkel1-1/+1
All warnings are either fixed or, if more appropriate, HLint is configured to ignore them. HLint suggestions remain. * Ignore "Use camelCase" warnings in Lua and legacy code * Fix or ignore remaining HLint warnings * Remove redundant brackets * Remove redundant `return`s * Remove redundant as-pattern * Fuse mapM_/map * Use `.` to shorten code * Remove redundant `fmap` * Remove unused LANGUAGE pragmas * Hoist `not` in Text.Pandoc.App * Use fewer imports for `Text.DocTemplates` * Remove redundant `do`s * Remove redundant `$`s * Jira reader: remove unnecessary parentheses
2020-01-03Org writer: remove extra spaces from table cellsAlbert Krewinkel1-1/+1
Closes: #6024
2019-11-12Switch to new pandoc-types and use Text instead of String [API change].despresc1-66/+67
PR #5884. + Use pandoc-types 1.20 and texmath 0.12. + Text is now used instead of String, with a few exceptions. + In the MediaBag module, some of the types using Strings were switched to use FilePath instead (not Text). + In the Parsing module, new parsers `manyChar`, `many1Char`, `manyTillChar`, `many1TillChar`, `many1Till`, `manyUntil`, `mantyUntilChar` have been added: these are like their unsuffixed counterparts but pack some or all of their output. + `glob` in Text.Pandoc.Class still takes String since it seems to be intended as an interface to Glob, which uses strings. It seems to be used only once in the package, in the EPUB writer, so that is not hard to change.
2019-08-25Use new doctemplates, doclayout.John MacFarlane1-29/+40
+ Remove Text.Pandoc.Pretty; use doclayout instead. [API change] + Text.Pandoc.Writers.Shared: remove metaToJSON, metaToJSON' [API change]. + Text.Pandoc.Writers.Shared: modify `addVariablesToContext`, `defField`, `setField`, `getField`, `resetField` to work with Context rather than JSON values. [API change] + Text.Pandoc.Writers.Shared: export new function `endsWithPlain` [API change]. + Use new templates and doclayout in writers. + Use Doc-based templates in all writers. + Adjust three tests for minor template rendering differences. + Added indentation to body in docbook4, docbook5 templates. The main impact of this change is better reflowing of content interpolated into templates. Previously, interpolated variables were rendered independently and intepolated as strings, which could lead to overly long lines. Now the templates interpolated as Doc values which may include breaking spaces, and reflowing occurs after template interpolation rather than before.
2019-07-28Use doctemplates 0.3, change type of writerTemplate.John MacFarlane1-4/+5
* Require recent doctemplates. It is more flexible and supports partials. * Changed type of writerTemplate to Maybe Template instead of Maybe String. * Remove code from the LaTeX, Docbook, and JATS writers that looked in the template for strings to determine whether it is a book or an article, or whether csquotes is used. This was always kludgy and unreliable. To use csquotes for LaTeX, set `csquotes` in your variables or metadata. It is no longer sufficient to put `\usepackage{csquotes}` in your template or header includes. To specify a book style, use the `documentclass` variable or `--top-level-division`. * Change template code to use new API for doctemplates.
2019-05-12Org writer: always indent src blocks content by 2 spacesAlbert Krewinkel1-3/+1
Emacs always uses two spaces when indenting the content of src blocks, e.g., when exiting a `C-c '` edit-buffer. Pandoc used to indent contents by the space-equivalent of one tab, but now always uses two spaces, too. Closes: #5440
2019-03-01Remove license boilerplate.John MacFarlane1-20/+0
The haddock module header contains essentially the same information, so the boilerplate is redundant and just one more thing to get out of sync.
2019-02-04Add missing copyright notices and remove license boilerplate (#5112)Albert Krewinkel1-4/+4
Quite a few modules were missing copyright notices. This commit adds copyright notices everywhere via haddock module headers. The old license boilerplate comment is redundant with this and has been removed. Update copyright years to 2019. Closes #4592.
2018-12-28Org writer: preserve line-numbering for example and code blocks.leungbk1-3/+9
2018-09-09Org writer: don't escape literal `_`, `^`.John MacFarlane1-1/+1
Org doesn't recognize these escapes. Closes #4882.
2018-07-02Spellcheck commentsAlexander Krotov1-1/+1
2018-03-18Use NoImplicitPrelude and explicitly import Prelude.John MacFarlane1-0/+2
This seems to be necessary if we are to use our custom Prelude with ghci. Closes #4464.
2018-03-02Org writer: fix a typo s/prettyfy/prettify/Alexander Krotov1-2/+2
2018-01-05Update copyright notices to include 2018Albert Krewinkel1-4/+4
2017-12-21Org writer: do not wrap "-" to avoid accidental bullet listsAlexander Krotov1-7/+12
Also add TODO for ordered lists.
2017-12-19Fix for #4171 fix: don't wrap note references after SoftBreakAlexander Krotov1-0/+2
2017-12-18Org writer: don't allow fn refs to wrap to beginning of line.John MacFarlane1-1/+5
Otherwise they can be interpreted as footnote definitions. Closes #4171.
2017-11-04Revert "Better indentation under headers in org mode output."John MacFarlane1-26/+14
This reverts commit 1a81751cef330d875cc34f11cde4a0d478969db7.
2017-11-04Better indentation under headers in org mode output.John MacFarlane1-14/+26
See #4036. Close examination by org experts needed, to ensure that nothing breaks.
2017-10-27Automatic reformating by stylish-haskell.John MacFarlane1-2/+2
2017-09-01Org writer: stop using raw HTML to wrap divsAlbert Krewinkel1-37/+26
Div's are difficult to translate into org syntax, as there are multiple div-like structures (drawers, special blocks, greater blocks) which all have their advantages and disadvantages. Previously pandoc would use raw HTML to preserve the full div information; this was rarely useful and resulted in visual clutter. Div-rendering was changed to discard the div's classes and key-value pairs if there is no natural way to translate the div into an org structure. Closes: #3771
2017-06-20Writers: adjusted for renderTemplate' changes.John MacFarlane1-1/+1
Now we raise a proper error on template failure.
2017-06-17Use Control.Monad.State.Strict throughout.John MacFarlane1-1/+1
This gives 20-30% speedup and reduction of memory usage in most of the writers.
2017-06-11Switched Writer types to use Text.John MacFarlane1-4/+7
* XML.toEntities: changed type to Text -> Text. * Shared.tabFilter -- fixed so it strips out CRs as before. * Modified writers to take Text. * Updated tests, benchmarks, trypandoc. [API change] Closes #3731.
2017-06-03Improve code style in lua and org modulesAlbert Krewinkel1-16/+14
2017-05-13Update dates in copyright noticesAlbert Krewinkel1-3/+5
This follows the suggestions given by the FSF for GPL licensed software. <https://www.gnu.org/prep/maintain/html_node/Copyright-Notices.html>
2017-05-13Change maintainer line in Org writer moduleAlbert Krewinkel1-1/+1
2017-03-30Fix compiler warning.John MacFarlane1-1/+1
2017-03-30Org writer: move everything into PandocMonad.John MacFarlane1-23/+35
2017-03-04Stylish-haskell automatic formatting changes.John MacFarlane1-17/+17
2017-03-01Writers: Use gets to access MonadState where possible (#3480)Alexander Krotov1-5/+5
2017-02-12Do not strip # from Org anchor linksAlexander Krotov1-1/+1
Links with # are perfectly valid according to http://orgmode.org/manual/Internal-links.html#Internal-links
2017-02-04Org writer: reduce to two spaces after bulletsAlbert Krewinkel1-2/+2
The org writer was inserting two spaces after list bullets. Emacs Org-mode defaults to a single space, so behavior is changed to reflect this. Closes: #3417
2017-02-02Org.hs: remove misleading commentAlexander Krotov1-1/+0
This comment is likely copied from RST.hs where 'refs' variable indeed exists, but makes no sense here.
2017-02-01Reduce state in Org writer (#3404)Alexander Krotov1-8/+3
2017-01-25Revert "Added page breaks into Pandoc."John MacFarlane1-1/+0
This reverts commit f02a12aff638fa2339192231b8f601bffdfe3e14.
2017-01-25Convert all writers to use PandocMonad.Jesse Rosenthal1-2/+3
Since PandocMonad is an instance of MonadError, this will allow us, in a future commit, to change all invocations of `error` to `throwError`, which will be preferable for the pure versions. At the moment, we're disabling the lua custom writers (this is temporary). This requires changing the type of the Writer in Text.Pandoc. Right now, we run `runIOorExplode` in pandoc.hs, to make the conversion easier. We can switch it to the safer `runIO` in the future. Note that this required a change to Text.Pandoc.PDF as well. Since running an external program is necessarily IO, we can be clearer about using PandocIO.
2017-01-25Adds support for pagebreaks (when it makes sense)Hubert Plociniczak1-1/+2
Update all writers to take into account page breaks. A straightforwad, far from complete, implementation of page breaks in selected writers. Readers will have to follow in the future as well.
2016-12-21Org writer: prefix footnote numbers with `fn:`Albert Krewinkel1-2/+2
Unprefixed numbers where used by older org-mode versions, but are no longer supported.
2016-11-30Options: Removed writerStandalone, made writerTemplate a Maybe.John MacFarlane1-3/+3
Previously setting writerStandalone = True did nothing unless a template was provided in writerTemplate. Now a fragment will be generated if writerTemplate is Nothing; otherwise, the specified template will be used and standalone output generated. [API change]