relaton-cli 0.8.2 → 0.8.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/relaton/bibcollection.rb +0 -1
- data/lib/relaton/bibdata.rb +1 -1
- data/lib/relaton/cli/_document.liquid +8 -8
- data/lib/relaton/cli/version.rb +1 -1
- data/lib/relaton/cli/xml_to_html_renderer.rb +18 -1
- data/templates/_document.liquid +6 -6
- data/templates/index-style.css +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42ec0e9f67c99d26c92c2064a3f650b36884507be4ef71fb44cb5b2b106e7196
|
4
|
+
data.tar.gz: 2736894c47c5a0d82e8f685f8b83c62c75bf2aa5b0e1abb22304214ded35070e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed58412eb9699c5d163dc6261671d54dd4cbc811132793963f999e310ad216278f1f2e7bccd4945c0a5b43c7aca054e80ea520a7293013e416cf4522d539f437
|
7
|
+
data.tar.gz: 02e555000e067bd3b23f41f4018fa6e2601377b520ec465c191dea6123c450ee57db0c8f0257847c72352f77ef0255d4e91d4fb72f605c16d59f5b6d19ab540b
|
data/lib/relaton/bibdata.rb
CHANGED
@@ -8,16 +8,16 @@
|
|
8
8
|
<div class="doc-identifier">
|
9
9
|
<h{{ depth }}>
|
10
10
|
{% if document.html == "" %}
|
11
|
-
{{ document.
|
11
|
+
{{ document.docid.id }}
|
12
12
|
{% else %}
|
13
|
-
<a href="{{ document.html }}">{{ document.
|
13
|
+
<a href="{{ document.html }}">{{ document.docid.id }}</a>
|
14
14
|
{% endif %}
|
15
15
|
</h{{ depth }}>
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div class="doc-type-wrap">
|
19
|
-
<div class="doc-type {{ document.
|
20
|
-
{{ document.
|
19
|
+
<div class="doc-type {{ document.type | downcase | split: " " | join: "-" }}">
|
20
|
+
{{ document.type }}
|
21
21
|
</div>
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -32,12 +32,12 @@
|
|
32
32
|
</h{{ depth | plus: 1 }}>
|
33
33
|
</div>
|
34
34
|
|
35
|
-
<div class="doc-info {{ document.stage | downcase }}">
|
36
|
-
<div class="doc-stage {{ document.stage | downcase }}">
|
37
|
-
{{ document.stage }}
|
35
|
+
<div class="doc-info {{ document.docstatus.stage | downcase }}">
|
36
|
+
<div class="doc-stage {{ document.docstatus.stage | downcase }}">
|
37
|
+
{{ document.docstatus.stage }}
|
38
38
|
</div>
|
39
39
|
<div class="doc-dates">
|
40
|
-
{% unless document.stage == "published" %}
|
40
|
+
{% unless document.docstatus.stage == "published" %}
|
41
41
|
<div class="doc-updated">
|
42
42
|
{% else %}
|
43
43
|
<div class="doc-published">
|
data/lib/relaton/cli/version.rb
CHANGED
@@ -61,7 +61,24 @@ module Relaton::Cli
|
|
61
61
|
|
62
62
|
# TODO: This should be recursive, but it's not
|
63
63
|
def hash_to_liquid(hash)
|
64
|
-
hash.map
|
64
|
+
hash.map do |key, value|
|
65
|
+
case key
|
66
|
+
when "title"
|
67
|
+
if value.is_a?(Array)
|
68
|
+
title = value.detect { |t| t["type"] == "main" } || value.first
|
69
|
+
v = title ? title["content"] : nil
|
70
|
+
elsif value.is_a?(Hash) then v = value["content"]
|
71
|
+
else v = value
|
72
|
+
end
|
73
|
+
when "docid"
|
74
|
+
if value.is_a?(Array)
|
75
|
+
v = value.detect { |did| did["id"] !~ /^(http|https):\/\// } || value.first
|
76
|
+
else v = value
|
77
|
+
end
|
78
|
+
else v = value
|
79
|
+
end
|
80
|
+
[key.to_s, empty2nil(v)]
|
81
|
+
end.to_h
|
65
82
|
end
|
66
83
|
|
67
84
|
def empty2nil(value)
|
data/templates/_document.liquid
CHANGED
@@ -16,8 +16,8 @@
|
|
16
16
|
</div>
|
17
17
|
|
18
18
|
<div class="doc-type-wrap">
|
19
|
-
<div class="doc-type {{ document.
|
20
|
-
{{ document.
|
19
|
+
<div class="doc-type {{ document.type | downcase | split: " " | join: "-" }}">
|
20
|
+
{{ document.type }}
|
21
21
|
</div>
|
22
22
|
</div>
|
23
23
|
</div>
|
@@ -32,12 +32,12 @@
|
|
32
32
|
</h{{ depth | plus: 1 }}>
|
33
33
|
</div>
|
34
34
|
|
35
|
-
<div class="doc-info {{ document.stage | downcase }}">
|
36
|
-
<div class="doc-stage {{ document.stage | downcase }}">
|
37
|
-
{{ document.stage }}
|
35
|
+
<div class="doc-info {{ document.docstatus.stage | downcase }}">
|
36
|
+
<div class="doc-stage {{ document.docstatus.stage | downcase }}">
|
37
|
+
{{ document.docstatus.stage }}
|
38
38
|
</div>
|
39
39
|
<div class="doc-dates">
|
40
|
-
{% unless document.stage == "published" %}
|
40
|
+
{% unless document.docstatus.stage == "published" %}
|
41
41
|
<div class="doc-updated">
|
42
42
|
{% else %}
|
43
43
|
<div class="doc-published">
|
data/templates/index-style.css
CHANGED
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: 0.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-03-
|
11
|
+
date: 2020-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|