relaton-cli 3.0.0.pre.alpha.1 → 3.0.0.pre.alpha.4
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 +27 -9
|
@@ -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,13 @@
|
|
|
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.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: liquid
|
|
@@ -24,20 +23,34 @@ dependencies:
|
|
|
24
23
|
- - "~>"
|
|
25
24
|
- !ruby/object:Gem::Version
|
|
26
25
|
version: '5'
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: pubid
|
|
28
|
+
requirement: !ruby/object:Gem::Requirement
|
|
29
|
+
requirements:
|
|
30
|
+
- - "~>"
|
|
31
|
+
- !ruby/object:Gem::Version
|
|
32
|
+
version: 2.0.0.pre.alpha.13
|
|
33
|
+
type: :runtime
|
|
34
|
+
prerelease: false
|
|
35
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
36
|
+
requirements:
|
|
37
|
+
- - "~>"
|
|
38
|
+
- !ruby/object:Gem::Version
|
|
39
|
+
version: 2.0.0.pre.alpha.13
|
|
27
40
|
- !ruby/object:Gem::Dependency
|
|
28
41
|
name: relaton
|
|
29
42
|
requirement: !ruby/object:Gem::Requirement
|
|
30
43
|
requirements:
|
|
31
44
|
- - '='
|
|
32
45
|
- !ruby/object:Gem::Version
|
|
33
|
-
version: 3.0.0.pre.alpha.
|
|
46
|
+
version: 3.0.0.pre.alpha.4
|
|
34
47
|
type: :runtime
|
|
35
48
|
prerelease: false
|
|
36
49
|
version_requirements: !ruby/object:Gem::Requirement
|
|
37
50
|
requirements:
|
|
38
51
|
- - '='
|
|
39
52
|
- !ruby/object:Gem::Version
|
|
40
|
-
version: 3.0.0.pre.alpha.
|
|
53
|
+
version: 3.0.0.pre.alpha.4
|
|
41
54
|
- !ruby/object:Gem::Dependency
|
|
42
55
|
name: thor
|
|
43
56
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -73,8 +86,8 @@ executables:
|
|
|
73
86
|
- relaton
|
|
74
87
|
extensions: []
|
|
75
88
|
extra_rdoc_files:
|
|
76
|
-
- docs/README.adoc
|
|
77
89
|
- LICENSE
|
|
90
|
+
- docs/README.adoc
|
|
78
91
|
files:
|
|
79
92
|
- ".gitignore"
|
|
80
93
|
- ".hound.yml"
|
|
@@ -89,6 +102,9 @@ files:
|
|
|
89
102
|
- bin/setup
|
|
90
103
|
- docs/README.adoc
|
|
91
104
|
- exe/relaton
|
|
105
|
+
- frontend/dist/404.html
|
|
106
|
+
- frontend/dist/app.iife.js
|
|
107
|
+
- frontend/dist/style.css
|
|
92
108
|
- i18n.yaml
|
|
93
109
|
- lib/relaton-cli.rb
|
|
94
110
|
- lib/relaton/bibcollection.rb
|
|
@@ -97,7 +113,10 @@ files:
|
|
|
97
113
|
- lib/relaton/cli/base_convertor.rb
|
|
98
114
|
- lib/relaton/cli/command.rb
|
|
99
115
|
- lib/relaton/cli/data_fetcher.rb
|
|
116
|
+
- lib/relaton/cli/frontend_assets.rb
|
|
100
117
|
- lib/relaton/cli/full_text_search.rb
|
|
118
|
+
- lib/relaton/cli/index_item_normalizer.rb
|
|
119
|
+
- lib/relaton/cli/index_site_generator.rb
|
|
101
120
|
- lib/relaton/cli/relaton_file.rb
|
|
102
121
|
- lib/relaton/cli/subcommand_collection.rb
|
|
103
122
|
- lib/relaton/cli/subcommand_db.rb
|
|
@@ -111,11 +130,11 @@ files:
|
|
|
111
130
|
- templates/_document.liquid
|
|
112
131
|
- templates/_index.liquid
|
|
113
132
|
- templates/index-style.css
|
|
133
|
+
- templates/index/page.liquid
|
|
114
134
|
homepage: https://github.com/metanorma/relaton-cli
|
|
115
135
|
licenses:
|
|
116
136
|
- BSD-2-Clause
|
|
117
137
|
metadata: {}
|
|
118
|
-
post_install_message:
|
|
119
138
|
rdoc_options: []
|
|
120
139
|
require_paths:
|
|
121
140
|
- lib
|
|
@@ -130,8 +149,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
130
149
|
- !ruby/object:Gem::Version
|
|
131
150
|
version: '0'
|
|
132
151
|
requirements: []
|
|
133
|
-
rubygems_version:
|
|
134
|
-
signing_key:
|
|
152
|
+
rubygems_version: 4.0.17
|
|
135
153
|
specification_version: 4
|
|
136
154
|
summary: Relaton Command-line Interface
|
|
137
155
|
test_files: []
|