-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME.md.template
55 lines (42 loc) · 1.71 KB
/
README.md.template
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# Recipe calculator bookmarklet
This bookmarklet makes it easy to tweak the quantities in a recipe! Once installed, simply click and have all recipe ingredient quantities tied together, making it easy to adjust based on what you've got at hand.
[Recipe Calculator Link]({BOOKMARKLET})
![](demo.gif)
## Installation
On a desktop computer, drag the bookmarklet link above to your bookmarks toolbar. To use it, go to a recipe and click on the bookmark.
On iOS,
1. Bookmark this page (tap share icon, then bookmark icon).
2. Copy this text. <a href="#" click="copy();return false;">Click here</a> to copy.
<code style="display: block;overflow: hidden;white-space: nowrap;">{BOOKMARKLET}</code>
3. Go to bookmarks and tap "edit". Change the address to the bookmark you make in step 1 to the code.
4. Try it out: Go to a recipe and click on the bookmark!
<script>
function copy() {
const p = document.querySelector('code');
const r = document.createRange();
r.setStart(p, 0);
r.setEnd(p, 1);
// Select text
const s = window.getSelection();
s.removeAllRanges();
s.addRange(r);
// Copy
document.execCommand('copy');
// Unselect text
s.removeAllRanges();
}
</script>
## Supported sites:
- [New York Times Cooking](https://cooking.nytimes.com/)
- [King Arthur Flour](https://www.kingarthurflour.com/recipes)
- [bon appétit](https://www.bonappetit.com/)
- All websites with [schema.org](https://schema.org/)-compliant usage of `recipeIngredient`. Includes [Smitten Kitchen](https://smittenkitchen.com/), allrecipes, and [epicurious](https://www.epicurious.com/).
## Developer
Build new version of README with
```
make build
```
Start development server with, visit [here](http://localhost:8002/test.html)
```
make dev
```