Skip to content

Commit 513f261

Browse files
authored
Merge pull request #470 from ddmesh/develop
add missing html tag "</p>" / clean-up template to get smaller and cleaner output
2 parents 71afd0a + 196cbf1 commit 513f261

File tree

2 files changed

+91
-114
lines changed

2 files changed

+91
-114
lines changed

templates/default_html.template

Lines changed: 67 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -30,84 +30,74 @@ See "get_license_file_key" in `attrib.py` for more information
3030
</style>
3131
<title>Open Source Software Information</title>
3232
</head>
33-
3433
<body>
3534
<h1>OPEN SOURCE SOFTWARE INFORMATION</h1>
36-
<div>
37-
<p>Licenses, acknowledgments and required copyright notices for
38-
open source components:</p>
35+
<div> <p>Licenses, acknowledgments and required copyright notices for open source components:</p> </div>
36+
<div class="oss-table-of-contents">
37+
{% for about_object in abouts %}
38+
<p><a href="#component_{{ loop.index0 }}">{{ about_object.name.value }}{% if about_object.version.value %} {{ about_object.version.value }}{% endif %}</a></p>
39+
{% endfor %}
3940
</div>
40-
41-
<div class="oss-table-of-contents">
42-
{% for about_object in abouts %}
43-
<p><a href="#component_{{ loop.index0 }}">{{ about_object.name.value }}{% if about_object.version.value %} {{ about_object.version.value }}{% endif %}</a></p>
44-
{% endfor %}
45-
</div>
46-
47-
<hr/>
48-
49-
50-
{% for about_object in abouts %}
51-
<div class="oss-component" id="component_{{ loop.index0 }}">
52-
<h3 class="component-name">{{ about_object.name.value }}
53-
{% if about_object.version.value %}{{ about_object.version.value }}{% endif %}
54-
</h3>
55-
{% if about_object.license_expression.value %}
56-
<p>This component is licensed under
57-
{{ about_object.license_expression.value }}
58-
{% endif %}
59-
{% if about_object.copyright.value %}
60-
<pre>{{about_object.copyright.value}}</pre>
61-
{% endif %}
62-
{% if about_object.notice_file.value %}
63-
{% for notice in about_object.notice_file.value %}
64-
<pre class="component-notice">{{ about_object.notice_file.value[notice] }}</pre>
65-
{% endfor %}
66-
{% endif %}
67-
{% if about_object.license_key.value %}
68-
{% for license_key in about_object.license_key.value %}
69-
{% if license_key in common_licenses %}
70-
<p>Full text of
71-
<a class="{{ license_key }}" href="#component-license-{{ license_key }}">
72-
{{ license_key }}
73-
</a>
74-
is available at the end of this document.</p>
75-
{% endif %}
76-
{% endfor %}
77-
{% if about_object.license_file.value %}
78-
{% for lic_file_name in about_object.license_file.value %}
79-
{% if not license_file_key_and_license_key[license_file_name_and_license_file_key[lic_file_name]] in common_licenses %}
80-
{% if about_object.license_file.value[lic_file_name] %}
81-
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
82-
{% endif %}
83-
{% endif %}
84-
{% endfor %}
85-
{% endif %}
86-
{% else %}
87-
{% if about_object.license_file.value %}
88-
{% for lic_file_name in about_object.license_file.value %}
89-
{% if about_object.license_file.value[lic_file_name] %}
90-
<pre>{{ about_object.license_file.value[lic_file_name] | e}}</pre>
91-
{% endif %}
92-
{% endfor %}
93-
{% endif %}
94-
{% endif %}
95-
</div>
96-
{% endfor %}
97-
98-
<hr/>
99-
100-
<h3>Common Licenses Used in This Product</h3>
101-
102-
{% for key in license_file_key_and_context %}
103-
{% if key in common_licenses %}
104-
<h3 id="component-license-{{ key }}">{{ key }}</h3>
105-
<pre>{{ license_file_key_and_context[key]|e }}</pre>
106-
{% endif %}
107-
{% endfor %}
108-
109-
<h3><a id="End">End</a></h3>
110-
<i>This file was generated with AboutCode Toolkit version: {{ tkversion }} on: {{ utcnow }} (UTC)</i>
111-
</body>
41+
<hr/>
42+
{% for about_object in abouts %}
43+
<div class="oss-component" id="component_{{ loop.index0 }}">
44+
<h3 class="component-name">{{ about_object.name.value }} {% if about_object.version.value %}{{ about_object.version.value }}{% endif %} </h3>
45+
{% if about_object.license_expression.value %}
46+
<p>This component is licensed under {{ about_object.license_expression.value }}</p>
47+
{% endif %}
48+
{% if about_object.copyright.value %}
49+
<pre>
50+
{{about_object.copyright.value}}
51+
</pre>
52+
{% endif %}
53+
{% if about_object.notice_file.value %}
54+
{% for notice in about_object.notice_file.value %}
55+
<pre class="component-notice">
56+
{{ about_object.notice_file.value[notice] }}
57+
</pre>
58+
{% endfor %}
59+
{% endif %}
60+
{% if about_object.license_key.value %}
61+
{% for license_key in about_object.license_key.value %}
62+
{% if license_key in common_licenses %}
63+
<p>Full text of <a class="{{ license_key }}" href="#component-license-{{ license_key }}"> {{ license_key }}</a> is available at the end of this document.</p>
64+
{% endif %}
65+
{% endfor %}
66+
{% if about_object.license_file.value %}
67+
{% for lic_file_name in about_object.license_file.value %}
68+
{% if not license_file_key_and_license_key[license_file_name_and_license_file_key[lic_file_name]] in common_licenses %}
69+
{% if about_object.license_file.value[lic_file_name] %}
70+
<pre>
71+
{{ about_object.license_file.value[lic_file_name] | e}}
72+
</pre>
73+
{% endif %}
74+
{% endif %}
75+
{% endfor %}
76+
{% endif %}
77+
{% else %}
78+
{% if about_object.license_file.value %}
79+
{% for lic_file_name in about_object.license_file.value %}
80+
{% if about_object.license_file.value[lic_file_name] %}
81+
<pre>
82+
{{ about_object.license_file.value[lic_file_name] | e}}
83+
</pre>
84+
{% endif %}
85+
{% endfor %}
86+
{% endif %}
87+
{% endif %}
88+
</div>
89+
{% endfor %}
90+
<hr/>
91+
<h3>Common Licenses Used in This Product</h3>
92+
{% for key in license_file_key_and_context %}
93+
{% if key in common_licenses %}
94+
<h3 id="component-license-{{ key }}">{{ key }}</h3>
95+
<pre>
96+
{{ license_file_key_and_context[key]|e }}
97+
</pre>
98+
{% endif %}
99+
{% endfor %}
100+
<h3><a id="End">End</a></h3>
101+
<i>This file was generated with AboutCode Toolkit version: {{ tkversion }} on: {{ utcnow }} (UTC)</i>
102+
</body>
112103
</html>
113-

tests/testdata/test_attrib/gen_default_template/expected_default_attrib.html

Lines changed: 24 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,43 +9,30 @@
99
</style>
1010
<title>Open Source Software Information</title>
1111
</head>
12-
1312
<body>
1413
<h1>OPEN SOURCE SOFTWARE INFORMATION</h1>
15-
<div>
16-
<p>Licenses, acknowledgments and required copyright notices for
17-
open source components:</p>
14+
<div> <p>Licenses, acknowledgments and required copyright notices for open source components:</p> </div>
15+
<div class="oss-table-of-contents">
16+
17+
<p><a href="#component_0">Apache HTTP Server 2.4.3</a></p>
18+
1819
</div>
19-
20-
<div class="oss-table-of-contents">
21-
22-
<p><a href="#component_0">Apache HTTP Server 2.4.3</a></p>
23-
24-
</div>
25-
26-
<hr/>
27-
28-
29-
30-
<div class="oss-component" id="component_0">
31-
<h3 class="component-name">Apache HTTP Server
32-
2.4.3
33-
</h3>
34-
35-
36-
37-
38-
39-
40-
</div>
41-
42-
43-
<hr/>
44-
45-
<h3>Common Licenses Used in This Product</h3>
46-
47-
48-
49-
<h3><a id="End">End</a></h3>
50-
</body>
51-
</html>
20+
<hr/>
21+
22+
<div class="oss-component" id="component_0">
23+
<h3 class="component-name">Apache HTTP Server 2.4.3 </h3>
24+
25+
26+
27+
28+
29+
30+
</div>
31+
32+
<hr/>
33+
<h3>Common Licenses Used in This Product</h3>
34+
35+
<h3><a id="End">End</a></h3>
36+
<i>This file was generated with AboutCode Toolkit version: 6.0.0 on: 2021-08-30 10:58:38.548879 (UTC)</i>
37+
</body>
38+
</html>

0 commit comments

Comments
 (0)