wax_tasks 1.1.4 → 1.1.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/ISSUE_TEMPLATE/bug_report.md +35 -0
- data/.github/ISSUE_TEMPLATE/feature_request.md +17 -0
- data/.github/workflows/ci.yml +30 -0
- data/.gitignore +7 -0
- data/.rspec +3 -0
- data/.rubocop.yml +16 -0
- data/.ruby-version +1 -0
- data/CODE_OF_CONDUCT.md +74 -0
- data/Gemfile +11 -0
- data/LICENSE +21 -0
- data/README.md +171 -0
- data/lib/tasks/clobber.rake +16 -0
- data/lib/tasks/derivatives_iiif.rake +26 -0
- data/lib/tasks/derivatives_simple.rake +17 -0
- data/lib/tasks/pages.rake +23 -0
- data/lib/tasks/search.rake +23 -0
- data/lib/wax_tasks.rb +37 -0
- data/lib/wax_tasks/asset.rb +57 -0
- data/lib/wax_tasks/collection.rb +61 -0
- data/lib/wax_tasks/collection/images.rb +126 -0
- data/lib/wax_tasks/collection/metadata.rb +101 -0
- data/lib/wax_tasks/config.rb +79 -0
- data/lib/wax_tasks/error.rb +65 -0
- data/lib/wax_tasks/index.rb +45 -0
- data/lib/wax_tasks/item.rb +116 -0
- data/lib/wax_tasks/record.rb +72 -0
- data/lib/wax_tasks/site.rb +86 -0
- data/lib/wax_tasks/utils.rb +151 -0
- data/lib/wax_tasks/version.rb +5 -0
- data/spec/setup.rb +0 -0
- data/spec/spec_helper.rb +0 -0
- data/wax_tasks.gemspec +33 -0
- metadata +32 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fd8340a2ecff9fe1d3fa57fa2bbd0d70dfbf33584131d2056a8805ee36e1902
|
4
|
+
data.tar.gz: db4172c4bbd872c5f07e042149137eb321d0b3dd7862819a2cdb4e758c5ae87c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f001ba8520a410f2601eb6386fd2fca430af7f8feea875497e589454472822a6ceecb8bf41711be8cdff89b45a63f82393da7354a98bd8e0a4392515de4ae65
|
7
|
+
data.tar.gz: abbec63cdc47318a45b9dc3eb74d9341f39f3aac2ba807879bb9008467f1f78c9b4033e2ec344367b54e88d1434717456a71f59fb181d16ac35a5e779f7a7b99
|
@@ -0,0 +1,35 @@
|
|
1
|
+
---
|
2
|
+
name: Bug report
|
3
|
+
about: Create a report to help us improve
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
**Describe the bug**
|
8
|
+
A clear and concise description of what the bug is.
|
9
|
+
|
10
|
+
**To Reproduce**
|
11
|
+
Steps to reproduce the behavior:
|
12
|
+
1. Go to '...'
|
13
|
+
2. Click on '....'
|
14
|
+
3. Scroll down to '....'
|
15
|
+
4. See error
|
16
|
+
|
17
|
+
**Expected behavior**
|
18
|
+
A clear and concise description of what you expected to happen.
|
19
|
+
|
20
|
+
**Screenshots**
|
21
|
+
If applicable, add screenshots to help explain your problem.
|
22
|
+
|
23
|
+
**Desktop (please complete the following information):**
|
24
|
+
- OS: [e.g. iOS]
|
25
|
+
- Browser [e.g. chrome, safari]
|
26
|
+
- Version [e.g. 22]
|
27
|
+
|
28
|
+
**Smartphone (please complete the following information):**
|
29
|
+
- Device: [e.g. iPhone6]
|
30
|
+
- OS: [e.g. iOS8.1]
|
31
|
+
- Browser [e.g. stock browser, safari]
|
32
|
+
- Version [e.g. 22]
|
33
|
+
|
34
|
+
**Additional context**
|
35
|
+
Add any other context about the problem here.
|
@@ -0,0 +1,17 @@
|
|
1
|
+
---
|
2
|
+
name: Feature request
|
3
|
+
about: Suggest an idea for this project
|
4
|
+
|
5
|
+
---
|
6
|
+
|
7
|
+
**Is your feature request related to a problem? Please describe.**
|
8
|
+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
9
|
+
|
10
|
+
**Describe the solution you'd like**
|
11
|
+
A clear and concise description of what you want to happen.
|
12
|
+
|
13
|
+
**Describe alternatives you've considered**
|
14
|
+
A clear and concise description of any alternative solutions or features you've considered.
|
15
|
+
|
16
|
+
**Additional context**
|
17
|
+
Add any other context or screenshots about the feature request here.
|
@@ -0,0 +1,30 @@
|
|
1
|
+
name: ci:test
|
2
|
+
on:
|
3
|
+
pull_request:
|
4
|
+
paths-ignore:
|
5
|
+
- '**/README.md'
|
6
|
+
push:
|
7
|
+
paths-ignore:
|
8
|
+
- '**/README.md'
|
9
|
+
|
10
|
+
jobs:
|
11
|
+
rspec:
|
12
|
+
runs-on: ubuntu-latest
|
13
|
+
steps:
|
14
|
+
- name: change imagemagick policy to allow pdf->png conversion.
|
15
|
+
run: |
|
16
|
+
sudo sed -i 's/^.*policy.*coder.*none.*PDF.*//' /etc/ImageMagick-6/policy.xml
|
17
|
+
- name: install ghostscript
|
18
|
+
run: sudo apt-get update && sudo apt-get install -y ghostscript
|
19
|
+
- uses: actions/checkout@v2
|
20
|
+
with:
|
21
|
+
fetch-depth: 1
|
22
|
+
- uses: ruby/setup-ruby@v1
|
23
|
+
with:
|
24
|
+
bundler-cache: true
|
25
|
+
- name: install
|
26
|
+
run: gem install bundler && bundle
|
27
|
+
- name: check for outdated gems
|
28
|
+
run: bundle outdated
|
29
|
+
- name: test
|
30
|
+
run: bundle exec rspec
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
AllCops:
|
2
|
+
NewCops: enable
|
3
|
+
TargetRubyVersion: 2.7
|
4
|
+
Exclude: ['spec/**/*', 'test_build/**/*']
|
5
|
+
Layout/LineLength:
|
6
|
+
IgnoredPatterns: ['raise', 'puts', 'set', 'warn', 'ÈÉÊË', 'EEEE', 'safe_join', 'spec']
|
7
|
+
Metrics/AbcSize:
|
8
|
+
Max: 28
|
9
|
+
Metrics/MethodLength:
|
10
|
+
Max: 15
|
11
|
+
Layout/EmptyComment:
|
12
|
+
Enabled: false
|
13
|
+
Layout/EmptyLineAfterGuardClause:
|
14
|
+
Enabled: false
|
15
|
+
Style/SingleArgumentDig:
|
16
|
+
Enabled: false
|
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.7.2
|
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
# Contributor Covenant Code of Conduct
|
2
|
+
|
3
|
+
## Our Pledge
|
4
|
+
|
5
|
+
In the interest of fostering an open and welcoming environment, we as
|
6
|
+
contributors and maintainers pledge to making participation in our project and
|
7
|
+
our community a harassment-free experience for everyone, regardless of age, body
|
8
|
+
size, disability, ethnicity, gender identity and expression, level of experience,
|
9
|
+
nationality, personal appearance, race, religion, or sexual identity and
|
10
|
+
orientation.
|
11
|
+
|
12
|
+
## Our Standards
|
13
|
+
|
14
|
+
Examples of behavior that contributes to creating a positive environment
|
15
|
+
include:
|
16
|
+
|
17
|
+
* Using welcoming and inclusive language
|
18
|
+
* Being respectful of differing viewpoints and experiences
|
19
|
+
* Gracefully accepting constructive criticism
|
20
|
+
* Focusing on what is best for the community
|
21
|
+
* Showing empathy towards other community members
|
22
|
+
|
23
|
+
Examples of unacceptable behavior by participants include:
|
24
|
+
|
25
|
+
* The use of sexualized language or imagery and unwelcome sexual attention or
|
26
|
+
advances
|
27
|
+
* Trolling, insulting/derogatory comments, and personal or political attacks
|
28
|
+
* Public or private harassment
|
29
|
+
* Publishing others' private information, such as a physical or electronic
|
30
|
+
address, without explicit permission
|
31
|
+
* Other conduct which could reasonably be considered inappropriate in a
|
32
|
+
professional setting
|
33
|
+
|
34
|
+
## Our Responsibilities
|
35
|
+
|
36
|
+
Project maintainers are responsible for clarifying the standards of acceptable
|
37
|
+
behavior and are expected to take appropriate and fair corrective action in
|
38
|
+
response to any instances of unacceptable behavior.
|
39
|
+
|
40
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
41
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
42
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
43
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
44
|
+
threatening, offensive, or harmful.
|
45
|
+
|
46
|
+
## Scope
|
47
|
+
|
48
|
+
This Code of Conduct applies both within project spaces and in public spaces
|
49
|
+
when an individual is representing the project or its community. Examples of
|
50
|
+
representing a project or community include using an official project e-mail
|
51
|
+
address, posting via an official social media account, or acting as an appointed
|
52
|
+
representative at an online or offline event. Representation of a project may be
|
53
|
+
further defined and clarified by project maintainers.
|
54
|
+
|
55
|
+
## Enforcement
|
56
|
+
|
57
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
58
|
+
reported by contacting the project team. All
|
59
|
+
complaints will be reviewed and investigated and will result in a response that
|
60
|
+
is deemed necessary and appropriate to the circumstances. The project team is
|
61
|
+
obligated to maintain confidentiality with regard to the reporter of an incident.
|
62
|
+
Further details of specific enforcement policies may be posted separately.
|
63
|
+
|
64
|
+
Project maintainers who do not follow or enforce the Code of Conduct in good
|
65
|
+
faith may face temporary or permanent repercussions as determined by other
|
66
|
+
members of the project's leadership.
|
67
|
+
|
68
|
+
## Attribution
|
69
|
+
|
70
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
71
|
+
available at [https://contributor-covenant.org/version/1/4][version]
|
72
|
+
|
73
|
+
[homepage]: https://contributor-covenant.org
|
74
|
+
[version]: https://contributor-covenant.org/version/1/4/
|
data/Gemfile
ADDED
@@ -0,0 +1,11 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
source 'https://rubygems.org'
|
4
|
+
gemspec
|
5
|
+
|
6
|
+
# dev/test utilities
|
7
|
+
gem 'bundle-audit', require: false
|
8
|
+
gem 'diane', require: false
|
9
|
+
gem 'rubocop', require: false
|
10
|
+
gem 'simplecov', require: false
|
11
|
+
gem 'yard', require: false
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 marii nyrop
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,171 @@
|
|
1
|
+
# wax_tasks 🐝
|
2
|
+
[![ci:test](https://github.com/minicomp/wax_tasks/actions/workflows/ci.yml/badge.svg)](https://github.com/minicomp/wax_tasks/actions/workflows/ci.yml) [![Depfu](https://badges.depfu.com/badges/6105c55b9634e74b1c27055b19bad8f0/overview.svg)](https://depfu.com/github/minicomp/wax_tasks?project_id=10548)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/wax_tasks.svg)](https://badge.fury.io/rb/wax_tasks)
|
4
|
+
[![Gem Downloads](https://img.shields.io/gem/dt/wax_tasks.svg?color=046d0b)](https://badge.fury.io/rb/wax_tasks)
|
5
|
+
[![docs](http://img.shields.io/badge/docs-rdoc.info-blue.svg?style=flat)](https://www.rubydoc.info/github/minicomp/wax_tasks/)
|
6
|
+
|
7
|
+
[![Maintainability](https://api.codeclimate.com/v1/badges/14408e7e962b9b84ec65/maintainability)](https://codeclimate.com/github/minicomp/wax_tasks/maintainability)
|
8
|
+
[![Test Coverage](https://api.codeclimate.com/v1/badges/14408e7e962b9b84ec65/test_coverage)](https://codeclimate.com/github/minicomp/wax_tasks/test_coverage)
|
9
|
+
![License](https://img.shields.io/github/license/minicomp/wax_tasks.svg?color=c6a1e0)
|
10
|
+
|
11
|
+
__wax_tasks__ is gem-packaged set of [Rake](https://ruby.github.io/rake/) tasks for creating minimal exhibition sites with [Wax](https://github.com/minicomp/wax/).
|
12
|
+
|
13
|
+
It can be used to:
|
14
|
+
- generate collection markdown pages from a metadata file ([wax:pages](#waxpages))
|
15
|
+
- generate a client-side search index ([wax:search](#waxsearch))
|
16
|
+
- generate either IIIF-compliant derivatives ([wax:derivatives:iiif](#waxderivativesiiif)) or simple image derivatives ([wax:derivatives:simple](#waxderivativessimple)) from local image and pdf files
|
17
|
+
|
18
|
+
<br>
|
19
|
+
<img src="https://raw.githubusercontent.com/minicomp/wiki/main/src/assets/wax_screen.gif?raw=true?raw=true"/>
|
20
|
+
|
21
|
+
|
22
|
+
# Getting Started
|
23
|
+
|
24
|
+
## Prerequisites
|
25
|
+
|
26
|
+
You'll need `Ruby >= 2.4` with `bundler` installed. Check your versions with:
|
27
|
+
```bash
|
28
|
+
$ ruby -v
|
29
|
+
ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin18]
|
30
|
+
|
31
|
+
$ bundler -v
|
32
|
+
Bundler version 1.16.1
|
33
|
+
```
|
34
|
+
|
35
|
+
To use the image derivative tasks, you will also need to have ImageMagick and Ghostscript installed and functional. You can check to see if you have ImageMagick by running:
|
36
|
+
```bash
|
37
|
+
$ convert -version
|
38
|
+
Version: ImageMagick 6.9.9-20 Q16 x86_64 2017-10-15 http://www.imagemagick.org
|
39
|
+
Copyright: (c) 1999-2017 ImageMagick Studio LLC
|
40
|
+
License: http://www.imagemagick.org/script/license.php
|
41
|
+
Features: Cipher DPC Modules
|
42
|
+
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png tiff xml zlib
|
43
|
+
```
|
44
|
+
|
45
|
+
... and check Ghostscript with:
|
46
|
+
```bash
|
47
|
+
$ gs -version
|
48
|
+
GPL Ghostscript 9.21 (2017-03-16)
|
49
|
+
Copyright (C) 2017 Artifex Software, Inc. All rights reserved.
|
50
|
+
```
|
51
|
+
|
52
|
+
Next, you'll need a Jekyll site. You can clone the [minicomp/wax demo site](https://github.com/minicomp/wax/) or start a site from scratch with:
|
53
|
+
|
54
|
+
```sh
|
55
|
+
$ gem install jekyll
|
56
|
+
$ jekyll new wax && cd wax
|
57
|
+
```
|
58
|
+
|
59
|
+
## Installation
|
60
|
+
|
61
|
+
Add `wax_tasks` to your Jekyll site's `Gemfile`:
|
62
|
+
|
63
|
+
```ruby
|
64
|
+
gem 'wax_tasks'
|
65
|
+
```
|
66
|
+
|
67
|
+
... and install with bundler:
|
68
|
+
|
69
|
+
```bash
|
70
|
+
$ bundle install
|
71
|
+
```
|
72
|
+
|
73
|
+
Create a `Rakefile` with the following:
|
74
|
+
```ruby
|
75
|
+
spec = Gem::Specification.find_by_name 'wax_tasks'
|
76
|
+
Dir.glob("#{spec.gem_dir}/lib/tasks/*.rake").each { |r| load r }
|
77
|
+
```
|
78
|
+
|
79
|
+
# Usage
|
80
|
+
|
81
|
+
After following the installation instructions above, you will have access to the Rake tasks in your shell by running `$ bundle exec rake wax:taskname` in the root directory of your Jekyll site.
|
82
|
+
To see the available tasks, run
|
83
|
+
|
84
|
+
```ruby
|
85
|
+
$ bundle exec rake --tasks
|
86
|
+
```
|
87
|
+
|
88
|
+
## Sample site `_config.yml` file:
|
89
|
+
|
90
|
+
```yaml
|
91
|
+
# basic settings
|
92
|
+
title: Wax.
|
93
|
+
description: a jekyll theme for minimal exhibitions
|
94
|
+
url: 'https://minicomp.github.io'
|
95
|
+
baseurl: '/wax'
|
96
|
+
|
97
|
+
# build settings
|
98
|
+
permalink: pretty # optional, creates `/page/` link instead of `page.html` links
|
99
|
+
|
100
|
+
# wax collection settings
|
101
|
+
collections:
|
102
|
+
objects: # the collection name
|
103
|
+
layout: 'iiif-image-page'
|
104
|
+
output: true # this must be true for your .md pages to be built to html!
|
105
|
+
metadata:
|
106
|
+
source: 'objects.csv' # path to the metadata file, must be within '_data'
|
107
|
+
images:
|
108
|
+
source 'source_images/objects' # path to the directory of source images, must be within '_data'
|
109
|
+
|
110
|
+
# wax search index settings
|
111
|
+
search:
|
112
|
+
main:
|
113
|
+
index: 'js/lunr-index.json' # where the index will be generated
|
114
|
+
collections: # the collections to index
|
115
|
+
objects:
|
116
|
+
content: false # whether or not to index the markdown page content (below the YAML)
|
117
|
+
fields: # the metadata fields to index
|
118
|
+
- 'label'
|
119
|
+
- 'artist'
|
120
|
+
- 'location'
|
121
|
+
- 'object_type'
|
122
|
+
```
|
123
|
+
|
124
|
+
The above example includes a single collection `objects` that comprises:
|
125
|
+
1. a CSV `metadata:source` file (`objects.csv`), and
|
126
|
+
2. a `images:source` directory of image and pdf files.
|
127
|
+
|
128
|
+
For more information on configuring Jekyll collections for __wax_tasks__, check out the [minicomp/wax wiki](https://minicomp.github.io/wiki/#/wax/) and <https://jekyllrb.com/docs/collections/>.
|
129
|
+
|
130
|
+
## Running the tasks
|
131
|
+
|
132
|
+
### wax:pages
|
133
|
+
|
134
|
+
Takes a CSV, JSON, or YAML file of collection metadata and generates a [markdown](https://daringfireball.net/projects/markdown/syntax) page for each record to a directory using a specified layout. [Read More](#TODO).
|
135
|
+
|
136
|
+
`$ bundle exec rake wax:pages collection-name`
|
137
|
+
|
138
|
+
### wax:search
|
139
|
+
|
140
|
+
Generates a client-side JSON search index of your site for use with [ElasticLunr.js](http://elasticlunr.com/). [Read More](#TODO).
|
141
|
+
|
142
|
+
`$ bundle exec rake wax:search search-name`
|
143
|
+
|
144
|
+
|
145
|
+
### wax:derivatives:simple
|
146
|
+
|
147
|
+
Takes a local directory of images and pdf files and generates a few image derivatives (i.e., 'thumbnail' 250w and 'full' 1140w) for Jekyll layouts and includes to use. [Read More](#TODO).
|
148
|
+
|
149
|
+
`$ bundle exec rake wax:derivatives:iiif collection-name`
|
150
|
+
|
151
|
+
### wax:derivatives:iiif
|
152
|
+
|
153
|
+
Takes a local directory of images and pdf files and generates tiles and data that work with a IIIF compliant image viewer like [OpenSeaDragon](https://openseadragon.github.io/), [Mirador](http://projectmirador.org/), or [Leaflet IIIF](https://github.com/mejackreed/Leaflet-IIIF). [Read More](#TODO).
|
154
|
+
|
155
|
+
`$ bundle exec rake wax:derivatives:iiif collection-name`
|
156
|
+
|
157
|
+
### wax:clobber
|
158
|
+
|
159
|
+
Destroys (or "clobbers") wax-generated files, i.e., pages generated from `wax:pagemaster`, derivatives generated from `wax:derivatives`, and search indexes generated with `wax:search` so you can start from scratch.
|
160
|
+
|
161
|
+
This task does *not* touch your source metadata or source image files! Instead, it simply clears a path for you to regenerate your collection materials in case you add/edit source materials.
|
162
|
+
|
163
|
+
`$ bundle exec rake wax:clobber collection-name`
|
164
|
+
|
165
|
+
# Contributing
|
166
|
+
|
167
|
+
Fork/clone the repository. After making code changes, run the tests (`$ bundle exec rubocop` and `$ bundle exec rspec`) before submitting a pull request. You can enable verbose tests with `$ DEBUG=true bundle exec rspec`.
|
168
|
+
|
169
|
+
# License
|
170
|
+
|
171
|
+
The gem is available as open source under the terms of the [MIT License](LICENSE).
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'wax_tasks'
|
4
|
+
|
5
|
+
namespace :wax do
|
6
|
+
desc 'destroy wax-generated collection files, including pages, derivatives, and search index(es)'
|
7
|
+
task :clobber do
|
8
|
+
args = ARGV.drop(1).each { |a| task a.to_sym }
|
9
|
+
args.reject! { |a| a.start_with? '-' }
|
10
|
+
|
11
|
+
raise WaxTasks::Error::MissingArguments, Rainbow("You must specify a collection after 'wax:clobber'").magenta if args.empty?
|
12
|
+
|
13
|
+
site = WaxTasks::Site.new
|
14
|
+
args.each { |a| site.clobber a }
|
15
|
+
end
|
16
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'wax_tasks'
|
4
|
+
|
5
|
+
namespace :wax do
|
6
|
+
namespace :derivatives do
|
7
|
+
desc 'generate iiif derivatives from local image files'
|
8
|
+
task :iiif do
|
9
|
+
args = ARGV.drop(1).each { |a| task a.to_sym }
|
10
|
+
args.reject! { |a| a.start_with? '-' }
|
11
|
+
|
12
|
+
raise WaxTasks::Error::MissingArguments, Rainbow("You must specify a collection after 'wax:derivatives:iiif'").magenta if args.empty?
|
13
|
+
|
14
|
+
site = WaxTasks::Site.new
|
15
|
+
args.each { |a| site.generate_derivatives(a, 'iiif') }
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
# alias wax:iiif to wax:derivatives:iiif for backwards compatibility
|
20
|
+
task :iiif do
|
21
|
+
t = Rake::Task['wax:derivatives:iiif']
|
22
|
+
desc t.full_comment if t.full_comment
|
23
|
+
arguments = ARGV.drop(1).each { |a| task a.to_sym }
|
24
|
+
t.invoke(*arguments)
|
25
|
+
end
|
26
|
+
end
|