ttl2html 0.0.3 → 0.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 0c95b74b2613072aae70c851b0e1b2567f119f94ad65941eb55f959b1dc8ddbb
4
- data.tar.gz: c2d7fc3598280fed3a810607676fbf90e17fe8dd643938cf7d317ff7653fde4e
2
+ SHA1:
3
+ metadata.gz: f138277b7b069fd7e9b123ff62628e0885b5b0fd
4
+ data.tar.gz: 9a1e0075aed0a48918f7fcc5c4dd89b79c547f0f
5
5
  SHA512:
6
- metadata.gz: d79903be0b615e45f728987f624d4bed6d9974b94862cdf1f13f325eb448446a22c298fa3aa5ad4b034a69c08b8fdc7a31b64f57fe49aa5cd1250fae6d5d6c96
7
- data.tar.gz: ee14d78dc2b449b28b759808d165435abb1b818441e04da8f77e63ebffd87392b8d1ced170e58cea68b886a51a52d95ef1717d0393079caadbf12c0d24a7442e
6
+ metadata.gz: a7f6e1b467af1da0d94cd66bfef2147cbb2ab4f4894f1a62157cb971d68f955bca2fe4104e7250106cc9fb326f4e1389a7a38e55da8b32e8223b9208789b417f
7
+ data.tar.gz: 31bafdcafc3f086127d9d1498580de69180077ed76b375f07cd9b7bd3c3e64ac423f184612a06c26b81841ae69655fc80a302b4846707348c08f3ef26e7d8f1f
@@ -1 +1 @@
1
- TTL2HTML::VERSION = "0.0.2"
1
+ TTL2HTML::VERSION = "0.0.4
data/lib/ttl2html.rb CHANGED
@@ -135,6 +135,17 @@ module TTL2HTML
135
135
  end
136
136
  template.output_to(file, param)
137
137
  end
138
+ index_html = File.join(@config[:output_dir], "index.html")
139
+ if @config.has_key? :top_class and not File.exist? index_html
140
+ template = Template.new("index.html.erb", @config)
141
+ param = @config.dup
142
+ param[:data_global] = @data
143
+ @graph.query([nil, RDF::URI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), nil]).subjects.sort.each do |subject|
144
+ param[:index_data] ||= []
145
+ param[:index_data] << subject.to_s
146
+ end
147
+ template.output_to(index_html, param)
148
+ end
138
149
  end
139
150
  def output_turtle_files
140
151
  each_data do |uri, v|
@@ -165,6 +176,10 @@ module TTL2HTML
165
176
  ttl_file = File.join(@config[:output_dir], ttl_file) if @config[:output_dir]
166
177
  File.unlink ttl_file
167
178
  end
179
+ index_html = File.join(@config[:output_dir], "index.html")
180
+ if @config[:top_class] and File.exist? index_html
181
+ File.unlink index_html
182
+ end
168
183
  end
169
184
  end
170
185
  end
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  </div>
14
14
  <% if param[:data_inverse] %>
15
- <div class="row">
15
+ <div class="row inverse">
16
16
  <div class="col-md-12">
17
17
  <h2>被参照情報</h2>
18
18
  <%= format_triples(param[:data_inverse]) %>
@@ -0,0 +1,18 @@
1
+ <div class="jumbotron">
2
+ <div class="container">
3
+ <h1><%=h param[:site_title] %></h1>
4
+ <p><small><span class="glyphicon glyphicon-link"></span> <a href="<%=h param[:base_uri] %>"><%=h param[:base_uri] %></a></small></p>
5
+ </div>
6
+ </div>
7
+ <div class="container">
8
+ <div class="row">
9
+ <div class="col-md-12">
10
+ <h2><%=h param[:class_label] %> 一覧</h2>
11
+ <ul>
12
+ <% param[:index_data].each do |e| %>
13
+ <li><%= format_object(e, param[:data_global]) %></li>
14
+ <% end %>
15
+ </ul>
16
+ </div>
17
+ </div>
18
+ </div>
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: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masao Takaku
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-02-20 00:00:00.000000000 Z
11
+ date: 2020-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri
@@ -106,6 +106,7 @@ files:
106
106
  - lib/ttl2html/template.rb
107
107
  - lib/ttl2html/version.rb
108
108
  - templates/default.html.erb
109
+ - templates/index.html.erb
109
110
  - templates/layout.html.erb
110
111
  - templates/triples.html.erb
111
112
  homepage: https://github.com/masao/ttl2html
@@ -127,7 +128,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
128
  - !ruby/object:Gem::Version
128
129
  version: '0'
129
130
  requirements: []
130
- rubygems_version: 3.1.2
131
+ rubyforge_project:
132
+ rubygems_version: 2.6.14.4
131
133
  signing_key:
132
134
  specification_version: 4
133
135
  summary: ttl2html