ttl2html 2.0.1 → 2.0.3

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: 858625044e6a0e9ff78bacc944b6aebb8dc4fb95f07cda76d3eab790d0602163
4
- data.tar.gz: 0d514bacd1ddd635dfa36ca7aca8e74b2a5ff78e15b16e21a2124eaa04660e40
3
+ metadata.gz: 3014009aab356311f3f36ff39087b63af87dc81a97d72ad34a74c4a685fd810a
4
+ data.tar.gz: 9f55838aee5811144d539ac036567803dbd34005335e6ab1762aef8c152c772b
5
5
  SHA512:
6
- metadata.gz: 9958babbf93cd931926e4f56cc348fe16130f908a324d1978cd2d2f35c9ebca2646c4b86fa9ef97365377cb4ca23e7365f460e024207a3ccef8439fb545cde92
7
- data.tar.gz: ceb241313491e6b67c633aa235c9bc74c5e2bf76fc6b4bc1479c9874e9aed07995f0655da48e2e29e36a4a22dc5efa14476e4394fce5b7465a3a3ef759f9990b
6
+ metadata.gz: 2d6756b3c78a0b13516475c11884e4c5f86e2945046101504e4810dbf83210d6d3c679eae74a8ac841d1e44cec3908e5c05364d9b5b606a1058d40af356b949f
7
+ data.tar.gz: 7b5b6c0d6c131e2a883e0781af9b11d999e1f35918e0b012a83ad926bf52621a1fd62be76620922800ebe27d0155fc547ddb5a49ff3eb1fc4f18804fd3925421
@@ -128,8 +128,13 @@ module TTL2HTML
128
128
  src = @param[:output_file]
129
129
  src = Pathname.new(src).relative_path_from(Pathname.new(@param[:output_dir])) if @param[:output_dir]
130
130
  path = Pathname(dest).relative_path_from(Pathname(File.dirname src))
131
- path = path.to_s + "/" if File.directory? path
131
+ if @param[:output_dir] and File.directory?(Pathname.new(@param[:output_dir]) + path)
132
+ path = path.to_s + "/"
133
+ elsif File.directory?(path)
134
+ path = path.to_s + "/"
135
+ end
132
136
  end
137
+ #p [ :relative_path, path, dest, src ]
133
138
  path
134
139
  end
135
140
  def relative_path_uri(dest_uri, base_uri = @param[:base_uri])
@@ -152,8 +157,8 @@ module TTL2HTML
152
157
  titles.compact.join(" - ")
153
158
  end
154
159
  def shorten_title(title, length = 140)
155
- if title.length > length
156
- title[0..length] + "..."
160
+ if title.to_s.length > length
161
+ title.to_s[0..length] + "..."
157
162
  else
158
163
  title
159
164
  end
@@ -182,14 +187,15 @@ module TTL2HTML
182
187
  default_title
183
188
  end
184
189
  def get_language_literal(object)
185
- if object.respond_to? :has_key?
186
- if object.has_key?(I18n.locale)
187
- object[I18n.locale]
190
+ if object.is_a? Array
191
+ object_lang = object.select do |e|
192
+ e.language? and e.language == I18n.locale
193
+ end
194
+ if not object_lang.empty?
195
+ object_lang.first
188
196
  else
189
- object.values.first
197
+ object.first
190
198
  end
191
- elsif object.is_a? Array
192
- object.first
193
199
  else
194
200
  object
195
201
  end
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "2.0.1"
1
+ TTL2HTML::VERSION = "2.0.3"
data/lib/ttl2html.rb CHANGED
@@ -30,6 +30,11 @@ module TTL2HTML
30
30
  config[k.intern] = v
31
31
  end
32
32
  end
33
+ [ :css_file, :javascript_file ].each do |k|
34
+ if config[k]
35
+ config[k] = [ config[k] ].flatten
36
+ end
37
+ end
33
38
  config
34
39
  end
35
40
 
@@ -48,17 +53,14 @@ module TTL2HTML
48
53
  o = statement.object
49
54
  count += 1
50
55
  @data[s.to_s] ||= {}
51
- if o.respond_to?(:has_language?) and o.has_language?
52
- @data[s.to_s][v.to_s] ||= {}
53
- @data[s.to_s][v.to_s][o.language] = o.to_s
54
- else
55
- @data[s.to_s][v.to_s] ||= []
56
- @data[s.to_s][v.to_s] << o.to_s
57
- end
56
+ @data[s.to_s][v.to_s] ||= []
58
57
  if o.is_a? RDF::URI or o.is_a? RDF::Node
58
+ @data[s.to_s][v.to_s] << o.to_s
59
59
  @data_inverse[o.to_s] ||= {}
60
60
  @data_inverse[o.to_s][v.to_s] ||= []
61
61
  @data_inverse[o.to_s][v.to_s] << s.to_s
62
+ else
63
+ @data[s.to_s][v.to_s] << o
62
64
  end
63
65
  end
64
66
  @prefix.merge! reader.prefixes
@@ -112,10 +114,12 @@ module TTL2HTML
112
114
  progressbar = ProgressBar.create(title: label,
113
115
  total: @data.size,
114
116
  format: "(%t) %a %e %P% Processed: %c from %C")
115
- @data.each do |uri, v|
117
+ @data.keys.sort_by do|uri|
118
+ [ uri.count("/"), uri.size, uri ]
119
+ end.reverse_each do |uri|
116
120
  progressbar.increment
117
121
  next if not uri.start_with? @config[:base_uri]
118
- yield uri, v
122
+ yield uri, @data[uri]
119
123
  end
120
124
  progressbar.finish
121
125
  end
@@ -233,10 +237,12 @@ module TTL2HTML
233
237
  else
234
238
  label = template.get_title(@data[subject.to_s])
235
239
  end
240
+ html = template.expand_shape(@data, subject.to_s, @prefix)
241
+ next if html.nil?
236
242
  param[:shapes][subject] = {
237
243
  label: label,
238
244
  comment: comment,
239
- html: template.expand_shape(@data, subject.to_s, @prefix),
245
+ html: html,
240
246
  target_class: target_class,
241
247
  order: orders,
242
248
  }
@@ -342,6 +348,37 @@ module TTL2HTML
342
348
  orders
343
349
  end
344
350
 
351
+ def extract_version_metadata(data)
352
+ description = data["http://purl.org/dc/terms/description"]
353
+ link = nil
354
+ if not description
355
+ qrev = data["http://www.w3.org/ns/prov#qualifiedRevision"]&.first
356
+ if @data[qrev]
357
+ description = @data[qrev]["http://www.w3.org/2000/01/rdf-schema#comment"]
358
+ link = @data[qrev]["http://www.w3.org/2000/01/rdf-schema#seeAlso"]&.first
359
+ end
360
+ end
361
+ subset = []
362
+ if data["http://rdfs.org/ns/void#subset"]
363
+ data["http://rdfs.org/ns/void#subset"].each do |s|
364
+ abort "#{s} not found" if not @data[s]
365
+ subset << extract_version_metadata(@data[s])
366
+ end
367
+ end
368
+ date = data["http://purl.org/pav/createdOn"]&.first
369
+ date = data["http://purl.org/dc/terms/issued"]&.first if date.nil?
370
+ return {
371
+ version: data["http://purl.org/pav/version"]&.first,
372
+ triples: data["http://rdfs.org/ns/void#triples"]&.first,
373
+ datadump: data["http://rdfs.org/ns/void#dataDump"]&.first,
374
+ bytesize: data["http://www.w3.org/ns/dcat#byteSize"]&.first,
375
+ date: date,
376
+ description: description,
377
+ subset: subset,
378
+ link: link,
379
+ license: extract_license(data),
380
+ }
381
+ end
345
382
  def extract_versions
346
383
  versions = []
347
384
  ["http://purl.org/pav/hasVersion", "http://purl.org/pav/hasCurrentVersion", "http://purl.org/dc/terms/hasVersion"].each do |prop|
@@ -357,37 +394,24 @@ module TTL2HTML
357
394
  next if not version
358
395
  next if not version["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"]
359
396
  next if not version["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"].include? "http://rdfs.org/ns/void#Dataset"
360
- description = version["http://purl.org/dc/terms/description"]
361
- link = nil
362
- if not description
363
- qrev = version["http://www.w3.org/ns/prov#qualifiedRevision"]&.first
364
- if @data[qrev]
365
- description = @data[qrev]["http://www.w3.org/2000/01/rdf-schema#comment"]
366
- link = @data[qrev]["http://www.w3.org/2000/01/rdf-schema#seeAlso"]&.first
367
- end
368
- end
369
- subset = []
370
- if version["http://rdfs.org/ns/void#subset"]
371
- version["http://rdfs.org/ns/void#subset"].each do |s|
372
- subset << @data[s]["http://rdfs.org/ns/void#dataDump"].first
373
- end
374
- end
375
- date = version["http://purl.org/pav/createdOn"]&.first
376
- date = version["http://purl.org/dc/terms/issued"]&.first if date.nil?
377
- versions << {
378
- uri: uri,
379
- version: version["http://purl.org/pav/version"]&.first,
380
- triples: version["http://rdfs.org/ns/void#triples"]&.first,
381
- datadump: version["http://rdfs.org/ns/void#dataDump"]&.first,
382
- bytesize: version["http://www.w3.org/ns/dcat#byteSize"]&.first,
383
- date: date,
384
- description: description,
385
- subset: subset,
386
- link: link,
387
- }
397
+ versions << extract_version_metadata(version)
388
398
  end
389
399
  end
390
- versions.sort_by{|v| [ v[:date], v[:uri] ] }
400
+ versions.sort_by{|v| [ v[:date], v[:version] ] }
401
+ end
402
+ def extract_license(data)
403
+ license = {}
404
+ if data["http://purl.org/dc/terms/license"]
405
+ license_data = @data[data["http://purl.org/dc/terms/license"].first]
406
+ if license_data
407
+ license[:url] = license_data["http://www.w3.org/1999/02/22-rdf-syntax-ns#value"]&.first
408
+ license[:icon] = license_data["http://xmlns.com/foaf/0.1/thumbnail"]&.first
409
+ license[:label] = license_data["http://www.w3.org/2000/01/rdf-schema#label"]
410
+ elsif data["http://purl.org/dc/terms/license"].first =~ URI::regexp
411
+ license[:url] = license[:label] = data["http://purl.org/dc/terms/license"].first
412
+ end
413
+ end
414
+ license
391
415
  end
392
416
  def extract_toplevel
393
417
  result = {}
@@ -399,17 +423,7 @@ module TTL2HTML
399
423
  end
400
424
  data = @data[toplevel.to_s]
401
425
  if toplevel
402
- license = {}
403
- if data["http://purl.org/dc/terms/license"]
404
- license_data = @data[data["http://purl.org/dc/terms/license"].first]
405
- if license_data
406
- license[:url] = license_data["http://www.w3.org/1999/02/22-rdf-syntax-ns#value"]&.first
407
- license[:icon] = license_data["http://xmlns.com/foaf/0.1/thumbnail"]&.first
408
- license[:label] = license_data["http://www.w3.org/2000/01/rdf-schema#label"]
409
- elsif data["http://purl.org/dc/terms/license"].first =~ URI::regexp
410
- license[:url] = license[:label] = data["http://purl.org/dc/terms/license"].first
411
- end
412
- end
426
+ license = extract_license(data)
413
427
  if data["http://purl.org/dc/terms/publisher"]
414
428
  publisher_data = @data[data["http://purl.org/dc/terms/publisher"].first]
415
429
  email = publisher_data["http://xmlns.com/foaf/0.1/mbox"]&.first
data/locales/en.yml CHANGED
@@ -12,6 +12,7 @@ en:
12
12
  contact: Contact
13
13
  contact-contribution: "This dataset was developed by %{name}"
14
14
  contact-email: "For dataset inquiries, please contact at <a href=\"%{email}\">%{email}</a>"
15
+ toc: Table of Contents
15
16
  default:
16
17
  details: Details
17
18
  inverse_data: Referred resources
@@ -20,6 +21,8 @@ en:
20
21
  latest-news: "Latest news"
21
22
  past-versions: "Past versions"
22
23
  license-text: "This dataset is freely usable as <a href=\"%{url}\">%{label}</a>"
24
+ dataset:
25
+ license-text: "This dataset is freely usable as <a href=\"%{url}\">%{label}</a>"
23
26
  layout:
24
27
  rdf-data: RDF data
25
28
  shape-table:
data/locales/ja.yml CHANGED
@@ -12,6 +12,7 @@ ja:
12
12
  contact: 連絡先
13
13
  contact-contribution: "本データセットは %{name} が開発したものです"
14
14
  contact-email: "データセットに関する問い合わせは <a href=\"%{email}\">%{email}</a> までお問い合わせください。"
15
+ toc: 目次
15
16
  default:
16
17
  details: 詳細情報
17
18
  inverse_data: 被参照情報
@@ -20,6 +21,8 @@ ja:
20
21
  latest-news: 最新のお知らせ
21
22
  past-versions: 過去の更新履歴
22
23
  license-text: "このデータセットは<a href=\"%{url}\">%{label}</a>として自由に利用できます。"
24
+ dataset:
25
+ license-text: "<a href=\"%{url}\">%{label}</a>として自由に利用できます"
23
26
  layout:
24
27
  rdf-data: RDFデータ
25
28
  shape-table:
@@ -17,19 +17,21 @@
17
17
  </nav>
18
18
  </div>
19
19
  </div>
20
- <%- if param[:content] -%>
21
20
  <div class="row">
22
- <div class="col-md">
23
- <%= param[:content] %>
21
+ <%- if @template == "about.html.erb" and param[:about_toc] -%>
22
+ <div class="col-md-2 order-12">
23
+ <h2 data-toc-skip><%=h t('about.toc') %></h2>
24
+ <nav id="toc" data-toggle="toc" class="sticky-top"></nav>
24
25
  </div>
25
- </div>
26
- <%- end -%>
27
- <%- if param[:shapes].size > 0 -%>
28
- <div class="row">
26
+ <%- end -%>
29
27
  <div class="col-md">
28
+ <%- if param[:content] -%>
29
+ <%= param[:content] %>
30
+ <%- end -%>
31
+ <%- if param[:shapes].size > 0 -%>
30
32
  <h2 id="shapes"><%=h t("about.shape-heading") %></h2>
31
33
  <%- param[:shapes].keys.sort_by{|k| param[:shapes][k][:order] }.each do |shape| -%>
32
- <h3><%=h param[:shapes][shape][:label] %></h3>
34
+ <h3 id="<%=h relative_path_uri(shape) %>"><%=h param[:shapes][shape][:label] %></h3>
33
35
  <%- if param[:shapes][shape][:target_class] -%>
34
36
  <ul><li><%= t("about.shape-target") %>: <a href="<%=h param[:shapes][shape][:target_class] %>"><%=h param[:shapes][shape][:target_class] %></a></li></ul>
35
37
  <%- end -%>
@@ -37,24 +39,16 @@
37
39
  <p><%=h t("about.shape-note", resource: param[:shapes][shape][:label]) %></p>
38
40
  <%= param[:shapes][shape][:html] -%>
39
41
  <%- end -%>
40
- </div>
41
- </div>
42
- <%- end -%>
43
- <%- if param[:versions].size > 0 -%>
44
- <div class="row">
45
- <div class="col-md">
42
+ <%- end -%>
43
+ <%- if param[:versions].size > 0 -%>
46
44
  <h2 id="versions"><%=h t("about.versions") %> <i class="bi bi-info-circle"></i></h2>
47
45
  <dl>
48
46
  <%- param[:versions].reverse_each do |version| -%>
49
47
  <%= format_version_info(version) %>
50
48
  <%- end -%>
51
49
  </dl>
52
- </div>
53
- </div>
54
- <%- end -%>
55
- <%- if param[:toplevel] and param[:toplevel][:contact] -%>
56
- <div class="row">
57
- <div class="col-md">
50
+ <%- end -%>
51
+ <%- if param[:toplevel] and param[:toplevel][:contact] -%>
58
52
  <h2 id="contact"><%=h t("about.contact") %></h2>
59
53
  <%- if param[:toplevel][:contact][:name] -%>
60
54
  <p><%=h t("about.contact-contribution", name: get_language_literal(param[:toplevel][:contact][:name])) %></p>
@@ -72,7 +66,7 @@
72
66
  <%- if param[:toplevel][:contact][:email] -%>
73
67
  <p><%= t("about.contact-email", email: param[:toplevel][:contact][:email]) %></p>
74
68
  <%- end -%>
69
+ <%- end -%>
75
70
  </div>
76
71
  </div>
77
- <%- end -%>
78
- </div>
72
+ </div>
@@ -0,0 +1,35 @@
1
+ <%- if param[:datadump] -%>
2
+ <li><a href="<%=h param[:datadump] %>"><%=h File.basename(param[:datadump]) %></a>
3
+ <%-
4
+ fileinfo = []
5
+ if param[:triples]
6
+ fileinfo << t("about.version-triples", triples: number_with_delimiter(param[:triples].to_i))
7
+ end
8
+ if param[:bytesize]
9
+ fileinfo << number_to_human_size(param[:bytesize])
10
+ end
11
+ -%>
12
+ <%- if fileinfo.size > 0 -%>
13
+ (<%=h fileinfo.join(", ") %>)
14
+ <%- end -%>
15
+ <%- if not param[:license].empty? -%>
16
+ <span class="license">
17
+ <%- if param[:license][:icon] -%>
18
+ <a href="<%=h param[:license][:url] %>"><img src="<%=h param[:license][:icon] %>"></a>
19
+ <%- end -%>
20
+ <%= t("dataset.license-text", label: get_language_literal(param[:license][:label]), url: param[:license][:url]) %>
21
+ </span>
22
+ <%- end -%>
23
+ <%- if param[:subset].size > 0 -%>
24
+ <ul>
25
+ <%- param[:subset].each do |subset| -%>
26
+ <%= to_html_raw("dataset.html.erb", subset) %>
27
+ <%- end -%>
28
+ </ul>
29
+ <%- end -%>
30
+ </li>
31
+ <%- elsif param[:subset].size > 0 -%>
32
+ <%- param[:subset].each do |subset| -%>
33
+ <%= to_html_raw("dataset.html.erb", subset) %>
34
+ <%- end -%>
35
+ <%- end -%>
@@ -20,7 +20,7 @@
20
20
  <%- if param[:versions].size > 1 -%>
21
21
  <p><a href="about#versions">&raquo; <%=h t("index.past-versions") %></a></p>
22
22
  <%- end -%>
23
- <%- if param[:toplevel] and param[:toplevel][:license] -%>
23
+ <%- if param[:toplevel] and not param[:toplevel][:license].empty? -%>
24
24
  <p>
25
25
  <%- if param[:toplevel][:license][:icon] -%>
26
26
  <a href="<%=h param[:toplevel][:license][:url] %>"><img src="<%=h param[:toplevel][:license][:icon] %>"></a>
@@ -5,9 +5,12 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
6
6
  <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
7
7
  <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.7.1/font/bootstrap-icons.css">
8
- <%- if param[:css_file] -%>
9
- <link rel="stylesheet" href="<%=h relative_path(param[:css_file]) %>">
8
+ <%- if @template == "about.html.erb" and param[:about_toc] -%>
9
+ <link rel="stylesheet" href="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.css">
10
10
  <%- end -%>
11
+ <%- param[:css_file].each do |file| -%>
12
+ <link rel="stylesheet" href="<%=h relative_path(file) %>">
13
+ <%- end if param[:css_file] -%>
11
14
  <%- if param[:custom_css] -%>
12
15
  <style type="text/css"><%=h param[:custom_css] %></style>
13
16
  <%- end -%>
@@ -32,7 +35,7 @@
32
35
  </script>
33
36
  <%- end -%>
34
37
  </head>
35
- <body>
38
+ <body<%= ' data-spy="scroll" data-target="#toc"' if @template == "about.html.erb" and param[:about_toc] %>>
36
39
  <nav class="navbar navbar-expand-lg <%=h param[:navbar_class] || "navbar-light" %>">
37
40
  <%- if param[:logo] -%>
38
41
  <a class="navbar-brand" href="<%=h relative_path_uri(param[:base_uri]) %>">
@@ -78,8 +81,11 @@
78
81
  <script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
79
82
  <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
80
83
  <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>
81
- <%- if param[:javascript_file] -%>
82
- <script src="<%=h relative_path(param[:javascript_file]) %>"></script>
84
+ <%- if @template == "about.html.erb" and param[:about_toc] -%>
85
+ <script src="https://cdn.rawgit.com/afeld/bootstrap-toc/v1.0.1/dist/bootstrap-toc.min.js"></script>
83
86
  <%- end -%>
87
+ <%- param[:javascript_file].each do |file| -%>
88
+ <script src="<%=h relative_path(file) %>"></script>
89
+ <%- end if param[:javascript_file] -%>
84
90
  </body>
85
91
  </html>
@@ -1,20 +1,22 @@
1
- <dl class="row">
1
+ <dl class="row<%= if param[:type][:blank] then ' border' end %>">
2
2
  <%- param[:data].sort_by{|k, v|
3
3
  order = param[:orders][k] if param[:orders] and param[:orders][k]
4
4
  order = Float::INFINITY if order.nil?
5
5
  [ order, k ]
6
6
  }.each do |k, v| -%>
7
7
  <dt class="col-sm-3"><%=h format_property(k, param[:labels]) %></dt>
8
- <%- if v.respond_to? :has_key? -%>
9
- <%- v.each_with_index do |v2, idx| -%>
10
- <dd class="col-sm-9<%= ' offset-sm-3' if idx > 0 %>" lang="<%=h v2[0] %>"><%= format_object v2[1], param[:data], param[:type] %></dd>
11
- <%- end -%>
12
- <%- elsif v.size > 1 -%>
13
- <%- v.each_with_index do |v2, idx| -%>
8
+ <%- v.sort_by{|e|
9
+ if e =~ /\A_:/ and param[:data_global][e]
10
+ param[:data_global][e].to_s
11
+ else
12
+ e
13
+ end
14
+ }.each_with_index do |v2, idx| -%>
15
+ <%- if v2.respond_to? :language and v2.language? -%>
16
+ <dd class="col-sm-9<%= ' offset-sm-3' if idx > 0 %>" lang="<%=h v2.language %>"><%= format_object v2, param[:data], param[:type] %></dd>
17
+ <%- else -%>
14
18
  <dd class="col-sm-9<%= ' offset-sm-3' if idx > 0 %>"><%= format_object v2, param[:data], param[:type] %></dd>
19
+ <%- end -%>
15
20
  <%- end -%>
16
- <%- else -%>
17
- <dd class="col-sm-9"><%= format_object v.first, param[:data], param[:type] %></dd>
18
- <%- end -%>
19
21
  <%- end -%>
20
22
  </dl>
@@ -1,32 +1,10 @@
1
1
  <dt><%=h param[:data][:date] %></dt>
2
2
  <dd><%=h t("about.version-release", version: param[:data][:version]) %></dd>
3
- <dd><%=h get_language_literal(param[:data][:description]) %>
3
+ <dd><%= get_language_literal(param[:data][:description]) %>
4
4
  <%- if param[:data][:link] -%>
5
5
  <%= t("about.version-link", link: param[:data][:link]) %>
6
6
  <%- end -%>
7
7
  </dd>
8
- <%- if param[:data][:datadump] -%>
9
- <dd><ul>
10
- <li><a href="<%=h param[:data][:datadump] %>"><%=h File.basename(param[:data][:datadump]) %></a>
11
- <%-
12
- fileinfo = []
13
- if param[:data][:triples]
14
- fileinfo << t("about.version-triples", triples: number_with_delimiter(param[:data][:triples].to_i))
15
- end
16
- if param[:data][:bytesize]
17
- fileinfo << number_to_human_size(param[:data][:bytesize])
18
- end
19
- -%>
20
- <%- if fileinfo.size > 0 -%>
21
- (<%=h fileinfo.join(", ") %>)
22
- <%- end -%>
23
- <%- if param[:data][:subset].size > 0 -%>
24
- <ul>
25
- <%- param[:data][:subset].each do |subset| -%>
26
- <li><a href="<%=h subset %>"><%=h File.basename(subset) %></a></li>
27
- <%- end -%>
28
- </ul>
29
- </li>
30
- <%- end -%>
31
- </ul></dd>
32
- <%- end -%>
8
+ <%- if param[:data][:dataDump] or param[:data][:subset] -%>
9
+ <dd><ul><%= to_html_raw("dataset.html.erb", param[:data]) %></ul></dd>
10
+ <%- end -%>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ttl2html
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.1
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masao Takaku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-08-27 00:00:00.000000000 Z
11
+ date: 2022-10-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -156,6 +156,7 @@ files:
156
156
  - locales/en.yml
157
157
  - locales/ja.yml
158
158
  - templates/about.html.erb
159
+ - templates/dataset.html.erb
159
160
  - templates/default.html.erb
160
161
  - templates/index-list.html.erb
161
162
  - templates/index.html.erb