Skip to content

Commit fa7bd84

Browse files
committed
add class=url for shape property name. fix #188
1 parent d7af477 commit fa7bd84

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

spec/ttl2html_spec.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,6 +461,14 @@
461461
expect(html).to have_css("table tfoot dl dt", text: "ex:")
462462
expect(html).to have_css("table tfoot dl dd", text: "https://example.org/")
463463
end
464+
it "should add class=url for the name and example columns in shapes table" do
465+
@ttl2html = TTL2HTML::App.new(File.join(spec_base_dir, "example/example.yml"))
466+
@ttl2html.load_turtle(File.join(spec_base_dir, "example/example_shape.ttl"))
467+
@ttl2html.output_html_files
468+
cont = open("/tmp/html/about.html"){|io| io.read }
469+
html = Capybara.string cont
470+
expect(html).to have_css("table td.url", text: "ex:title")
471+
end
464472
it "should accept labels_with_class settings per target class" do
465473
@ttl2html = TTL2HTML::App.new(File.join(spec_base_dir, "example/example_labels_with_class.yml"))
466474
@ttl2html.load_turtle(File.join(spec_base_dir, "example/example.ttl"))

templates/shape-table.html.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
<%- param[:properties].each do |property| -%>
1212
<tr>
1313
<%- if property[:nodeKind] == "http://www.w3.org/ns/shacl#BlankNode" -%>
14-
<td rowspan="2"><code><%=h property[:shorten_path] %></code></td>
14+
<td rowspan="2" class="url"><code><%=h property[:shorten_path] %></code></td>
1515
<%- else -%>
16-
<td><code><%=h property[:shorten_path] %></code></td>
16+
<td class="url"><code><%=h property[:shorten_path] %></code></td>
1717
<%- end -%>
1818
<td><%= property[:name] %></td>
1919
<%- if property[:nodeKind] == "http://www.w3.org/ns/shacl#IRI" -%>

0 commit comments

Comments
 (0)