summaryrefslogtreecommitdiff
path: root/src/Text/Pandoc/SelfContained.hs
Commit message (Collapse)AuthorAge
* SelfContained: export makeDataURIJohn MacFarlane2017-03-30
|
* Stylish-haskell automatic formatting changes.John MacFarlane2017-03-04
|
* `--self-contained`: don't incorporate elements with `data-external="1"`.John MacFarlane2017-02-26
| | | | | | | | | You can leave an external link as it is by adding the attribute data-external="1" to the element. Pandoc will then not try to incorporate its content when `--self-contained` is used. This is similar to a feature already supported by the EPUB writer. Closes #2656.
* Some fixes to the preceding revisions in SelfContained.John MacFarlane2017-02-24
| | | | Make sure we don't duplicate end tags for script or link.
* SelfContained: don't use data URIs for script or style.John MacFarlane2017-02-24
| | | | | | | | | | | | | | Instead, just use script or style tags with the content inside. The old method with data URIs prevents certain optimizations outside pandoc. Exception: data URIs are still used when a script contains `</script>` or a style contains `</`. Closes #3423. Also, in MIME, use application/javascript (not application/x-javascript).
* Refactored getData from getDataURI in SelfContained.John MacFarlane2017-02-24
|
* Put makeSelfContained in PandocMonad instead of IO.John MacFarlane2017-02-23
| | | | | | This removes the need to pass MediaBag around and improves exceptions. It also opens up the possibility of using makeSelfContained purely.
* Use lazy loading for reveal.js slide shows.John MacFarlane2017-02-20
| | | | | | | | * In HTML writer, with reveal.js we use data-src instead of src for images. * In SelfContained, we also load resources from data-src. Closes #2283.
* Removed writerMediaBag from WriterOpts.John MacFarlane2017-01-25
| | | | | | ...since this is now handled through PandocMonad. Added an explicit MediaBag parameter to makePDF and makeSelfContained.
* Text.Pandoc.Shared: Removed fetchItem, fetchItem'.John MacFarlane2017-01-25
| | | | | Made changes where these are used, so that the version of fetchItem from PandocMonad can be used instead.
* SelfContained: put makeSelfContained in MonadIO.John MacFarlane2017-01-25
|
* Updated copyright dates to include 2016.John MacFarlane2016-03-22
|
* 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.
* Fixed omitted `url(...)` in CSS data-uri with `--self-contained`.John MacFarlane2015-10-28
| | | | Fixes #2489.
* 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.
* `--self-contained`: Fixed overaggressive CSS minimization.John MacFarlane2015-07-15
| | | | | | | | Previously `--self-contained` wiped out all spaces in CSS, including semantically significant spaces! Closes #2301. Closes #2286.
* Fixed regression in CSS parsing with `--self-contained`.John MacFarlane2015-06-28
| | | | | | | | | | | | | | In 1b44acf0c59b70cc63f48a23c6f77e45a982aaf9 we replaced some hackish CSS parsing with css-text, which I thought was a complete CSS parser. It turns out that it is very buggy, which results in lots of things being silently dropped from CSS when `--self-contained` is used (#2224). This commit replaces the use of css-text with a small but more principled css preprocessor, which only removes whitespace and replaces URLs with base 64 data when possible. Closes #2224.
* SelfContained: properly handle data URIs in css urls.John MacFarlane2015-05-04
| | | | | | Also use a proper css parser (adds dependency on text-css). Closes #2129.
* SelfContained: cssURLs no longer tries to fetch fragment URLs.John MacFarlane2015-05-01
| | | | | The current test is: does the URL start with a `#`? Closes #2121.
* Updated copyright notices to -2015. Closes #2111.John MacFarlane2015-04-26
|
* Improved building of data URIs in SelfContained.John MacFarlane2015-02-13
| | | | Now base64 is used except for 'text/*' mime types. Closes #1940.
* SelfContained: Add `;charset=utf-8` to script mime type if missing.John MacFarlane2014-12-31
| | | | Closes #1842.
* Added `track` to list of tags treated by `--self-contained`.John MacFarlane2014-10-04
| | | | Closes #1664.
* MIME cleanup.Artyom Kazak2014-08-17
| | | | | | | * Create a type synonym for MIME type (instead of `String`). * Add `getMimeTypeDef` function. * Avoid recreating MIME type `Map`s every time. * Move “Formula-...” case handling into `getMimeType`.
* SelfContained: Fixed determining of source URL from within CSS files.John MacFarlane2014-08-02
| | | | (This fixes a bug introduced a couple commits back.)
* Text.Pandoc.SelfContained changes.John MacFarlane2014-08-02
| | | | | | | | * mkSelfContained now takes just two arguments, WriterOptions and the string. * It no longer looks in data files. This only made sense when we had copies of slidy and S5 code there. * Shared.fetchItem' is used instead of the nearly duplicate getItem.
* New module, Text.Pandoc.MediaBag.John MacFarlane2014-07-31
| | | | | | | Moved `MediaBag` definition and functions from Shared: `lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`. Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag` is a Monoid.
* Made MediaBag a newtype, and added mime type information to media.John MacFarlane2014-07-31
| | | | | | | | | | Shared now exports functions for interacting with a MediaBag: - `emptyMediaBag` - `lookuMedia` - `insertMedia` - `mediaDirectory` - `extractMediaBag`
* Allow --self-contained to get content from MediaBag.John MacFarlane2014-07-30
| | | | Added a parameter to makeSelfContained (API change).
* Update copyright notices for 2014, add missing noticesAlbert Krewinkel2014-05-09
|
* SelfContained: Handle "poster" attribute in "video" tags.John MacFarlane2014-03-05
| | | | Closes #1188.
* Use isURI instead of isAbsoluteURI.John MacFarlane2013-10-16
| | | | It allows fragments identifiers.
* Improved fetching of external resources.John MacFarlane2013-07-18
| | | | | | | | | * In Shared, openURL and fetchItem now return an Either, for better error handling. (API change.) * Better error message when fetching a URL fails with `--self-contained`. * EPUB writer: If resource not found, skip it, as in Docx writer. * Closes #916.
* Added comment/todo to SelfContained.John MacFarlane2013-04-10
|
* SelfContained: handle src in embed, audio, source, input tags.John MacFarlane2013-03-26
|
* SelfContained: strip off fragment, query of relative URLJohn MacFarlane2013-03-25
| | | | | | | | | | | | | | | before treating as a filename. This fixes `--self-contained` when used with CSS files that include web fonts using the method described here: http://paulirish.com/2009/bulletproof-font-face-implementation-syntax/ Examples from reveal.js themes: "../../lib/font/league_gothic-webfont.eot?#iefix" "../../lib/font/league_gothic-webfont.svg#LeagueGothicRegular" Closes #739.
* Refactoring:John MacFarlane2013-01-11
| | | | | | | * Shared now exports fetchItem (instead of getItem) and openURL * fetchItem has different parameters than getItem and includes some logic formerly in the ODT and Docx writers * getItem still used in SelfContained
* Move getItem from SelfContained to Share; export getItem.John MacFarlane2013-01-11
|
* 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.
* 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.
* Moved renderTags' from HTML reader & SelfContained to Shared.John MacFarlane2012-08-15
| | | | Improved removal of markdown="1" attribute in Markdow reader.
* Fixed whitespace errors.John MacFarlane2012-07-26
|
* SelfContained: Fix handling of absolute URLs in css imports.John MacFarlane2012-06-28
| | | | | | Also allow single-quoted values. Closes #535.
* Don't escape `<` in `<style>` tags with `--self-contained`.John MacFarlane2012-02-17
| | | | Closes #422: highlighting lost using `--self-contained`.
* SelfContained: Use getMimeType from Text.Pandoc.MIME.John MacFarlane2012-01-14
|
* SelfContained: Get mime type from HTTP request if possible.John MacFarlane2011-12-04
| | | | --webtex --self-contained now works.
* SelfContained: Convert all url()s in css to data: uris.John MacFarlane2011-12-04
|
* --self-contained now works with `<video>` as well as `<img>`.John MacFarlane2011-11-24
|
* Changed Offline module to SelfContained, offline to makeSelfContained.John MacFarlane2011-11-21