ttl2html 2.2.1 → 2.2.2
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 +4 -4
- data/lib/ttl2html/version.rb +1 -1
- data/lib/ttl2html.rb +8 -3
- data/templates/index.html.erb +5 -3
- data/templates/layout.html.erb +7 -5
- data/templates/shape-table.html.erb +2 -0
- 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: 13f4951cbe8d12cf99dd6563a2facae07c180d8e48bbab595f3cce942cf1da0f
|
4
|
+
data.tar.gz: 8232fb9eb944019274b5323cf44739ee147b032b60358d8e894a8daa36ab551f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c31c198f569f638e9ab5007f9776cb979144464b6be6e3f21601b07a098559af1b50d97e7eed1e77958c7240eefd3ae49e422bf7f54738a6f957ee868d9f2fd1
|
7
|
+
data.tar.gz: 8ad682b50a9cd60843d52a503fa7ffbd2a4359553d254c0c7721587d1d371c36cc533da5188c9135b411ec5f0c9c5c12aa2cc23d9bf65b0448e626a264891508
|
data/lib/ttl2html/version.rb
CHANGED
@@ -1 +1 @@
|
|
1
|
-
TTL2HTML::VERSION = "2.2.
|
1
|
+
TTL2HTML::VERSION = "2.2.2"
|
data/lib/ttl2html.rb
CHANGED
@@ -34,7 +34,7 @@ module TTL2HTML
|
|
34
34
|
end
|
35
35
|
[ :css_file, :javascript_file ].each do |k|
|
36
36
|
if config[k]
|
37
|
-
config[k] =
|
37
|
+
config[k] = Array(config[k]).flatten
|
38
38
|
end
|
39
39
|
end
|
40
40
|
config
|
@@ -152,6 +152,8 @@ module TTL2HTML
|
|
152
152
|
labels = shapes2labels(shapes)
|
153
153
|
versions = extract_versions
|
154
154
|
toplevel = extract_toplevel
|
155
|
+
about_required = template.find_template_path("about.html") || !shapes.empty? || !versions.empty? || !toplevel.empty?
|
156
|
+
about_file = (@config[:about_file] || "about.html") if about_required
|
155
157
|
@config[:labels_with_class] ||= {}
|
156
158
|
labels.each do |klass, props|
|
157
159
|
props.each do |property, label|
|
@@ -188,6 +190,7 @@ module TTL2HTML
|
|
188
190
|
if template.find_template_path("_default.html.erb")
|
189
191
|
param[:additional_content] = template.to_html_raw("_default.html.erb", param)
|
190
192
|
end
|
193
|
+
param[:about_file] = about_file if about_required
|
191
194
|
template.output_to(file, param)
|
192
195
|
end
|
193
196
|
index_html = "index.html"
|
@@ -226,14 +229,16 @@ module TTL2HTML
|
|
226
229
|
end
|
227
230
|
param[:output_file] = index_html
|
228
231
|
param[:index_list] = template.to_html_raw("index-list.html.erb", param)
|
232
|
+
param[:about_file] = about_file if about_required
|
229
233
|
template.output_to(index_html, param)
|
230
234
|
end
|
231
235
|
end
|
232
|
-
if
|
233
|
-
about_html =
|
236
|
+
if about_required
|
237
|
+
about_html = about_file
|
234
238
|
about_html = File.join(@config[:output_dir], about_html) if @config[:output_dir]
|
235
239
|
template = Template.new("about.html.erb", @config)
|
236
240
|
param = @config.dup
|
241
|
+
param[:about_file] = about_file
|
237
242
|
param[:content] = template.to_html_raw("about.html", {}) if template.find_template_path("about.html")
|
238
243
|
param[:data_global] = @data
|
239
244
|
param[:versions] = versions
|
data/templates/index.html.erb
CHANGED
@@ -8,7 +8,9 @@
|
|
8
8
|
<div class="description"><%= param[:description] %></div>
|
9
9
|
<%- end -%>
|
10
10
|
<p><i class="bi bi-link-45deg"></i> <a href="<%=h param[:base_uri] %>"><%=h param[:base_uri] %></a></p>
|
11
|
-
|
11
|
+
<%- if param[:about_file] -%>
|
12
|
+
<p><a class="btn btn-info" href="<%=h relative_path(param[:about_file]) %>"><%=h t("about.title", title: param[:site_title]) %> »</a></p>
|
13
|
+
<%- end -%>
|
12
14
|
</div>
|
13
15
|
</div>
|
14
16
|
<div class="container">
|
@@ -20,8 +22,8 @@
|
|
20
22
|
<dl>
|
21
23
|
<%= format_version_info(param[:versions].last) %>
|
22
24
|
</dl>
|
23
|
-
<%- if param[:versions].size > 1 -%>
|
24
|
-
<p><a href="
|
25
|
+
<%- if param[:about_file] and param[:versions].size > 1 -%>
|
26
|
+
<p><a href="<%=h relative_path(param[:about_file]) %>#versions">» <%=h t("index.past-versions") %></a></p>
|
25
27
|
<%- end -%>
|
26
28
|
<%- if param[:toplevel] and not param[:toplevel][:license].empty? -%>
|
27
29
|
<p class="license">
|
data/templates/layout.html.erb
CHANGED
@@ -8,9 +8,9 @@
|
|
8
8
|
<%- if @template == "about.html.erb" and param[:about_toc] -%>
|
9
9
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc/dist/bootstrap-toc.min.css">
|
10
10
|
<%- end -%>
|
11
|
-
<%- param[:css_file].each do |file| -%>
|
11
|
+
<%- Array(param[:css_file]).each do |file| -%>
|
12
12
|
<link rel="stylesheet" href="<%=h relative_path(file) %>">
|
13
|
-
<%- end
|
13
|
+
<%- end -%>
|
14
14
|
<%- if param[:custom_css] -%>
|
15
15
|
<style type="text/css"><%=h param[:custom_css] %></style>
|
16
16
|
<%- end -%>
|
@@ -63,9 +63,11 @@
|
|
63
63
|
<li class="nav-item<%= ' active' if @template == "index.html.erb" %>">
|
64
64
|
<a class="nav-link" href="<%=h relative_path_uri(param[:base_uri]) %>">Home</a>
|
65
65
|
</li>
|
66
|
+
<%- if param[:about_file] -%>
|
66
67
|
<li class="nav-item<%= ' active' if @template == "about.html.erb" %>">
|
67
|
-
<a class="nav-link" href="<%=h relative_path(param[:about_file]
|
68
|
+
<a class="nav-link" href="<%=h relative_path(param[:about_file]) %>">About</a>
|
68
69
|
</li>
|
70
|
+
<%- end -%>
|
69
71
|
<%- if param[:additional_link] -%>
|
70
72
|
<%- param[:additional_link].each do |link| -%>
|
71
73
|
<li class="nav-item"><a class="nav-link" href="<%=h link["href"] %>"><%=h link["label"] %></a></li>
|
@@ -100,8 +102,8 @@
|
|
100
102
|
<%- if @template == "about.html.erb" and param[:about_toc] -%>
|
101
103
|
<script src="https://cdn.jsdelivr.net/gh/afeld/bootstrap-toc/dist/bootstrap-toc.min.js"></script>
|
102
104
|
<%- end -%>
|
103
|
-
<%- param[:javascript_file].each do |file| -%>
|
105
|
+
<%- Array(param[:javascript_file]).each do |file| -%>
|
104
106
|
<script src="<%=h relative_path(file) %>"></script>
|
105
|
-
<%- end
|
107
|
+
<%- end -%>
|
106
108
|
</body>
|
107
109
|
</html>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<table class="table table-sm">
|
2
|
+
<thead>
|
2
3
|
<tr>
|
3
4
|
<th><%=h t('shape-table.header.property-name') %></th>
|
4
5
|
<th><%=h t('shape-table.header.description') %></th>
|
@@ -7,6 +8,7 @@
|
|
7
8
|
<%=h t('shape-table.header.repeatable') %></th>
|
8
9
|
<th><%=h t('shape-table.header.note') %></th>
|
9
10
|
</tr>
|
11
|
+
</thead>
|
10
12
|
<tbody>
|
11
13
|
<%- param[:properties].each do |property| -%>
|
12
14
|
<tr>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ttl2html
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masao Takaku
|
8
8
|
bindir: bin
|
9
9
|
cert_chain: []
|
10
|
-
date: 2025-
|
10
|
+
date: 2025-09-11 00:00:00.000000000 Z
|
11
11
|
dependencies:
|
12
12
|
- !ruby/object:Gem::Dependency
|
13
13
|
name: nokogiri
|