Skip to content

Commit

Permalink
Simplify parametrization of navtabs
Browse files Browse the repository at this point in the history
  • Loading branch information
gabriel0316 committed Jul 9, 2021
1 parent 8c0044e commit 2e136ed
Show file tree
Hide file tree
Showing 6 changed files with 53 additions and 9 deletions.
6 changes: 1 addition & 5 deletions includes/fragment-base-navtabs.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
{% endunless %}

<!-- TerminoloGit begin -->
{% if include.showfsh == 'y' %}
{% if include.showAdditionalFormats == 'y' %}
{% if include.active == 'fsh' %}
<li class="active">
<a href="#">FSH v1</a>
Expand All @@ -60,9 +60,7 @@
<a href="{{include.type}}-{{include.id}}.fsh.html">FSH v1</a>
</li>
{% endif %}
{% endif %}

{% if include.showclaml == 'y' %}
{% if include.active == 'claml' %}
<li class="active">
<a href="#">ClaML v3</a>
Expand All @@ -72,9 +70,7 @@
<a href="{{include.type}}-{{include.id}}.claml.html">ClaML v3</a>
</li>
{% endif %}
{% endif %}

{% if include.showcsv == 'y' %}
{% if include.active == 'csv' %}
<li class="active">
<a href="#">PropCSV v1</a>
Expand Down
4 changes: 3 additions & 1 deletion layouts/layout-codesystem.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
<div class="alert alert-warning" role="alert">
<!--ReleaseHeader--><p id="publish-box">Publish Box goes here</p><!--EndReleaseHeader-->
</div>
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='content' showfsh='y' showclaml='y' showcsv='y' %}
<!-- TerminoloGit begin -->
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='content' showAdditionalFormats='y' %}
<!-- TerminoloGit end -->
<a name="root"> </a>
<h2 id="root">CodeSystem: {{site.data.pages[page.path].title}}</h2>

Expand Down
2 changes: 1 addition & 1 deletion layouts/layout-instance-format-claml.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="alert alert-warning" role="alert">
<!--ReleaseHeader--><p id="publish-box">Publish Box goes here</p><!--EndReleaseHeader-->
</div>
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='claml' showclaml='y' showcsv='y' showfsh='y' %}
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='claml' showAdditionalFormats='y' %}

<a name="root"> </a>
{% if site.data.artifacts[page.path].example %}
Expand Down
2 changes: 1 addition & 1 deletion layouts/layout-instance-format-csv.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="alert alert-warning" role="alert">
<!--ReleaseHeader--><p id="publish-box">Publish Box goes here</p><!--EndReleaseHeader-->
</div>
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='csv' showclaml='y' showcsv='y' showfsh='y' %}
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='csv' showAdditionalFormats='y' %}

<a name="root"> </a>
{% if site.data.artifacts[page.path].example %}
Expand Down
2 changes: 1 addition & 1 deletion layouts/layout-instance-format-fsh.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<div class="alert alert-warning" role="alert">
<!--ReleaseHeader--><p id="publish-box">Publish Box goes here</p><!--EndReleaseHeader-->
</div>
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='fsh' showclaml='y' showcsv='y' showfsh='y' %}
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='fsh' showAdditionalFormats='y' %}

<a name="root"> </a>
{% if site.data.artifacts[page.path].example %}
Expand Down
46 changes: 46 additions & 0 deletions layouts/layout-instance-format.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
---

{% if '{{[fmt]}}' == 'xml' %}
{% assign section = '7' %}
{% elsif '{{[fmt]}}' == 'json' %}
{% assign section = '8' %}
{% elsif '{{[fmt]}}' == 'ttl' %}
{% assign section = '9' %}
{% else %}
{% assign section = '13' %}
{% endif %}

{% include fragment-pagebegin.html %}
<div style="counter-reset: section {{section}}" class="col-12">
<div class="alert alert-warning" role="alert">
<!--ReleaseHeader--><p id="publish-box">Publish Box goes here</p><!--EndReleaseHeader-->
</div>
<!-- TerminoloGit begin -->
<!-- Currently, only CodeSystem is supported to show additionalFormats-->
{% if '{{[type]}}' == 'CodeSystem' %}
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='{{[fmt]}}' showAdditionalFormats='y' %}
{% else %}
{% include fragment-base-navtabs.html type='{{[type]}}' id='{{[id]}}' active='{{[fmt]}}' %}
{% endif %}
<!-- TerminoloGit end -->

<a name="root"> </a>
{% if site.data.artifacts[page.path].example %}
{% assign example = 'Example ' %}
{% endif %}
{% assign prefix = site.data.artifacts[page.path].type %}
<h2 id="root">{{example}}{{prefix}}: {{site.data.pages[page.path].title}}</h2>

<p><a href="{{[type]}}-{{[id]}}.{{[fmt]}}" no-download="true">Raw {{[fmt]}}</a> | <a href="{{[type]}}-{{[id]}}.{{[fmt]}}" download>Download</a></p>

<!-- insert intro if present -->
{% include fragment-intro.html type='{{[type]}}' id='{{[id]}}' %}

{% include {{[type]}}-{{[name]}}.xhtml %}

<!-- insert notes if present -->
{% include fragment-notes.html type='{{[type]}}' id='{{[id]}}' %}

</div>
{% include fragment-pageend.html %}

0 comments on commit 2e136ed

Please sign in to comment.