Skip to content

Commit

Permalink
Merge pull request #2611 from lsst-sqre/tickets/DM-40947b
Browse files Browse the repository at this point in the history
DM-40947: Improve whitespace handling in doc templates
  • Loading branch information
rra authored Oct 2, 2023
2 parents 355b3ac + c8e63c0 commit 741c0f1
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 26 deletions.
41 changes: 20 additions & 21 deletions docs/applications/_summary.rst.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -3,45 +3,44 @@
* - View on GitHub
- :bdg-link-primary-line:`applications/{{ app.name }} <https://github.com/lsst-sqre/phalanx/tree/main/applications/{{app.name}}>`
:bdg-link-primary-line:`Application template <https://github.com/lsst-sqre/phalanx/blob/main/environments/templates/{{app.name}}-application.yaml>`
{% if app.homepage %}
{%- if app.homepage %}
* - Homepage
- {{ app.homepage }}
{% endif %}
{% if app.source_urls %}
{%- endif %}
{%- if app.source_urls %}
* - Source
{% if app.source_urls|length == 1 %}
{%- if app.source_urls|length == 1 %}
- {{ app.source_urls[0] }}
{% else %}
{%- else %}
- - {{ app.source_urls[0] }}
{% for source_url in app.source_urls[1:] %}
{%- for source_url in app.source_urls[1:] %}
- {{ source_url }}
{% endfor %}
{% endif %}
{% endif %}
{% if app.doc_links %}
{%- endfor %}
{%- endif %}
{%- endif %}
{%- if app.doc_links %}
* - Related docs
{% if app.doc_links|length == 1 %}
{%- if app.doc_links|length == 1 %}
- {{ app.doc_links[0].to_rst() }}
{% else %}
{%- else %}
- - {{ app.doc_links[0].to_rst() }}
{% for doc_link in app.doc_links[1:] %}
{%- for doc_link in app.doc_links[1:] %}
- {{ doc_link.to_rst() }}
{% endfor %}
{% endif %}
{% endif %}
{%- endfor %}
{%- endif %}
{%- endif %}
* - Type
- Helm_
* - Namespace
- {{ app.namespace }}
* - Environments
- .. list-table::

{% for env_name in app.active_environments %}
* - :px-env:`{{ env_name }}`
- `values <https://github.com/lsst-sqre/phalanx/blob/main/applications/{{ app.name }}/values-{{ env_name }}.yaml>`__
{% if envs[env_name].argocd_url %}
{%- if envs[env_name].argocd_url %}
- `Argo CD <{{ envs[env_name].argocd_url }}/applications/{{ app.name }}>`__
{% else %}
{%- else %}
-
{% endif %}
{% endfor %}
{%- endif %}
{%- endfor %}
9 changes: 4 additions & 5 deletions docs/environments/_summary.rst.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,17 @@
{% for scope_groups in env.gafaelfawr_scopes %}
* - ``{{ scope_groups.scope }}``
- - {{ scope_groups.groups_as_rst()[0] }}
{% if scope_groups.groups|length > 1 %}
{% for group in scope_groups.groups_as_rst()[1:] %}
{%- if scope_groups.groups|length > 1 %}
{%- for group in scope_groups.groups_as_rst()[1:] %}
- {{ group }}
{%- endfor %}
{%- endif %}
{%- endfor %}
{% endif %}
{%- endif %}
{% if env.argocd_rbac %}
* - Argo CD RBAC
- .. csv-table::

{% for line in env.argocd_rbac_csv %}
{{ line }}
{%- endfor %}
{% endif %}
{%- endif %}

0 comments on commit 741c0f1

Please sign in to comment.