Commit graph

28 commits

Author SHA1 Message Date
John MacFarlane
52310eb470 SelfContained: Add ;charset=utf-8 to script mime type if missing.
Closes #1842.
2014-12-31 14:51:23 -08:00
John MacFarlane
bf00556c72 Added track to list of tags treated by --self-contained.
Closes #1664.
2014-10-04 11:39:08 -07:00
Artyom Kazak
cca9e8feb4 MIME cleanup.
* 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`.
2014-08-17 21:00:50 +04:00
John MacFarlane
842c705097 SelfContained: Fixed determining of source URL from within CSS files.
(This fixes a bug introduced a couple commits back.)
2014-08-02 16:33:22 -07:00
John MacFarlane
ce8922437d Text.Pandoc.SelfContained changes.
* 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.
2014-08-02 16:07:19 -07:00
John MacFarlane
6dd2418476 New module, Text.Pandoc.MediaBag.
Moved `MediaBag` definition and functions from Shared:
`lookupMedia`, `mediaDirectory`, `insertMedia`, `extractMediaBag`.
Removed `emptyMediaBag`; use `mempty` instead, since `MediaBag`
is a Monoid.
2014-07-31 12:00:21 -07:00
John MacFarlane
00662faefb Made MediaBag a newtype, and added mime type information to media.
Shared now exports functions for interacting with a MediaBag:

- `emptyMediaBag`
- `lookuMedia`
- `insertMedia`
- `mediaDirectory`
- `extractMediaBag`
2014-07-31 11:05:35 -07:00
John MacFarlane
e4913d6dba Allow --self-contained to get content from MediaBag.
Added a parameter to makeSelfContained (API change).
2014-07-30 15:26:40 -07:00
Albert Krewinkel
8fdbef841d Update copyright notices for 2014, add missing notices 2014-05-09 00:46:08 +02:00
John MacFarlane
6fda361977 SelfContained: Handle "poster" attribute in "video" tags.
Closes #1188.
2014-03-05 09:10:09 -08:00
John MacFarlane
386e933432 Use isURI instead of isAbsoluteURI.
It allows fragments identifiers.
2013-10-16 09:48:11 -07:00
John MacFarlane
7c980f39bf Improved fetching of external resources.
* 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.
2013-07-18 20:58:14 -07:00
John MacFarlane
dede39452f Added comment/todo to SelfContained. 2013-04-10 10:22:00 -07:00
John MacFarlane
40f0a6dd66 SelfContained: handle src in embed, audio, source, input tags. 2013-03-26 08:45:25 -07:00
John MacFarlane
0ee54549af SelfContained: strip off fragment, query of relative URL
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.
2013-03-25 20:09:24 -07:00
John MacFarlane
449ddeb53b Refactoring:
* 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
2013-01-11 16:19:06 -08:00
John MacFarlane
77d9ead1b2 Move getItem from SelfContained to Share; export getItem. 2013-01-11 11:30:31 -08:00
John MacFarlane
1864bb0994 Data files changes.
* 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.
2012-12-29 17:54:07 -08:00
John MacFarlane
6ad7ac1239 Removed need for utf8-string package.
* 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.
2012-09-25 19:54:21 -07:00
John MacFarlane
a6f2b96084 Moved renderTags' from HTML reader & SelfContained to Shared.
Improved removal of markdown="1" attribute in Markdow reader.
2012-08-15 09:42:16 -07:00
John MacFarlane
6d7f0a1b81 Fixed whitespace errors. 2012-07-26 22:32:53 -07:00
John MacFarlane
6cdfde5807 SelfContained: Fix handling of absolute URLs in css imports.
Also allow single-quoted values.

Closes #535.
2012-06-28 18:35:21 -07:00
John MacFarlane
5914ae1ea3 Don't escape < in <style> tags with --self-contained.
Closes #422: highlighting lost using `--self-contained`.
2012-02-17 10:44:46 -08:00
John MacFarlane
d0582b912b SelfContained: Use getMimeType from Text.Pandoc.MIME. 2012-01-14 10:27:29 -08:00
John MacFarlane
42eb96a8b3 SelfContained: Get mime type from HTTP request if possible.
--webtex --self-contained now works.
2011-12-04 15:58:31 -08:00
John MacFarlane
0126843751 SelfContained: Convert all url()s in css to data: uris. 2011-12-04 12:19:35 -08:00
John MacFarlane
f027fd0eff --self-contained now works with <video> as well as <img>. 2011-11-24 10:04:25 -08:00
John MacFarlane
10b23e85b7 Changed Offline module to SelfContained, offline to makeSelfContained. 2011-11-21 15:09:42 -08:00
Renamed from src/Text/Pandoc/Offline.hs (Browse further)