ttl2html 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +15 -0
- data/templates/default.html.erb +1 -1
- data/templates/index.html.erb +18 -0
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: f138277b7b069fd7e9b123ff62628e0885b5b0fd
|
4
|
+
data.tar.gz: 9a1e0075aed0a48918f7fcc5c4dd89b79c547f0f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7f6e1b467af1da0d94cd66bfef2147cbb2ab4f4894f1a62157cb971d68f955bca2fe4104e7250106cc9fb326f4e1389a7a38e55da8b32e8223b9208789b417f
|
7
|
+
data.tar.gz: 31bafdcafc3f086127d9d1498580de69180077ed76b375f07cd9b7bd3c3e64ac423f184612a06c26b81841ae69655fc80a302b4846707348c08f3ef26e7d8f1f
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "0.0.
|
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
|
data/templates/default.html.erb
CHANGED
@@ -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.
|
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-
|
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
|
-
|
131
|
+
rubyforge_project:
|
132
|
+
rubygems_version: 2.6.14.4
|
131
133
|
signing_key:
|
132
134
|
specification_version: 4
|
133
135
|
summary: ttl2html
|