summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Templates.hs
Commit message (Collapse)AuthorAge
* Update copyright notices to include 2018Albert Krewinkel2018-01-05
|
* Don't look for default template file for Powerpoint.Jesse Rosenthal2017-12-21
| | | | | | | When using readerStandalone, this keeps us from looking for a non-existent template pptx file. Closes #4181
* Source code reformatting.John MacFarlane2017-10-29
|
* hlint suggestions.John MacFarlane2017-10-27
|
* Automatic reformating by stylish-haskell.John MacFarlane2017-10-27
|
* Removed old beamer template.John MacFarlane2017-09-08
| | | | | | | We now use the default.latex template for both latex and beamer. It contains conditionals for the beamer-specific things. `pandoc -D beamer` will return this template.
* Added support for translations (localization) (see #3559).John MacFarlane2017-08-11
| | | | | | | | | | | | | | | | | | | | | | | | | | * readDataFile, readDefaultDataFile, getReferenceDocx, getReferenceODT have been removed from Shared and moved into Class. They are now defined in terms of PandocMonad primitives, rather than being primitve methods of the class. * toLang has been moved from BCP47 to Class. * NoTranslation and CouldNotLoudTranslations have been added to LogMessage. * New module, Text.Pandoc.Translations, exporting Term, Translations, readTranslations. * New functions in Class: translateTerm, setTranslations. Note that nothing is loaded from data files until translateTerm is used; setTranslation just sets the language to be used. * Added two translation data files in data/translations. * LaTeX reader: Support `\setmainlanguage` or `\setdefaultlanguage` (polyglossia) and `\figurename`.
* Removed datadir param from readDataFile and getDefaultTemplate.John MacFarlane2017-08-10
| | | | | In Text.Pandoc.Class and Text.Pandoc.Template, resp. We now get the datadir from CommonState.
* Templates: Have gfm use commonmark template.John MacFarlane2017-08-08
|
* Templates: change signature of getDefaultTemplate.John MacFarlane2017-07-19
| | | | | Now it runs in any instance of PandocMonad, and returns a String rather than an Either value.
* Text.Pandoc.Templates: change type of renderTemplate'.John MacFarlane2017-06-20
| | | | | | Now it runs in PandocMonad and raises a proper PandocTemplateError if there are problems, rather than failing with uncatchable 'error'.
* 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>
* Text.Pandoc.App: Throw errors rather than exiting.John MacFarlane2017-04-02
| | | | | | | | | | | | | | | | | These are caught (and lead to exit) in pandoc.hs, but other uses of Text.Pandoc.App may want to recover in another way. Added PandocAppError to PandocError (API change). This is a stopgap: later we should have a separate constructor for each type of error. Also fixed uses of 'exit' in Shared.readDataFile, and removed 'err' from Shared (API change). Finally, removed the dependency on extensible-exceptions. See #3548.
* Stylish-haskell automatic formatting changes.John MacFarlane2017-03-04
|
* Make epub an alias for epub3, not epub2.John MacFarlane2017-01-30
|
* Split writeDocbook into writeDocbook4, writeDocbook5.John MacFarlane2017-01-26
| | | | | | | Removed writerDocbookVersion in WriterOptions. Renamed default.docbook template to default.docbook4. Allow docbook4 as an output format. But alias docbook = docbook4.
* EPUB writer: split writeEPUB into writeEPUB2, writeEPUB3.John MacFarlane2017-01-26
| | | | Also include explicit epub2 output format in CLI tool.
* Provide explicit separate functions for HTML 4 and 5.John MacFarlane2017-01-25
| | | | | | | | | * Text.Pandoc.Writers.HTML: removed writeHtml, writeHtmlString, added writeHtml4, writeHtml4String, writeHtml5, writeHtml5String. * Removed writerHtml5 from WriterOptions. * Renamed default.html template to default.html4. * "html" now aliases to "html5"; to get the old HTML4 behavior, you must now specify "-t html4".
* Moved template compiling/rendering code to a separate library.John MacFarlane2016-10-02
| | | | | | jgm/doctemplates. This allows the pandoc templating system to be used independently.
* Remove blaze-html CPP conditional.Jesse Rosenthal2016-09-03
| | | | | | | | This tests for a min value >= 0.5. But we have a lower bound of 0.5 in pandoc.cabal, so the test will always pass. (If we bump the lower bound to 0.5.1, we can remove a conditional in the HTML writer as well.)
* Remove Compat.MonoidJesse Rosenthal2016-09-02
| | | | | This was only necessary for GHC versions with base below 4.5 (i.e., ghc < 7.4).
* Updated copyright dates to include 2016.John MacFarlane2016-03-22
|
* Restored Text.Pandoc.Compat.Monoid.John MacFarlane2015-11-09
| | | | | | | | | | | | | | Don't use custom prelude for latest ghc. This is a better approach to making 'stack ghci' and 'cabal repl' work. Instead of using NoImplicitPrelude, we only use the custom prelude for older ghc versions. The custom prelude presents a uniform API that matches the current base version's prelude. So, when developing (presumably with latest ghc), we don't use a custom prelude at all and hence have no trouble with ghci. The custom prelude no longer exports (<>): we now want to match the base 4.8 prelude behavior.
* Revert "Use -XNoImplicitPrelude and 'import Prelude' explicitly."John MacFarlane2015-11-09
| | | | This reverts commit c423dbb5a34c2d1195020e0f0ca3aae883d0749b.
* Use -XNoImplicitPrelude and 'import Prelude' explicitly.John MacFarlane2015-11-08
| | | | | | | This is needed for ghci to work with pandoc, given that we now use a custom prelude. Closes #2503.
* Use custom Prelude to avoid compiler warnings.John MacFarlane2015-10-14
| | | | | | | | | | | | | - The (non-exported) prelude is in prelude/Prelude.hs. - It exports Monoid and Applicative, like base 4.8 prelude, but works with older base versions. - It exports (<>) for mappend. - It hides 'catch' on older base versions. This allows us to remove many imports of Data.Monoid and Control.Applicative, and remove Text.Pandoc.Compat.Monoid. It should allow us to use -Wall again for ghc 7.10.
* Updated copyright notices to -2015. Closes #2111.John MacFarlane2015-04-26
|
* ghc 7.10.1 RC1 requires specifying the type of String literals ↵Mark Wright2015-01-05
| | | | https://ghc.haskell.org/trac/ghc/wiki/Migration/7.10#GHCsaysNoinstanceforFoldable...arisingfromtheuseof...
* getDefaultTemplate: don't fail when called with "fb2".John MacFarlane2014-12-15
| | | | Closes #1660.
* Templates: use ordNum instead of ord.John MacFarlane2014-06-03
| | | | Closes #1022.
* Templates: Fail informatively on template syntax errors.John MacFarlane2014-06-01
| | | | | | | With the move from parsec to attoparsec, we lost good error reporting. In fact, since we weren't testing for end of input, malformed templates would fail silently. Here we revert back to Parsec for better error messages.
* Update copyright notices for 2014, add missing noticesAlbert Krewinkel2014-05-09
|
* Templates: YAML objects resolve to "true" in conditionals.John MacFarlane2014-03-05
| | | | | | | | Closes #1133. Note: If address is a YAML object and you just have $address$ in your template, the word "true" will appear, which may be unexpected. (Previously nothing would appear.)
* Templates: Changed how array variables are resolved.John MacFarlane2013-10-21
| | | | | | | | | | | | | Previously if `foo` is an array (which might be because multiple values were set on the command line), `$foo$` would resolve to the concatenation of the elements of foo. This is rarely useful behavior. It has been changed so that the first value is rendered. Of course, you can still iterate over the values using `$for(foo)$`. This has the result that you can override earlier settings using -V by putting new values later on the command line. That's useful for many purposes.
* Templates: more consistent behavior of `$for$`.John MacFarlane2013-09-08
| | | | | | | | When `foo` is not a list, `$for(foo)$...$endfor$` should behave like $if(foo)$...$endif$. So if `foo` resolves to "", no output should be produced. See pandoc-templates#39.
* Added Text.Pandoc.Compat.Monoid.John MacFarlane2013-08-08
| | | | | This allows pandoc to compile with base < 4.5, where Data.Monoid doesn't export `<>`. Thanks to Dirk Ullirch for the patch.
* Fixed bug retrieving default template for markdown variants.John MacFarlane2013-07-02
|
* Use new flexible metadata type.John MacFarlane2013-06-24
| | | | | | | | | | | | | | | | | | | | | | | | | * Depend on pandoc 1.12. * Added yaml dependency. * `Text.Pandoc.XML`: Removed `stripTags`. (API change.) * `Text.Pandoc.Shared`: Added `metaToJSON`. This will be used in writers to create a JSON object for use in the templates from the pandoc metadata. * Revised readers and writers to use the new Meta type. * `Text.Pandoc.Options`: Added `Ext_yaml_title_block`. * Markdown reader: Added support for YAML metadata block. Note that it must come at the beginning of the document. * `Text.Pandoc.Parsing.ParserState`: Replace `stateTitle`, `stateAuthors`, `stateDate` with `stateMeta`. * RST reader: Improved metadata. Treat initial field list as metadata when standalone specified. Previously ALL fields "title", "author", "date" in field lists were treated as metadata, even if not at the beginning. Use `subtitle` metadata field for subtitle. * `Text.Pandoc.Templates`: Export `renderTemplate'` that takes a string instead of a compiled template.. * OPML template: Use 'for' loop for authors. * Org template: '#+TITLE:' is inserted before the title. Previously the writer did this.
* Revised Text.Pandoc.Templates to accept JSON contexts.John MacFarlane2013-06-24
| | | | | | | | | | | | Currently the library is set up with a shim for association lists, for compatibility, but this can change when the writers are changed. New export: `varListToJSON`. Removed `Empty`. Simplified template type to a newtype.
* Data files changes.John MacFarlane2012-12-29
| | | | | | | | | | * Added `embed_data_files` flag. (not yet used) * Shared no longer exports `findDataFile`. * `readDataFile` now returns a strict bytestring. * Shared now exports `readDataFileUTF8` which returns a string like the old `readDataFile`. * Rewrote modules to use new data file functions and to avoid using functions from Paths_pandoc directly.
* EPUB writer: Rationalized templates.John MacFarlane2012-11-04
| | | | | | | | * Previously there were three different templates involved in epub production. There is now just one template, default.epub or default.epub3. * It can now be overridden using `--template`, just like other templates.
* Preliminary changes for epub3 format.John MacFarlane2012-11-02
| | | | | | * EPUB writer now exports writeEPUB2 and writeEPUB3. * 'epub' output format is epub v2, while 'epub3' is v3.
* Removed need for utf8-string package.John MacFarlane2012-09-25
| | | | | | | | * Depend on text. * Expose Text.Pandoc.UTF8. * Text.Pandoc.UTF8 now exports toString, fromString, toStringLazy, fromStringLazy. * These are used instead of the old utf8-string functions.
* Changed strict to markdown_strict.John MacFarlane2012-08-09
|
* Removed `--strict`, added extensions to writer/reader names.John MacFarlane2012-08-09
| | | | | | | | | | | | * The `--strict` option has been removed. * Instead of using `--strict`, one can now use `strict` instead of `markdown` as an input or output format name. * The `--enable` and `--disable` optinos have been removed. * It is now possible to enable or disable specific extensions by appending them (with '+' or '-') to the writer or reader name. For example `pandoc -f markdown-footnotes+hard_line_breaks`. * The lhs extensions are now implemented this way, too; you can use either `+lhs` or `+literate_haskell`.
* Fixed whitespace errors.John MacFarlane2012-07-26
|
* Use Parsec directly in Biblio and Templates.John MacFarlane2012-07-20
|
* Use Parser as type synonym for Parsec.John MacFarlane2012-07-20
|
* Text.Pandoc.Parsing: Export all Parsec functions used in pandoc code.John MacFarlane2012-07-20
| | | | | No other module directly imports Parsec. This will make it easier to change the parsing backend in the future, if we want to.
* Use Text.Parsec instead of Text.ParserCombinators.Parsec.John MacFarlane2012-07-20
|