summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/Templates.hs
Commit message (Collapse)AuthorAge
* 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
|
* Revert "Removed blaze_html_05 flag -- require blaze >= 0.5 by default."John MacFarlane2012-05-10
| | | | This reverts commit f67a80cea27286ba17b3696198602a6bbdae014d.
* Removed blaze_html_05 flag -- require blaze >= 0.5 by default.John MacFarlane2012-04-24
|
* changes for blaze-html 0.5Mark Wright2012-04-23
|
* Added default.beamer template (separate from default.latex).John MacFarlane2012-01-30
|
* Made `beamer` an output format, removed `pdf` as output format.John MacFarlane2012-01-28
| | | | | | | | | | | Removed `--beamer` option; instead, use `beamer` as output format. There is no longer a `pdf` output format; instead, pandoc tries to produce a pdf if the output file has a `.pdf` extension. (The output format can be latex -- the default for pdf output, latex+lhs, or beamer.) This seems more consistent with the way pandoc currently works (e.g. we have an `html5` output format, not an `--html5` option).
* Removed `beamer` output format; added `--beamer` option.John MacFarlane2012-01-21
|
* pandoc: Output to pdf now works.John MacFarlane2012-01-20
|
* Templates: Removed vestigial remnant of openxml template.John MacFarlane2012-01-19
| | | | Closes #381 (I think).
* Added Docx writer.John MacFarlane2012-01-19
| | | | | | | | | | | * New module `Text.Pandoc.Docx`. * New output format `docx`. * Added reference.docx. * New option `--reference-docx`. The writer includes support for highlighted code blocks and math (which is converted from TeX to OMML using texmath's new OMML module).
* Split html template into html, html5 templates.John MacFarlane2012-01-11
|
* Templates: Tell pandoc where to find default "html5" template.John MacFarlane2012-01-08
|