Skip to content

Commit 9e25015

Browse files
authored
Merge pull request #31 from AyanSinhaMahapatra/fix-template-error
Fix template error
2 parents f2b25dc + f2d6cc4 commit 9e25015

1 file changed

Lines changed: 8 additions & 9 deletions

File tree

docs/source/scancode-toolkit/rst_snippets/custom_output_format.rst

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ data for this particular scan.
1818

1919
## template.html:
2020
[
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() %}
2323
{% for row in data %}
2424
location:"{{ location }}",
2525
{% if row.what == 'copyright' %}copyright:"{{ row.value|escape }}",{% endif %}
@@ -36,12 +36,12 @@ Now I can run ScanCode using my newly created template:
3636

3737
::
3838

39-
$ ./scancode -clpeui --custom-output sample.json --custom-template sample.html samples
39+
$ ./scancode -clpeui --custom-output output.json --custom-template template.html samples
4040
Scanning files...
4141
[####################################] 46
4242
Scanning done.
4343

44-
Now are results are saved in ``t.json`` and we can easily view them with ``head t.json``\ :
44+
Now are results are saved in ``output.json`` and we can easily view them with ``head output.json``:
4545

4646
::
4747

@@ -53,8 +53,7 @@ Now are results are saved in ``t.json`` and we can easily view them with ``head
5353
copyright:"copyrighted by the Free Software Foundation",
5454
]
5555

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

Comments
 (0)