Skip to content

Commit 37dc642

Browse files
committed
restore more of original template and exclude
Signed-off-by: Mike Fiedler <[email protected]>
1 parent caee94f commit 37dc642

File tree

3 files changed

+5
-16
lines changed

3 files changed

+5
-16
lines changed

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ exclude_lines = [
3333
indent = 2
3434
profile = "jinja"
3535
use_gitignore = true
36+
# The Simple API templates have structures that are relied upon.
37+
extend_exclude = "warehouse/templates/api/simple/*"
3638
# TODO: Evaluate which `img` tags can get height/width attributes and remove H006.
3739
# H006: <img> tag should have `height` and `width` attributes.
3840
# TODO: Convert single quotes to double quotes and remove T002 from ignore.

warehouse/templates/api/simple/detail.html

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
{# SPDX-License-Identifier: Apache-2.0 -#}
22
<!DOCTYPE html>
3-
{# djlint:off H030,H031 #}
43
<html lang="en">
5-
{# djlint:on #}
64
<head>
75
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
86
{% for alt_repo in alternate_locations %}<meta name="pypi:alternate-locations" content="{{ alt_repo }}">{% endfor %}
@@ -11,16 +9,7 @@
119
<body>
1210
<h1>Links for {{ name }}</h1>
1311
{% for file in files -%}
14-
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}"
15-
{% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}"{% endif %}
16-
{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}
17-
"
18-
{% endif %}
19-
{% if file['core-metadata'] %}data-dist-info-metadata="sha256={{ file['core-metadata']['sha256'] }}" data-core-metadata="sha256={{ file['core-metadata']['sha256'] }}"{% endif %}
20-
{# djlint:off #}
21-
{# TODO: Disabled is due to some clients not parsing **HTML**. See https://github.com/pypi/warehouse/issues/18275 #}
22-
{% if file.get('provenance') %}data-provenance="{{ file['provenance'] }}"{% endif %}>{{ file.filename }}</a><br />
23-
{# djlint:on #}
12+
<a href="{{ file.url }}#sha256={{ file.hashes.sha256 }}" {% if file.get('requires-python') %}data-requires-python="{{ file['requires-python'] }}" {% endif %}{% if file.yanked %}data-yanked="{% if file.yanked is string %}{{ file.yanked }}{% endif %}" {% endif %}{% if file['core-metadata'] %}data-dist-info-metadata="sha256={{ file['core-metadata']['sha256'] }}" data-core-metadata="sha256={{ file['core-metadata']['sha256'] }}"{% endif %}{% if file.get('provenance') %} data-provenance="{{ file['provenance'] }}"{% endif %}>{{ file.filename }}</a><br />
2413
{% endfor -%}
2514
</body>
2615
</html>
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
{# SPDX-License-Identifier: Apache-2.0 -#}
22
<!DOCTYPE html>
3-
{# djlint:off H030,H031 #}
43
<html lang="en">
5-
{# djlint:on #}
64
<head>
7-
<meta name="pypi:repository-version" content="{{ meta['api-version'] }}">
5+
<meta name="pypi:repository-version" content="{{meta['api-version'] }}">
86
<title>Simple index</title>
97
</head>
108
<body>
119
{% for project in projects -%}
12-
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
10+
<a href="{{ request.route_path('api.simple.detail', name=project.name|canonicalize_name) }}">{{ project.name }}</a>
1311
{% endfor -%}
1412
</body>
1513
</html>

0 commit comments

Comments
 (0)