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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9da6c727a7b4f3bc908bfdf55bd193031658692f31bcf9696dab25e304a46049
4
- data.tar.gz: a0f8aca569ff13335574f9580544ac275a9a9f465c311c66d6bf2d4121da4884
3
+ metadata.gz: 42ec0e9f67c99d26c92c2064a3f650b36884507be4ef71fb44cb5b2b106e7196
4
+ data.tar.gz: 2736894c47c5a0d82e8f685f8b83c62c75bf2aa5b0e1abb22304214ded35070e
5
5
  SHA512:
6
- metadata.gz: '08e5e8e13d9734b8f9e0fcbed5f7e541128f73cc65435fb819256be0658601caff498c3bb72a1be77288956bd434ab08c433c09c094961f435544bd14fe7424a'
7
- data.tar.gz: '01469ce2191c15337a194f0945486d2994d63c93dd5789f7e5673d8ba910c314e887792e99def4e346c8a75c63acd1ae44525bf4571acecadac663c548cd6901'
6
+ metadata.gz: ed58412eb9699c5d163dc6261671d54dd4cbc811132793963f999e310ad216278f1f2e7bccd4945c0a5b43c7aca054e80ea520a7293013e416cf4522d539f437
7
+ data.tar.gz: 02e555000e067bd3b23f41f4018fa6e2601377b520ec465c191dea6123c450ee57db0c8f0257847c72352f77ef0255d4e91d4fb72f605c16d59f5b6d19ab540b
@@ -111,6 +111,5 @@ module Relaton
111
111
 
112
112
  { "root" => a }
113
113
  end
114
-
115
114
  end
116
115
  end
@@ -61,7 +61,7 @@ module Relaton
61
61
  end
62
62
 
63
63
  def to_h
64
- URL_TYPES.reduce(@bibitem.to_hash) do |h, t|
64
+ URL_TYPES.reduce({ items: [] }.merge(@bibitem.to_hash)) do |h, t|
65
65
  value = self.send t
66
66
  h[t.to_s] = value
67
67
  h
@@ -8,16 +8,16 @@
8
8
  <div class="doc-identifier">
9
9
  <h{{ depth }}>
10
10
  {% if document.html == "" %}
11
- {{ document.docidentifier }}
11
+ {{ document.docid.id }}
12
12
  {% else %}
13
- <a href="{{ document.html }}">{{ document.docidentifier }}</a>
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.doctype | downcase | split: " " | join: "-" }}">
20
- {{ document.doctype }}
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">
@@ -1,5 +1,5 @@
1
1
  module Relaton
2
2
  module Cli
3
- VERSION = "0.8.2".freeze
3
+ VERSION = "0.8.7".freeze
4
4
  end
5
5
  end
@@ -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 { |key, value| [key.to_s, empty2nil(value)] }.to_h
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)
@@ -16,8 +16,8 @@
16
16
  </div>
17
17
 
18
18
  <div class="doc-type-wrap">
19
- <div class="doc-type {{ document.doctype | downcase | split: " " | join: "-" }}">
20
- {{ document.doctype }}
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">
@@ -757,7 +757,7 @@ body.container {
757
757
  }
758
758
 
759
759
  .doc-line {
760
- padding-top: 1em;
760
+ padding-top: 2em;
761
761
  }
762
762
 
763
763
  .doc-line:after {
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.2
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-05 00:00:00.000000000 Z
11
+ date: 2020-03-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake