relaton-cli 3.0.0.pre.alpha.1 → 3.0.0.pre.alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.gitignore +4 -0
- data/CLAUDE.md +403 -0
- data/Gemfile +5 -0
- data/Rakefile +15 -0
- data/docs/README.adoc +177 -1
- data/frontend/dist/404.html +18 -0
- data/frontend/dist/app.iife.js +1 -0
- data/frontend/dist/style.css +3 -0
- data/lib/relaton/cli/command.rb +116 -0
- data/lib/relaton/cli/frontend_assets.rb +58 -0
- data/lib/relaton/cli/index_item_normalizer.rb +380 -0
- data/lib/relaton/cli/index_site_generator.rb +860 -0
- data/lib/relaton/cli/subcommand_collection.rb +3 -0
- data/lib/relaton-cli.rb +5 -0
- data/relaton-cli.gemspec +13 -3
- data/templates/index/page.liquid +20 -0
- metadata +25 -4
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
require "pubid"
|
|
1
2
|
require "relaton/cli/full_text_search"
|
|
2
3
|
|
|
3
4
|
module Relaton
|
|
@@ -130,6 +131,8 @@ module Relaton
|
|
|
130
131
|
File.write colfile, coll.to_yaml, encoding: "UTF-8"
|
|
131
132
|
else Util.info "No matching bibliographic entry found"
|
|
132
133
|
end
|
|
134
|
+
rescue Pubid::Errors::Error
|
|
135
|
+
Util.error %("#{code}" is not a recognized standards identifier)
|
|
133
136
|
end
|
|
134
137
|
|
|
135
138
|
desc "import FILE", "Import document or collection from an XML file " \
|
data/lib/relaton-cli.rb
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
# The per-flavor `autoload` lines live in `relaton.rb`, not `relaton/db`.
|
|
2
|
+
# `index_name_for`/`pubid_class_for` resolve `Relaton::<Flavor>::INDEXFILE`, so
|
|
3
|
+
# without the umbrella every `--pubid-flavor` fails with "no relaton flavor".
|
|
4
|
+
# Declaring autoloads is cheap: no flavor is loaded until it is referenced.
|
|
5
|
+
require "relaton"
|
|
1
6
|
require "relaton/db"
|
|
2
7
|
|
|
3
8
|
module Relaton
|
data/relaton-cli.gemspec
CHANGED
|
@@ -17,9 +17,13 @@ Gem::Specification.new do |spec|
|
|
|
17
17
|
spec.homepage = "https://github.com/metanorma/relaton-cli"
|
|
18
18
|
spec.license = "BSD-2-Clause"
|
|
19
19
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
20
|
+
# Ship lib/, exe/, templates/ and the COMPILED frontend, but not the frontend
|
|
21
|
+
# sources/tooling. `frontend/dist` is gitignored (built by `rake build_frontend`
|
|
22
|
+
# at package/release time), so `git ls-files` won't list it — append it
|
|
23
|
+
# explicitly. Reject the tracked `frontend/` sources so they don't bloat the gem.
|
|
24
|
+
spec.files = (`git ls-files -z`.split("\x0").reject do |f|
|
|
25
|
+
f.match(%r{^(test|spec|features|docs|frontend)/})
|
|
26
|
+
end + Dir.glob("frontend/dist/*")).uniq
|
|
23
27
|
spec.extra_rdoc_files = %w[docs/README.adoc LICENSE]
|
|
24
28
|
spec.bindir = "exe"
|
|
25
29
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
|
@@ -27,6 +31,12 @@ Gem::Specification.new do |spec|
|
|
|
27
31
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.3.0")
|
|
28
32
|
|
|
29
33
|
spec.add_dependency "liquid", "~> 5"
|
|
34
|
+
# The CLI requires "pubid" directly to rescue Pubid::Errors::Error when a
|
|
35
|
+
# reference is unparseable (see command.rb / subcommand_collection.rb). It is
|
|
36
|
+
# already a runtime dep of `relaton`, but declare it here too so the require
|
|
37
|
+
# is self-supporting rather than dependent on relaton's transitive graph.
|
|
38
|
+
# 2.0.0.pre.alpha.11 is the first pubid with `Pubid::Errors`.
|
|
39
|
+
spec.add_dependency "pubid", "~> 2.0.0.pre.alpha.13"
|
|
30
40
|
# relaton bundles every flavor plus Relaton::Bib, so depending on `relaton`
|
|
31
41
|
# alone is sufficient — relaton-bib is no longer published standalone.
|
|
32
42
|
spec.add_dependency "relaton", "= #{relaton_version}"
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
6
|
+
<title>{{ title | strip_html }}</title>
|
|
7
|
+
{%- if description %}
|
|
8
|
+
<meta name="description" content="{{ description | escape }}">
|
|
9
|
+
{%- endif %}
|
|
10
|
+
<meta name="generator" content="relaton-cli index">
|
|
11
|
+
{%- if favicon %}
|
|
12
|
+
<link rel="icon" href="{{ favicon | escape }}"{% if favicon_type %} type="{{ favicon_type }}"{% endif %}>
|
|
13
|
+
{%- endif %}
|
|
14
|
+
<style>{{ css }}</style>
|
|
15
|
+
</head>
|
|
16
|
+
<body>
|
|
17
|
+
<div id="relaton-index-app" data-title="{{ title | escape }}" data-generated="{{ generated }}"{% if description %} data-description="{{ description | escape }}"{% endif %} data-total="{{ total }}" data-shards="{{ shards }}" data-shard-size="{{ shard_size }}" data-detail-shards="{{ detail_shards }}" data-detail-shard-size="{{ detail_shard_size }}"></div>
|
|
18
|
+
<script>{{ iife }}</script>
|
|
19
|
+
</body>
|
|
20
|
+
</html>
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: relaton-cli
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.0.pre.alpha.
|
|
4
|
+
version: 3.0.0.pre.alpha.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-
|
|
11
|
+
date: 2026-09-30 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: liquid
|
|
@@ -24,20 +24,34 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '5'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: pubid
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: 2.0.0.pre.alpha.13
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: 2.0.0.pre.alpha.13
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: relaton
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
30
44
|
requirements:
|
|
31
45
|
- - '='
|
|
32
46
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 3.0.0.pre.alpha.
|
|
47
|
+
version: 3.0.0.pre.alpha.5
|
|
34
48
|
type: :runtime
|
|
35
49
|
prerelease: false
|
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
51
|
requirements:
|
|
38
52
|
- - '='
|
|
39
53
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 3.0.0.pre.alpha.
|
|
54
|
+
version: 3.0.0.pre.alpha.5
|
|
41
55
|
- !ruby/object:Gem::Dependency
|
|
42
56
|
name: thor
|
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -89,6 +103,9 @@ files:
|
|
|
89
103
|
- bin/setup
|
|
90
104
|
- docs/README.adoc
|
|
91
105
|
- exe/relaton
|
|
106
|
+
- frontend/dist/404.html
|
|
107
|
+
- frontend/dist/app.iife.js
|
|
108
|
+
- frontend/dist/style.css
|
|
92
109
|
- i18n.yaml
|
|
93
110
|
- lib/relaton-cli.rb
|
|
94
111
|
- lib/relaton/bibcollection.rb
|
|
@@ -97,7 +114,10 @@ files:
|
|
|
97
114
|
- lib/relaton/cli/base_convertor.rb
|
|
98
115
|
- lib/relaton/cli/command.rb
|
|
99
116
|
- lib/relaton/cli/data_fetcher.rb
|
|
117
|
+
- lib/relaton/cli/frontend_assets.rb
|
|
100
118
|
- lib/relaton/cli/full_text_search.rb
|
|
119
|
+
- lib/relaton/cli/index_item_normalizer.rb
|
|
120
|
+
- lib/relaton/cli/index_site_generator.rb
|
|
101
121
|
- lib/relaton/cli/relaton_file.rb
|
|
102
122
|
- lib/relaton/cli/subcommand_collection.rb
|
|
103
123
|
- lib/relaton/cli/subcommand_db.rb
|
|
@@ -111,6 +131,7 @@ files:
|
|
|
111
131
|
- templates/_document.liquid
|
|
112
132
|
- templates/_index.liquid
|
|
113
133
|
- templates/index-style.css
|
|
134
|
+
- templates/index/page.liquid
|
|
114
135
|
homepage: https://github.com/metanorma/relaton-cli
|
|
115
136
|
licenses:
|
|
116
137
|
- BSD-2-Clause
|