Skip to content

Commit 0df1f0c

Browse files
authored
Merge pull request #175 from Knowledge-Graph-Hub/173-add-diagram-to-show-provenance-on-product-pages
Add simple provenance diagram to Product pages
2 parents d4420c5 + f02e5dd commit 0df1f0c

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

_layouts/product_detail.html

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,39 @@ <h5 class="card-title">License</h5>
6565
</div>
6666
</div>
6767

68+
{% if page.derived_from and page.original_source %}
69+
<div class="card bg-light mb-3" style="max-width: 48rem;">
70+
<div class="card-body">
71+
<h5 class="card-title">Provenance</h5>
72+
{% if page.derived_from == page.original_source %}
73+
<pre><code class="language-mermaid" style="display: flex; justify-content: center">
74+
block-beta
75+
columns 1
76+
DataSource("{{page.original_source}}") space:1
77+
Product("{{page.id}}")
78+
DataSource --> Product
79+
80+
style Product stroke:#5588bb,stroke-width:5px;
81+
82+
</code></pre>
83+
{% else %}
84+
<pre><code class="language-mermaid" style="display: flex; justify-content: center">
85+
block-beta
86+
columns 1
87+
DataSource("{{page.original_source}}") space:1
88+
Aggregator("{{page.derived_from}}") space:1
89+
Product("{{page.id}}")
90+
DataSource --> Aggregator
91+
Aggregator --> Product
92+
93+
style Product stroke:#5588bb,stroke-width:5px;
94+
95+
</code></pre>
96+
{% endif %}
97+
{% endif %}
98+
</div>
99+
</div>
100+
68101
{% if page.warnings %}
69102
{% for warning in page.warnings %}
70103
<div class="alert alert-warning" role="alert">
@@ -74,7 +107,7 @@ <h5 class="card-title">License</h5>
74107
{% endif %}
75108

76109
{% if page.compatibility %}
77-
<div class="card px-0" style="margin-bottom: 1.5em" id="publications">
110+
<div class="card px-0" style="margin-bottom: 1.5em; max-width: 48rem" id="publications">
78111
<div class="card-header">
79112
<h4>Compatibility</h4>
80113
</div>

0 commit comments

Comments
 (0)