diff --git a/docs/index.rst b/docs/index.rst index d1ce2299c6..098aa364d8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -37,6 +37,8 @@ In this documentation, you’ll find: tutorial_vulnerablecode_integration tutorial_web_ui_symbol_and_string_collection tutorial_cli_end_to_end_scanning_to_dejacode + tutorial_custom_attribution + .. toctree:: :maxdepth: 2 diff --git a/docs/tutorial_custom_attribution.rst b/docs/tutorial_custom_attribution.rst new file mode 100644 index 0000000000..bbbb739fc8 --- /dev/null +++ b/docs/tutorial_custom_attribution.rst @@ -0,0 +1,109 @@ +Generate Attribution with a Custom Template +=========================================== + +This tutorial explains how to create and use a custom attribution template in +ScanCode.io to override the default attribution output. + +Overview +-------- + +ScanCode.io generates attribution documents based on an internal HTML template. +You can override this template at the *project level* using the web UI. + +This is useful when you want: + +- A custom layout +- Additional metadata fields +- Company branding +- Different formatting for license or copyright data + +Default Attribution Template +---------------------------- + +The built-in attribution template is stored at: + +``scanpipe/templates/scanpipe/attribution.html`` + +Use this file as a reference when creating your custom template. +Template variables follow the Jinja2 syntax, such as: + +- ``{{ resource.path }}`` +- ``{{ resource.license_expression }}`` +- ``{{ resource.copyright }}`` +- ``{{ resource.package_name }}`` + +Create Your Custom Template +--------------------------- + +Start by copying the default template and modifying it to fit your needs. + +Example simple template: + +.. code-block:: html + + + +
+ +License: {{ resource.license_expression or "Unknown" }}
+Copyright: {{ resource.copyright or "Unknown" }}
+