iiif_manifest 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +18 -6
- data/CONTRIBUTING.md +94 -74
- data/README.md +17 -5
- data/iiif_manifest.gemspec +1 -0
- data/lib/iiif_manifest/v3/manifest_builder/canvas_builder.rb +13 -0
- data/lib/iiif_manifest/v3/manifest_builder/iiif_service.rb +4 -0
- data/lib/iiif_manifest/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cb02cce0f6459386c0338403c63feaa47d66b993eaca804b295985ad59b48d5
|
4
|
+
data.tar.gz: e702edcf478a720f80a7467dcd63e28ee2221e3787dd86f59db80ed7e9c0a830
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3c51ee12c6535e794354327b811ed7e9007d071015cfde73a262c2f1f842b9ce14858225cde58e2e15e7b15e8887cbf4fc730fdcf1d4da6540ff12a4db7227fb
|
7
|
+
data.tar.gz: 54375f553abbece4763a518324ed435e240dc4ed93232d40ca938a65292f5feb983de9b5c11235f150cbc0ecd13b9bb468ae4f0212841a4032deb319826b48f0
|
data/.circleci/config.yml
CHANGED
@@ -34,15 +34,21 @@ workflows:
|
|
34
34
|
version: 2
|
35
35
|
ci:
|
36
36
|
jobs:
|
37
|
+
- test:
|
38
|
+
name: "ruby3-2"
|
39
|
+
ruby_version: "3.2.0"
|
40
|
+
- test:
|
41
|
+
name: "ruby3-1"
|
42
|
+
ruby_version: "3.1.3"
|
37
43
|
- test:
|
38
44
|
name: "ruby3-0"
|
39
|
-
ruby_version: "3.0.
|
45
|
+
ruby_version: "3.0.5"
|
40
46
|
- test:
|
41
47
|
name: "ruby2-7"
|
42
|
-
ruby_version: "2.7.
|
48
|
+
ruby_version: "2.7.7"
|
43
49
|
- test:
|
44
50
|
name: "ruby2-6"
|
45
|
-
ruby_version: "2.6.
|
51
|
+
ruby_version: "2.6.10"
|
46
52
|
- test:
|
47
53
|
name: "ruby2-5"
|
48
54
|
ruby_version: "2.5.9"
|
@@ -56,15 +62,21 @@ workflows:
|
|
56
62
|
only:
|
57
63
|
- main
|
58
64
|
jobs:
|
65
|
+
- test:
|
66
|
+
name: "ruby3-2"
|
67
|
+
ruby_version: "3.2.0"
|
68
|
+
- test:
|
69
|
+
name: "ruby3-1"
|
70
|
+
ruby_version: "3.1.3"
|
59
71
|
- test:
|
60
72
|
name: "ruby3-0"
|
61
|
-
ruby_version: "3.0.
|
73
|
+
ruby_version: "3.0.5"
|
62
74
|
- test:
|
63
75
|
name: "ruby2-7"
|
64
|
-
ruby_version: "2.7.
|
76
|
+
ruby_version: "2.7.7"
|
65
77
|
- test:
|
66
78
|
name: "ruby2-6"
|
67
|
-
ruby_version: "2.6.
|
79
|
+
ruby_version: "2.6.10"
|
68
80
|
- test:
|
69
81
|
name: "ruby2-5"
|
70
82
|
ruby_version: "2.5.9"
|
data/CONTRIBUTING.md
CHANGED
@@ -11,66 +11,84 @@ experience for all its members, whether they are at a formal gathering, in
|
|
11
11
|
a social setting, or taking part in activities online. Please see our
|
12
12
|
[Code of Conduct](CODE_OF_CONDUCT.md) for more information.
|
13
13
|
|
14
|
-
##
|
14
|
+
## Language
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
Agreement (cCLA) on file.
|
16
|
+
The language we use matters. Today, tomorrow, and for years to come
|
17
|
+
people will read the code we write. They will judge us for our
|
18
|
+
design, logic, and the words we use to describe the system.
|
20
19
|
|
21
|
-
|
20
|
+
Our words should be accessible. Favor descriptive words that give
|
21
|
+
meaning while avoiding reinforcing systemic inequities. For example,
|
22
|
+
in the Samvera community, we should favor using allowed_list instead
|
23
|
+
of whitelist, denied_list instead of blacklist, or source/copy
|
24
|
+
instead of master/slave.
|
22
25
|
|
23
|
-
|
26
|
+
We're going to get it wrong, but this is a call to keep working to
|
27
|
+
make it right. View our code and the words we choose as a chance to
|
28
|
+
have a conversation. A chance to grow an understanding of the systems
|
29
|
+
we develop as well as the systems in which we live.
|
30
|
+
|
31
|
+
See [“Blacklists” and “whitelists”: a salutary warning concerning the
|
32
|
+
prevalence of racist language in discussions of predatory
|
33
|
+
publishing](https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6148600/) for
|
34
|
+
further details.
|
24
35
|
|
25
36
|
## Contribution Tasks
|
26
37
|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
38
|
+
- Reporting Issues
|
39
|
+
- Making Changes
|
40
|
+
- Documenting Code
|
41
|
+
- Committing Changes
|
42
|
+
- Submitting Changes
|
43
|
+
- Reviewing and Merging Changes
|
33
44
|
|
34
45
|
### Reporting Issues
|
35
46
|
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
47
|
+
- Make sure you have a [GitHub account](https://github.com/signup/free)
|
48
|
+
- Submit a [Github issue](https://github.com/samvera/iiif_manifest/issues/) by:
|
49
|
+
- Clearly describing the issue
|
50
|
+
- Provide a descriptive summary
|
51
|
+
- Explain the expected behavior
|
52
|
+
- Explain the actual behavior
|
53
|
+
- Provide steps to reproduce the actual behavior
|
43
54
|
|
44
55
|
### Making Changes
|
45
56
|
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
57
|
+
- Fork the repository on GitHub
|
58
|
+
- Create a topic branch from where you want to base your work.
|
59
|
+
- This is usually the `main` branch.
|
60
|
+
- To quickly create a topic branch based on `main`; `git branch fix/main/my_contribution main`
|
61
|
+
- Then checkout the new branch with `git checkout fix/main/my_contribution`.
|
62
|
+
- Please avoid working directly on the `main` branch.
|
63
|
+
- Please do not create a branch called `master`. (See note below.)
|
64
|
+
- You may find the [hub suite of commands](https://github.com/defunkt/hub) helpful
|
65
|
+
- Make sure you have added sufficient tests and documentation for your changes.
|
66
|
+
- Test functionality with RSpec; Test features / UI with Capybara.
|
67
|
+
- Run _all_ the tests to assure nothing else was accidentally broken.
|
68
|
+
|
69
|
+
NOTE: This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct)
|
70
|
+
and [language recommendations](#language).
|
71
|
+
Please **_do not_** create a branch called `master` for this repository or as part of
|
72
|
+
your pull request; the branch will either need to be removed or renamed before it can
|
73
|
+
be considered for inclusion in the code base and history of this repository.
|
56
74
|
|
57
75
|
### Documenting Code
|
58
76
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
77
|
+
- All new public methods, modules, and classes should include inline documentation in [YARD](http://yardoc.org/).
|
78
|
+
- Documentation should seek to answer the question "why does this code exist?"
|
79
|
+
- Document private / protected methods as desired.
|
80
|
+
- If you are working in a file with no prior documentation, do try to document as you gain understanding of the code.
|
81
|
+
- If you don't know exactly what a bit of code does, it is extra likely that it needs to be documented. Take a stab at it and ask for feedback in your pull request. You can use the 'blame' button on GitHub to identify the original developer of the code and @mention them in your comment.
|
82
|
+
- This work greatly increases the usability of the code base and supports the on-ramping of new committers.
|
83
|
+
- We will all be understanding of one another's time constraints in this area.
|
84
|
+
- [Getting started with YARD](http://www.rubydoc.info/gems/yard/file/docs/GettingStarted.md)
|
67
85
|
|
68
86
|
### Committing changes
|
69
87
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
88
|
+
- Make commits of logical units.
|
89
|
+
- Check for unnecessary whitespace with `git diff --check` before committing.
|
90
|
+
- Make sure your commit messages are [well formed](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).
|
91
|
+
- If you created an issue, you can close it by including "Closes #issue" in your commit message. See [Github's blog post for more details](https://github.com/blog/1386-closing-issues-via-commit-messages)
|
74
92
|
|
75
93
|
```
|
76
94
|
Present tense short summary (50 characters or less)
|
@@ -102,60 +120,62 @@ You should also add yourself to the `CONTRIBUTORS.md` file in the root of the pr
|
|
102
120
|
long to fit in 72 characters
|
103
121
|
```
|
104
122
|
|
105
|
-
|
106
|
-
|
107
|
-
|
123
|
+
- Make sure you have added the necessary tests for your changes.
|
124
|
+
- Run _all_ the tests to assure nothing else was accidentally broken.
|
125
|
+
- When you are ready to submit a pull request
|
108
126
|
|
109
127
|
### Submitting Changes
|
110
128
|
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
129
|
+
- Read the article ["Using Pull Requests"](https://help.github.com/articles/using-pull-requests) on GitHub.
|
130
|
+
- Make sure your branch is up to date with its parent branch (i.e. main)
|
131
|
+
- `git checkout main`
|
132
|
+
- `git pull --rebase`
|
133
|
+
- `git checkout <your-branch>`
|
134
|
+
- `git rebase main`
|
135
|
+
- It is a good idea to run your tests again.
|
136
|
+
- If you've made more than one commit take a moment to consider whether squashing commits together would help improve their logical grouping.
|
137
|
+
- [Detailed Walkthrough of One Pull Request per Commit](http://ndlib.github.io/practices/one-commit-per-pull-request/)
|
138
|
+
- `git rebase --interactive main` ([See Github help](https://help.github.com/articles/interactive-rebase))
|
139
|
+
- Squashing your branch's changes into one commit is "good form" and helps the person merging your request to see everything that is going on.
|
140
|
+
- Push your changes to a topic branch in your fork of the repository.
|
141
|
+
- Submit a pull request from your fork to the project.
|
124
142
|
|
125
143
|
### Reviewing and Merging Changes
|
126
144
|
|
127
145
|
We adopted [Github's Pull Request Review](https://help.github.com/articles/about-pull-request-reviews/) for our repositories.
|
128
146
|
Common checks that may occur in our repositories:
|
129
147
|
|
130
|
-
1.
|
131
|
-
2.
|
148
|
+
1. [CircleCI](https://circleci.com/gh/samvera) - where our automated tests are running
|
149
|
+
2. RuboCop/Bixby - where we check for style violations
|
150
|
+
3. Approval Required - Github enforces at least one person approve a pull request. Also, all reviewers that have chimed in must approve.
|
151
|
+
4. CodeClimate - is our code remaining healthy (at least according to static code analysis)
|
132
152
|
|
133
153
|
If one or more of the required checks failed (or are incomplete), the code should not be merged (and the UI will not allow it). If all of the checks have passed, then anyone on the project (including the pull request submitter) may merge the code.
|
134
154
|
|
135
|
-
|
155
|
+
_Example: Carolyn submits a pull request, Justin reviews the pull request and approves. However, Justin is still waiting on other checks (CI tests are usually the culprit), so he does not merge the pull request. Eventually, all of the checks pass. At this point, Carolyn or anyone else may merge the pull request._
|
136
156
|
|
137
157
|
#### Things to Consider When Reviewing
|
138
158
|
|
139
159
|
First, the person contributing the code is putting themselves out there. Be mindful of what you say in a review.
|
140
160
|
|
141
|
-
|
142
|
-
|
143
|
-
|
161
|
+
- Ask clarifying questions
|
162
|
+
- State your understanding and expectations
|
163
|
+
- Provide example code or alternate solutions, and explain why
|
144
164
|
|
145
165
|
This is your chance for a mentoring moment of another developer. Take time to give an honest and thorough review of what has changed. Things to consider:
|
146
166
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
167
|
+
- Does the commit message explain what is going on?
|
168
|
+
- Does the code changes have tests? _Not all changes need new tests, some changes are refactorings_
|
169
|
+
- Do new or changed methods, modules, and classes have documentation?
|
170
|
+
- Does the commit contain more than it should? Are two separate concerns being addressed in one commit?
|
171
|
+
- Does the description of the new/changed specs match your understanding of what the spec is doing?
|
172
|
+
- Did the Continuous Integration tests complete successfully?
|
153
173
|
|
154
174
|
If you are uncertain, bring other contributors into the conversation by assigning them as a reviewer.
|
155
175
|
|
156
176
|
# Additional Resources
|
157
177
|
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
178
|
+
- [General GitHub documentation](http://help.github.com/)
|
179
|
+
- [GitHub pull request documentation](https://help.github.com/articles/about-pull-requests/)
|
180
|
+
- [Pro Git](http://git-scm.com/book) is both a free and excellent book about Git.
|
181
|
+
- [A Git Config for Contributing](http://ndlib.github.io/practices/my-typical-per-project-git-config/)
|
data/README.md
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
# IIIFManifest
|
2
2
|
|
3
|
-
Code:
|
3
|
+
Code:
|
4
|
+
[![CircleCI](https://circleci.com/gh/samvera/iiif_manifest.svg?style=svg)](https://circleci.com/gh/samvera/iiif_manifest) [![Coverage Status](https://coveralls.io/repos/github/samvera/iiif_manifest/badge.svg)](https://coveralls.io/github/samvera/iiif_manifest)
|
4
5
|
|
5
|
-
Docs:
|
6
|
+
Docs:
|
7
|
+
[![Contribution Guidelines](http://img.shields.io/badge/CONTRIBUTING-Guidelines-blue.svg)](./CONTRIBUTING.md) [![Apache 2.0 License](http://img.shields.io/badge/APACHE2-license-blue.svg)](./LICENSE)
|
6
8
|
|
7
|
-
|
9
|
+
Community Support: [![Samvera Community Slack](https://img.shields.io/badge/samvera-slack-blueviolet)](http://slack.samvera.org/)
|
8
10
|
|
9
11
|
# What is IIIFManifest
|
10
12
|
|
@@ -12,11 +14,11 @@ IIIF <http://iiif.io/> defines an API for presenting related images in a viewer.
|
|
12
14
|
|
13
15
|
## Product Owner & Maintenance
|
14
16
|
|
15
|
-
`iiif_manifest` is a Core Component of the Samvera
|
17
|
+
`iiif_manifest` is a Core Component of the Samvera Community. The documentation for what this means can be found [here](http://samvera.github.io/core_components.html#requirements-for-a-core-component).
|
16
18
|
|
17
19
|
### Product Owner
|
18
20
|
|
19
|
-
[
|
21
|
+
[kdid](https://github.com/kdid)
|
20
22
|
|
21
23
|
# Usage
|
22
24
|
|
@@ -105,6 +107,8 @@ For example:
|
|
105
107
|
|
106
108
|
The class that represents the leaf nodes, must implement `#id`. It must also implement `#display_image` which returns an instance of `IIIFManifest::DisplayImage`
|
107
109
|
|
110
|
+
Additionally it **_may_** implement `#sequence_rendering` to contain an array of hashes for file downloads to be offered at each leaf node. This follows a similar format as `#sequence_rendering` at sequences level.
|
111
|
+
|
108
112
|
```ruby
|
109
113
|
class Page
|
110
114
|
def initialize(id)
|
@@ -124,6 +128,10 @@ The class that represents the leaf nodes, must implement `#id`. It must also imp
|
|
124
128
|
)
|
125
129
|
end
|
126
130
|
|
131
|
+
def sequence_rendering
|
132
|
+
[{"@id" => "http://test.host/display_image/id/download", "format" => "application/pdf", "label" => "Download"}]
|
133
|
+
end
|
134
|
+
|
127
135
|
private
|
128
136
|
|
129
137
|
def endpoint
|
@@ -206,6 +214,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
206
214
|
|
207
215
|
Bug reports and pull requests are welcome on GitHub at <https://github.com/samvera-labs/iiif_manifest>. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
208
216
|
|
217
|
+
If you're working on PR for this project, create a feature branch off of `main`.
|
218
|
+
|
219
|
+
This repository follows the [Samvera Community Code of Conduct](https://samvera.atlassian.net/wiki/spaces/samvera/pages/405212316/Code+of+Conduct) and [language recommendations](https://github.com/samvera/maintenance/blob/master/templates/CONTRIBUTING.md#language). Please ***do not*** create a branch called `master` for this repository or as part of your pull request; the branch will either need to be removed or renamed before it can be considered for inclusion in the code base and history of this repository.
|
220
|
+
|
209
221
|
## Help
|
210
222
|
|
211
223
|
The Samvera community is here to help. Please see our [support guide](./SUPPORT.md).
|
data/iiif_manifest.gemspec
CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |spec|
|
|
11
11
|
spec.summary = 'Generate IIIF presentation manifests for Hydra::Works'
|
12
12
|
spec.description = 'IIIF http://iiif.io/ defines an API for presenting related images in a viewer. This transforms Hydra::Works objects into that format usable by players such as http://universalviewer.io/'
|
13
13
|
spec.homepage = 'https://github.com/samvera/iiif_manifest'
|
14
|
+
spec.metadata = { "rubygems_mfa_required" => "true" }
|
14
15
|
|
15
16
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
17
|
spec.bindir = 'exe'
|
@@ -59,6 +59,7 @@ module IIIFManifest
|
|
59
59
|
annotation_page['id'] = "#{path}/annotation_page/#{annotation_page.index}"
|
60
60
|
canvas.items = [annotation_page]
|
61
61
|
apply_thumbnail_to(canvas)
|
62
|
+
canvas.rendering = populate_rendering if populate_rendering.present?
|
62
63
|
end
|
63
64
|
|
64
65
|
def apply_thumbnail_to(canvas)
|
@@ -84,6 +85,18 @@ module IIIFManifest
|
|
84
85
|
choice_builder.new(display_content).apply(canvas)
|
85
86
|
end
|
86
87
|
end
|
88
|
+
|
89
|
+
def populate_rendering
|
90
|
+
return unless record.respond_to?(:sequence_rendering)
|
91
|
+
record.sequence_rendering.collect do |rendering|
|
92
|
+
sequence_rendering = rendering.to_h.except('@id', 'label')
|
93
|
+
sequence_rendering['id'] = rendering['@id']
|
94
|
+
if rendering['label'].present?
|
95
|
+
sequence_rendering['label'] = ManifestBuilder.language_map(rendering['label'])
|
96
|
+
end
|
97
|
+
sequence_rendering
|
98
|
+
end
|
99
|
+
end
|
87
100
|
end
|
88
101
|
end
|
89
102
|
end
|
metadata
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: iiif_manifest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin Coyne
|
8
8
|
- Trey Pendragon
|
9
|
-
autorequire:
|
9
|
+
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2023-02-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -175,8 +175,9 @@ files:
|
|
175
175
|
- lib/iiif_manifest/version.rb
|
176
176
|
homepage: https://github.com/samvera/iiif_manifest
|
177
177
|
licenses: []
|
178
|
-
metadata:
|
179
|
-
|
178
|
+
metadata:
|
179
|
+
rubygems_mfa_required: 'true'
|
180
|
+
post_install_message:
|
180
181
|
rdoc_options: []
|
181
182
|
require_paths:
|
182
183
|
- lib
|
@@ -192,7 +193,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
192
193
|
version: '0'
|
193
194
|
requirements: []
|
194
195
|
rubygems_version: 3.1.6
|
195
|
-
signing_key:
|
196
|
+
signing_key:
|
196
197
|
specification_version: 4
|
197
198
|
summary: Generate IIIF presentation manifests for Hydra::Works
|
198
199
|
test_files: []
|