Skip to content

Commit 5f5daed

Browse files
committed
Update doc format
Signed-off-by: Chin Yeung Li <[email protected]>
1 parent 1b95944 commit 5f5daed

File tree

3 files changed

+104
-39
lines changed

3 files changed

+104
-39
lines changed

docs/source/general.rst

Lines changed: 48 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,33 @@ inside your codebase, typically in preparation for a product release, side-by-si
1212
actual code. ABOUT file(s) have a simple, standard format that identifies components and their
1313
associated licenses. The current AboutCode Toolkit subcommands are:
1414

15-
- **attrib**: Generate a Product Attribution notice document from your ABOUT file(s), JSON, CSV or XLSX. You can also generate documents for other purposes (such as a License Reference) by varying your input control file and your template.
15+
- **attrib**: Generate a Product Attribution notice document from your ABOUT
16+
file(s), JSON, CSV or XLSX. You can also generate documents for other
17+
purposes (such as a License Reference) by varying your input control file
18+
and your template.
1619

17-
- **check**: A simple command to validate the ABOUT file(s) and output errors/warnings on the terminal.
20+
- **check**: A simple command to validate the ABOUT file(s) and output
21+
errors/warnings on the terminal.
1822

19-
- **collect_redist_src**: A command to collect and copy sources that have the 'redistribute' flagged as 'True' in ABOUT file(s) or from an inventory.
23+
- **collect_redist_src**: A command to collect and copy sources that have
24+
the 'redistribute' flagged as 'True' in ABOUT file(s) or from an inventory.
2025

21-
- **gen**: Create ABOUT file(s) from a Software Inventory file (.csv, .json or .xlsx format) which is typically created from a software audit, and insert these AboutCode Toolkit files into your codebase. You can regenerate the AboutCode Toolkit files from a new Software Inventory file whenever you make changes.
26+
- **gen**: Create ABOUT file(s) from a Software Inventory file (.csv, .json or .xlsx format)
27+
which is typically created from a software audit, and insert these AboutCode Toolkit files
28+
into your codebase. You can regenerate the AboutCode Toolkit files from a new
29+
Software Inventory file whenever you make changes.
2230

23-
- **gen_license**: Fetch licenses in the license_expression field and save to the output location.
31+
- **gen_license**: Fetch licenses in the license_expression field and
32+
save to the output location.
2433

25-
- **inventory**: Generate a Software Inventory list (.csv, .json or .xlsx format) from your codebase based on ABOUT file(s). Note that this Software Inventory will only include components that have AboutCode Toolkit data. In another word, if you do not create AboutCode Toolkit files for your own original software components, these components will not show up in the generated inventory.
34+
- **inventory**: Generate a Software Inventory list (.csv, .json or .xlsx format)
35+
from your codebase based on ABOUT file(s). Note that this Software Inventory will
36+
only include components that have AboutCode Toolkit data. In another word, if you do
37+
not create AboutCode Toolkit files for your own original software components,
38+
these components will not show up in the generated inventory.
2639

27-
- **transform**: A command to transform an input CSV/JSON/XLSX by applying renaming and/or filtering and then output to a new CSV/JSON/XLSX file.
40+
- **transform**: A command to transform an input CSV/JSON/XLSX by applying
41+
renaming and/or filtering and then output to a new CSV/JSON/XLSX file.
2842

2943
Additional AboutCode Toolkit information is available at:
3044

@@ -36,9 +50,14 @@ Key Terminology
3650
===============
3751
Some key terminology that applies to AboutCode Toolkit tool usage:
3852

39-
- **Software Inventory or Inventory** - means a list of all of the components in a Development codebase and the associated data about those components with a focus on software pedigree/provenance- related data for open source and third-party components.
53+
- **Software Inventory or Inventory** - means a list of all of the components
54+
in a Development codebase and the associated data about those components with a
55+
focus on software pedigree/provenance- related data for open source and
56+
third-party components.
4057

41-
- **Product BOM or BOM** - means a subset list of the components in a Development codebase (Software Inventory) that are Deployed on a particular Product Release (a Product Bill of Materials).
58+
- **Product BOM or BOM** - means a subset list of the components in a Development
59+
codebase (Software Inventory) that are Deployed on a particular Product
60+
Release (a Product Bill of Materials).
4261

4362
Using gen to Generate ABOUT file(s)
4463
===================================
@@ -187,7 +206,8 @@ using the same format as an .ABOUT file.
187206

188207
The attributes that can be set in a configuration file are:
189208

190-
- field_renamings: An optional map of source field name to target new field name that is used to rename CSV/JSON/XLSX fields.
209+
- field_renamings: An optional map of source field name to target new field
210+
name that is used to rename CSV/JSON/XLSX fields.
191211

192212
.. code-block:: none
193213
@@ -201,7 +221,9 @@ field names referenced below are AFTER the renaming have been applied.
201221
For instance with this configuration, the field "Directory/Location" will be
202222
renamed to "about_resource" and "foo" to "bar":
203223

204-
- required_fields: An optional list of required field names that must have a value, beyond the standard field names. If a source CSV/JSON/XLSX does not have such a field or an entry is missing a value for a required field, an error is reported.
224+
- required_fields: An optional list of required field names that must have a value,
225+
beyond the standard field names. If a source CSV/JSON/XLSX does not have such a field or
226+
an entry is missing a value for a required field, an error is reported.
205227

206228
For instance with this configuration, an error will be reported if the fields "name"
207229
and "version" are missing, or if any entry does not have a value set for these fields:
@@ -212,17 +234,24 @@ and "version" are missing, or if any entry does not have a value set for these f
212234
- name
213235
- version
214236
215-
- field_filters: An optional list of fields that should be kept in the transformed file. If this list is provided, only the fields that are in the list will be kept. All others will be filtered out even if they are AboutCode Toolkit standard fields. If this list is not provided, all source fields are kept in the transformed target file.
237+
- field_filters: An optional list of fields that should be kept in the transformed file.
238+
If this list is provided, only the fields that are in the list will be kept. All others will
239+
be filtered out even if they are AboutCode Toolkit standard fields. If this list is not
240+
provided, all source fields are kept in the transformed target file.
216241

217-
For instance with this configuration, the target file will only contains the "name" and "version" fields:
242+
For instance with this configuration, the target file will only contains the "name" and
243+
"version" fields:
218244

219245
.. code-block:: none
220246
221247
field_filters:
222248
- name
223249
- version
224250
225-
- exclude_fields: An optional list of field names that should be excluded in the transformed file. If this list is provided, all the fields from the source file that should be excluded in the target file must be listed. Excluding required fields will cause an error. If this list is not provided, all source fields are kept in the transformed target file.
251+
- exclude_fields: An optional list of field names that should be excluded in the transformed
252+
file. If this list is provided, all the fields from the source file that should be
253+
excluded in the target file must be listed. Excluding required fields will cause an error.
254+
If this list is not provided, all source fields are kept in the transformed target file.
226255

227256
For instance with this configuration, the target file will not contain the "type" and "temp" fields:
228257

@@ -249,7 +278,9 @@ This gen example command does the following:
249278

250279
- Activates the --fetch-license option to get license information from ScanCode LicenseDB.
251280

252-
- Activates the --reference option to get license text files and notice text files that you have specified in your software inventory to be copied next to the associated .ABOUT files when those are created.
281+
- Activates the --reference option to get license text files and notice text files that
282+
you have specified in your software inventory to be copied next to the
283+
associated .ABOUT files when those are created.
253284

254285
- Specifies the path of the software inventory to control the processing.
255286

@@ -431,7 +462,8 @@ Note that this example attrib command does the following:
431462

432463
- Specifies the full path (include file name) of the output document to be generated.
433464

434-
A successful execution of attrib will create a .html (or .json depends on the template) file that is ready to use to meet your attribution requirements.
465+
A successful execution of attrib will create a .html (or .json depends on the template)
466+
file that is ready to use to meet your attribution requirements.
435467

436468
Using inventory to Generate a Software Inventory
437469
================================================

docs/source/reference.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ Details
157157
The following data are passed to jinja2 and, therefore, can be used for a custom template:
158158
* about object: the about objects
159159
* common_licenses: a common license keys list in licenses.py
160-
* licenses_list: a license object list contains all the licenses found in about objects. It contains the following attribute: key, name, filename, url, text
160+
* licenses_list: a license object list contains all the licenses found in about objects.
161+
It contains the following attribute: key, name, filename, url, text
161162

162163
check
163164
=====

docs/source/specification.rst

Lines changed: 54 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,13 @@ A simple and valid ABOUT file named httpd-2.4.3.tar.gz.ABOUT may look like this:
4444
4545
The meaning of this ABOUT file is:
4646

47-
- The file "httpd-2.4.3.tar.gz" is stored in the same directory and side-by-side with the ABOUT file "httpd-2.4.3.tar.gz.ABOUT" that documents it.
47+
- The file "httpd-2.4.3.tar.gz" is stored in the same directory and side-by-side with
48+
the ABOUT file "httpd-2.4.3.tar.gz.ABOUT" that documents it.
4849
- The name of this component is "Apache HTTP Server" with version "2.4.3".
4950
- The home URL for this component is http://httpd.apache.org
5051
- The file "httpd-2.4.3.tar.gz" was originally downloaded from http://archive.apache.org/dist/httpd/httpd-2.4.3.tar.gz
51-
- In the same directory, "apache-2.0.LICENSE" and "httpd.NOTICE" are files that contain respectively the license text and the notice text for this component.
52+
- In the same directory, "apache-2.0.LICENSE" and "httpd.NOTICE" are files
53+
that contain respectively the license text and the notice text for this component.
5254
- This component is licensed under "apache-2.0"
5355
- The license for this component is defined in the SPDX License List at https://spdx.org/licenses/Apache-2.0.html
5456

@@ -70,7 +72,11 @@ A file name can contain only these US-ASCII characters:
7072
- digits from 0 to 9
7173
- uppercase and lowercase letters from A to Z
7274
- the following symbols: ``"_", "-", "+", ".", "(", ")", "~", "[", "]", "{", "}", "@", "%"``
73-
- The case of a file name is not significant. On case-sensitive file systems (such as on Linux), a tool must report an error if two ABOUT files stored in the same directory have the same lowercase file name. This is to ensure that ABOUT files can be used across file systems. The convention is to use a lowercase file name and an uppercase ABOUT extension.
75+
- The case of a file name is not significant. On case-sensitive file systems
76+
(such as on Linux), a tool must report an error if two ABOUT files stored in the same
77+
directory have the same lowercase file name. This is to ensure that ABOUT files can be
78+
used across file systems. The convention is to use a lowercase file name and an uppercase
79+
ABOUT extension.
7480

7581
Lines of text
7682
-------------
@@ -90,8 +96,11 @@ A field name can contain only these US-ASCII characters:
9096
- digits from 0 to 9
9197
- uppercase and lowercase letters from A to Z
9298
- the ``"_"`` underscore sign.
93-
- Field names are not case sensitive. For example, "HOMEPAGE_URL" and "HomePage_url" represent the same field name.
94-
- A field name must start at the beginning of a new line. No spaces is allowed in the field name. It can be followed by one or more spaces that must be ignored. These spaces are commonly used to improve the readability of an ABOUT file.
99+
- Field names are not case sensitive. For example, "HOMEPAGE_URL" and "HomePage_url"
100+
represent the same field name.
101+
- A field name must start at the beginning of a new line. No spaces is allowed in
102+
the field name. It can be followed by one or more spaces that must be ignored.
103+
These spaces are commonly used to improve the readability of an ABOUT file.
95104

96105
Field value
97106
-----------
@@ -254,10 +263,16 @@ mandatory field are missing.
254263
Optional Information fields
255264
---------------------------
256265

257-
- version: Component or package version. A component or package usually has a version, such as a revision number or hash from a version control system (for a snapshot checked out from VCS such as Subversion or Git). If not available, the version should be the date the component was provisioned, in an ISO date format such as 'YYYY-MM-DD'.
258-
- spec_version: The version of the ABOUT file format specification used for this file. This is provided as a hint to readers and tools in order to support future versions of this specification.
266+
- version: Component or package version. A component or package usually has a version,
267+
such as a revision number or hash from a version control system (for a snapshot checked
268+
out from VCS such as Subversion or Git). If not available, the version should be the date
269+
the component was provisioned, in an ISO date format such as 'YYYY-MM-DD'.
270+
- spec_version: The version of the ABOUT file format specification used for this file.
271+
This is provided as a hint to readers and tools in order to support future versions
272+
of this specification.
259273
- description: Component description, as a short text.
260-
- download_url: A direct URL to download the original file or archive documented by this ABOUT file.
274+
- download_url: A direct URL to download the original file or archive documented
275+
by this ABOUT file.
261276
- homepage_url: URL to the homepage for this component.
262277
- changelog_file: Changelog file for the component.
263278
- package_url: Package URL for the package.
@@ -266,9 +281,11 @@ Optional Information fields
266281
Optional Owner and Author fields
267282
--------------------------------
268283

269-
- owner: The name of the primary organization or person(s) that owns or provides the component.
284+
- owner: The name of the primary organization or person(s) that owns or
285+
provides the component.
270286
- owner_url: URL to the homepage for the owner.
271-
- contact: Contact information (such as an email address or physical address) for the component owner.
287+
- contact: Contact information (such as an email address or physical address)
288+
for the component owner.
272289
- author: Name of the organization(s) or person(s) that authored the component.
273290
- author_file: Author file for the component.
274291

@@ -278,21 +295,33 @@ Optional Licensing fields
278295
- copyright: Copyright statement for the component.
279296
- notice_file: Legal notice or credits for the component.
280297
- notice_url: URL to a legal notice for the component.
281-
- license_file: License file that applies to the component. For example, the name of a license file such as LICENSE or COPYING file extracted from a downloaded archive.
298+
- license_file: License file that applies to the component. For example, the
299+
name of a license file such as LICENSE or COPYING file extracted from a
300+
downloaded archive.
282301
- license_url: URL to the license text for the component.
283-
- license_expression: The DejaCode license expression that apply to the component. You can separate each identifier using " or " and " and " to document the relationship between multiple license identifiers, such as a choice among multiple licenses (No special characters are allowed).
284-
- license_name: The DejaCode license short name for the license (No special characters are allowed).
285-
- license_key: The DejaCode license key(s) for the component (No special characters are allowed).
286-
- spdx_license_key: The ScanCode LicenseDB spdx_license_key defined for the license at https://scancode-licensedb.aboutcode.org/index.html
302+
- license_expression: The DejaCode license expression that apply to
303+
the component. You can separate each identifier using " or " and " and " to
304+
document the relationship between multiple license identifiers, such as a choice
305+
among multiple licenses (No special characters are allowed).
306+
- license_name: The DejaCode license short name for the license
307+
(No special characters are allowed).
308+
- license_key: The DejaCode license key(s) for the component
309+
(No special characters are allowed).
310+
- spdx_license_key: The ScanCode LicenseDB spdx_license_key defined
311+
for the license at https://scancode-licensedb.aboutcode.org/index.html
287312

288313
Optional Boolean flag fields
289314
----------------------------
290315

291-
- redistribute: Set this flag to yes if the component license requires source code redistribution. Defaults to no when absent.
292-
- attribute: Set this flag to yes if the component license requires publishing an attribution or credit notice. Defaults to no when absent.
293-
- track_changes: Set this flag to yes if the component license requires tracking changes made to a the component. Defaults to no when absent.
316+
- redistribute: Set this flag to yes if the component license requires source code
317+
redistribution. Defaults to no when absent.
318+
- attribute: Set this flag to yes if the component license requires publishing an attribution
319+
or credit notice. Defaults to no when absent.
320+
- track_changes: Set this flag to yes if the component license requires tracking changes made to
321+
a the component. Defaults to no when absent.
294322
- modified: Set this flag to yes if the component has been modified. Defaults to no when absent.
295-
- internal_use_only: Set this flag to yes if the component is used internal only. Defaults to no when absent.
323+
- internal_use_only: Set this flag to yes if the component is used internal only.
324+
Defaults to no when absent.
296325

297326
Optional Extension fields
298327
-------------------------
@@ -312,8 +341,10 @@ prefix and a few common fields to handle the diversity of ways that VCS
312341
tools reference files and directories under version control:
313342

314343
- vcs_tool: VCS tool such as git, svn, cvs, etc.
315-
- vcs_repository: Typically a URL or some other identifier used by a VCS tool to point to a repository such as an SVN or Git repository URL.
316-
- vcs_path: Path used by a particular VCS tool to point to a file, directory or module inside a repository.
344+
- vcs_repository: Typically a URL or some other identifier used by a
345+
VCS tool to point to a repository such as an SVN or Git repository URL.
346+
- vcs_path: Path used by a particular VCS tool to point to a file,
347+
directory or module inside a repository.
317348
- vcs_tag: tag name or path used by a particular VCS tool.
318349
- vcs_branch: branch name or path used by a particular VCS tool.
319350
- vcs_revision: revision identifier such as a revision hash or version number.
@@ -344,7 +375,8 @@ to verify the integrity of a file documented by an ABOUT file.
344375

345376
- checksum_md5: MD5 for the file documented by this ABOUT file in the "about_resource" field.
346377
- checksum_sha1: SHA1 for the file documented by this ABOUT file in the "about_resource" field.
347-
- checksum_sha256: SHA256 for the file documented by this ABOUT file in the "about_resource" field.
378+
- checksum_sha256: SHA256 for the file documented by this ABOUT file in
379+
the "about_resource" field.
348380

349381
Some examples:
350382

0 commit comments

Comments
 (0)