Skip to content

Correct license merge tutorials #4473

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,10 @@ Other Important Documentation Pages:
- A `synopsis <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/synopsis.html>`_
of ScanCode command line options.

- Tutorials on:
- How-Tos on:

- `How to run a scan <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_run_a_scan.html>`_
- `How to visualize scan results <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_visualize_scan_results.html>`_
- `Run a scan <https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_run_a_scan.html>`_
- `Visualize scan results <https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_visualize_scan_results.html>`_

- An exhaustive list of `all available options <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html>`_

Expand Down Expand Up @@ -171,7 +171,7 @@ After ScanCode is installed successfully you can run an example scan printed on

scancode -clip --json-pp - samples

Follow the `How to Run a Scan <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_run_a_scan.html>`_
Follow the `How to Run a Scan <https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_run_a_scan.html>`_
tutorial to perform a basic scan on the ``samples`` directory distributed by
default with ScanCode.

Expand All @@ -180,8 +180,8 @@ See more command examples::
scancode --examples

See `How to select what will be detected in a scan
<https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_set_what_will_be_detected_in_a_scan.html>`_
and `How to specify the output format <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_format_scan_output.html>`_
<https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_set_what_will_be_detected_in_a_scan.html>`_
and `How to specify the output format <https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_format_scan_output.html>`_
for more information.

You can also refer to the `command line options synopsis
Expand All @@ -203,7 +203,7 @@ directory::
./extractcode mytar.tar.bz2

See `all extractcode options <https://scancode-toolkit.readthedocs.io/en/latest/cli-reference/list-options.html#all-extractcode-options>`_
and `how to extract archives <https://scancode-toolkit.readthedocs.io/en/latest/tutorials/how_to_extract_archives.html>`_ for details.
and `how to extract archives <https://scancode-toolkit.readthedocs.io/en/latest/how-to-guides/how_to_extract_archives.html>`_ for details.


Support
Expand Down
2 changes: 1 addition & 1 deletion docs/source/cli-reference/simple-examples.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
.. _how_to_run_a_scan:

.. include:: /tutorials/how_to_run_a_scan.rst
.. include:: /how-to-guides/how_to_run_a_scan.rst
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@
# -- Project information -----------------------------------------------------

project = "ScanCode-Toolkit"
copyright = "nexB Inc. and others."
copyright = "nexB Inc. and others." + \
"Except where otherwise noted, this documentation is " + \
"licensed under a cc-by-4.0"
author = "AboutCode.org authors and contributors"

# -- General configuration ---------------------------------------------------
Expand Down
8 changes: 8 additions & 0 deletions docs/source/getting-started/home.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,12 @@ audit function as they like on their own.

Thank you for giving ScanCode a try!


License
-------
ScanCode is licensed under Apache-2.0 and others. Datasets contributed is
subject to CC-BY-4.0. See `License
<https://github.com/aboutcode-org/scancode-toolkit?tab=readme-ov-file#license>`_
for details.

.. include:: /rst_snippets/other_imp_doc.rst
4 changes: 4 additions & 0 deletions docs/source/getting-started/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,10 @@ For more information on Python virtualenv, visit this
no default dependencies on pre-built binaries. This may come handy for some
special use cases such as packaging for a Linux or FreeBSD distro.

.. NOTE::

Refer :ref:`run_as_library` for usage samples.


To uninstall, run::

Expand Down
12 changes: 6 additions & 6 deletions docs/source/getting-started/newcomer.rst
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ Use ScanCode Better
All Tutorials/How-Tos
^^^^^^^^^^^^^^^^^^^^^

The Tutorials are:
The How-To's are:

#. :ref:`how_to_run_a_scan`
#. :ref:`how_to_visualize_scan_results`
#. :ref:`how_to_set_what_scan_detects`
#. :ref:`how_to_extract_archives`
#. :ref:`how_to_specify_output_format`
#. :ref:`how_to_add_post_scan_plugin`

The How-To's are:

#. :ref:`how_to_set_what_scan_detects`
#. :ref:`add_new_license_for_det`
#. :ref:`add_new_license_det_rule`
#. :ref:`install_new_license_plugin`
#. :ref:`generate_attribution`
#. :ref:`how_to_add_post_scan_plugin`


.. _newcomer_whats_new:

Expand Down
4 changes: 2 additions & 2 deletions docs/source/how-to-guides/add_new_license.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _add_new_license_for_det:

How To Add a New License for Detection
======================================
Add a New License for Detection
===============================

How to add a new license for detection?
---------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions docs/source/how-to-guides/add_new_license_detection_rule.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _add_new_license_det_rule:

How to Add New License Rules for Enhanced Detection
===================================================
Add New License Rules for Enhanced Detection
============================================

ScanCode relies on license rules to detect licenses. A rule is a simple text
file containing a license text or notice or mention with YAML frontmatter with data
Expand Down
4 changes: 2 additions & 2 deletions docs/source/how-to-guides/generate_attribution.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _generate_attribution:

How To Generate Attribution from a ScanCode Scan
================================================
Generate Attribution from a ScanCode Scan
=========================================

How To generate attribution from a ScanCode scan?
-------------------------------------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _how_to_extract_archives:

How To Extract Archives
=======================
Extract Archives
================

ScanCode-Toolkit provides archive extraction. This command can be used before running a scan over
a codebase in order to ensure all archives are extracted. Archives found inside an extracted
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _how_to_specify_output_format:

How to specify ScanCode Output Format
=====================================
Specify ScanCode Output Format
==============================

A basic overview of formatting ScanCode Output is presented here.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
How to Run a Scan
=================
Run a Scan
==========

In this simple tutorial example, we perform a basic scan on the ``samples`` directory distributed
by default with ScanCode.
Expand All @@ -17,7 +17,7 @@ Looking into Files
As mentioned previously, we are going to perform the scan on the ``samples`` directory distributed
by default with ScanCode-Toolkit. Here's the directory structure and respective files:

.. image:: /tutorials/data/files_sample.png
.. image:: /how-to-guides/data/files_sample.png

We notice here that the sample files contain a package ``zlib.tar.gz``. So we have to extract the
archive before running the scan, to also scan the files inside this package.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _how_to_set_what_scan_detects:

How to set what will be detected in Scan
========================================
Set what will be detected in Scan
=================================

ScanCode allows you to scan a codebase for license, copyright and other interesting information
that can be discovered in files. The following options are available for detection when using
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _how_to_visualize_scan_results:

How to Visualize Scan results
=============================
Visualize Scan results
======================

To help visualize the scans, we have a dedicated tool `ScanCode workbench <https://github.com/nexb/scancode-workbench/>`_ which is a desktop application that allows you to visualize and explore the results of one or more scans. It is a cross-platform application that runs on Windows, Mac OS X and Linux. It is built using the Electron framework and is built using Electron, Typescript & React

Expand Down
7 changes: 7 additions & 0 deletions docs/source/how-to-guides/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
.. toctree::
:maxdepth: 2

how_to_run_a_scan
how_to_visualize_scan_results
how_to_extract_archives
how_to_format_scan_output
how_to_set_what_will_be_detected_in_a_scan
add_new_license
add_new_license_detection_rule
install_new_license_plugin
run_as_library
generate_attribution
how_to_add_a_post_scan_plugin
4 changes: 2 additions & 2 deletions docs/source/how-to-guides/install_new_license_plugin.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
.. _install_external_licenses:

How to Install External Licenses to Use in License Detection
============================================================
Install External Licenses to Use in License Detection
=====================================================

Users can install external licenses and rules in the form of:

Expand Down
39 changes: 39 additions & 0 deletions docs/source/how-to-guides/run_as_library.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
.. _run_as_library:

Run as Library
==============

If you’ve installed ScanCode-Toolkit as a library (:ref:`pip_install`), you
can directly import it into your Python scripts.

ScanCode-Toolkit offers a wide range of callable functions. Each function
includes in-code documentation. Users can refer to it to understand the
purpose of each function, then import and use the ones they need.

While listing them all isn't feasible, here are a few sample use cases.

To Run a Scan
-------------

::

from scancode.cli import run_scan


See https://github.com/aboutcode-org/scancode-toolkit/blob/develop/src/scancode/cli.py#L535


Get YAML Safe Text
------------------

::

from licensedcode.models import get_yaml_safe_text


See https://github.com/aboutcode-org/scancode-toolkit/blob/develop/src/licensedcode/models.py#L777


.. NOTE::

For more sample usages, refer https://github.com/nexB/scancode.io/blob/main/scanpipe/pipes/scancode.py
12 changes: 0 additions & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,6 @@ Reference documents describe the Command Line options, and application concepts

----

Tutorials
---------

Tutorial documents provide specific instructions to help you get started.

.. toctree::
:maxdepth: 2

tutorials/index

----

How-To Documents
----------------

Expand Down
1 change: 0 additions & 1 deletion docs/source/rst_snippets/other_imp_doc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ Other Important Documentation

#. :ref:`scancode_cli_options`
#. :ref:`how_to_run_a_scan`
#. :ref:`tutorials`
#. :ref:`how_to_guides`
#. :ref:`how_it_works`
#. :ref:`contrib_code_dev`
Expand Down
14 changes: 0 additions & 14 deletions docs/source/tutorials/index.rst

This file was deleted.

Loading