mirror of
https://github.com/john-okeefe/foliate-js.git
synced 2026-09-09 11:29:14 -04:00
Add module for generating quote images
This commit is contained in:
@@ -340,6 +340,18 @@ These two functions return an object that implements the following interface:
|
||||
- `value`: a string; the default value of the parameter
|
||||
- `.search(map)`: a function, whose argument is a `Map` whose values are `Map`s (i.e. a two-dimensional map). The first key is the namespace of the search parameter. For non-namespaced parameters, the first key must be `null`. The second key is the parameter's name. Returns a string representing the URL of the search results.
|
||||
|
||||
### Generating Images for Quotes
|
||||
|
||||
With `quote-image.js`, one can generate shareable images for quotes:
|
||||
|
||||
```js
|
||||
document.querySelector('foliate-quoteimage').getBlob({
|
||||
title: 'The Time Machine',
|
||||
author: 'H. G. Wells',
|
||||
text: 'Can an instantaneous cube exist?',
|
||||
})
|
||||
```
|
||||
|
||||
### Supported Browsers
|
||||
|
||||
The main use of the library is for use in [Foliate](https://github.com/johnfactotum/foliate), which uses WebKitGTK. As such it's the only engine that has been tested extensively. But it should also work in Chromium and Firefox.
|
||||
|
||||
Reference in New Issue
Block a user