You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/scancode-toolkit/rst_snippets/custom_output_format.rst
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,8 +18,8 @@ data for this particular scan.
18
18
19
19
## template.html:
20
20
[
21
-
{% if results.license_copyright %}
22
-
{% for location, data in results.license_copyright.items() %}
21
+
{% if files.license_copyright %}
22
+
{% for location, data in files.license_copyright.items() %}
23
23
{% for row in data %}
24
24
location:"{{ location }}",
25
25
{% if row.what == 'copyright' %}copyright:"{{ row.value|escape }}",{% endif %}
@@ -41,7 +41,7 @@ Now I can run ScanCode using my newly created template:
41
41
[####################################] 46
42
42
Scanning done.
43
43
44
-
Now are results are saved in ``output.json`` and we can easily view them with ``head output.json``\ :
44
+
Now are results are saved in ``output.json`` and we can easily view them with ``head output.json``:
45
45
46
46
::
47
47
@@ -53,8 +53,7 @@ Now are results are saved in ``output.json`` and we can easily view them with ``
53
53
copyright:"copyrighted by the Free Software Foundation",
54
54
]
55
55
56
-
..
57
-
[ToDo]
58
-
There is an error in the template.html file:
59
-
"UndefinedError: 'results' is undefined"
60
-
Will be solved in a later commit.
56
+
For a more elaborate template, refer this `default template <https://github.com/nexB/scancode-toolkit/blob/develop/src/formattedcode/templates/html/template.html>`_
57
+
given with Scancode, to generate HTML output with the ``--html`` output format option.
58
+
59
+
Documentation on `Jinja templates <https://jinja.palletsprojects.com/en/2.10.x/>`_.
0 commit comments