Foliant preprocessor that checks the project for missing and unmentioned files.
Project description
CheckSources
CheckSources is a preprocessor that checks the project’s chapters for missing and unmentioned files in the sources directory.
Installation
$ pip install foliantcontrib.checksources
Usage
To enable the preprocessor, add checksources to preprocessors section in the project config:
preprocessors:
- checksources
Options
-
not_in_chapters– a list of files not mentioned in the the chapters. No warnings will be displayed for the specified files. This option is useful if you don't need to add some files to the table of contents. -
strict_check– if a critical error is detected, the build will be failed after applying the preprocessor. Several checks are supported:not_exist– checking the existence of the file. Checks if the file specified in chapters exists (enabled by default);duplicate– checking for duplicate in the chapters.
To disable strict check, use
strict_check: false. And in order to enable all available checks, usestrict_check: true. -
disable_warnings– disabling the output of warnings, just likestrict_checksupports:not_existandduplicate.
Example of options:
preprocessors:
- checksources:
not_in_chapters:
- tags.md
strict_check:
- not_exist
disable_warnings:
- duplicate
Integration with preprocessor Includes
All source files that are not mentioned in chapters or not_in_chapters cause warnings.
However, some files or parts of files may be included by the preprocessor Includes in other files.
Warnings about such included files may be unnecessary.
CheckSources can process the includes_map.json file generated by Includes and create a list of included files. Files from this list do not cause warnings.
To create a list of included files and avoid unnecessary warnings, enable generation of a map in the project config:
preprocessors:
- includes: #includes defined before checksources
includes_map: true
- ...
- checksources
Included files and MultiProject
MultiProject is an extension for Foliant to generate the documentation from multiple sources.
To create a list of included files for the entire project, CheckSources can process the multiproject_includes_map.json file generated by the Includesmap preprocessor from multiple includes_map.json files. If multiproject_includes_map.json and includes_map.json exist for the main project at the same time, CheckSources will use multiproject_includes_map.json.
To create a list of included files for the entire project, enable generation of maps in all configs and combining of maps in the config of the main project.
Config of main project:
preprocessors:
- includes:
includes_map: true
- includesmap
- ...
- checksources
Config of subproject:
preprocessors:
- includes:
includes_map: true
- ...
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file foliantcontrib_checksources-1.0.5.tar.gz.
File metadata
- Download URL: foliantcontrib_checksources-1.0.5.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
55619cec2ab9248892ffa58efdbb7878cd694091d78a47768b68c59d5eeee8e2
|
|
| MD5 |
c68ec42d5a789670377b50f93c8d4596
|
|
| BLAKE2b-256 |
590639b3ffe0b1fd722b7b7ee048244c93305e33094f5b5b5221f9befc835c55
|
File details
Details for the file foliantcontrib_checksources-1.0.5-py3-none-any.whl.
File metadata
- Download URL: foliantcontrib_checksources-1.0.5-py3-none-any.whl
- Upload date:
- Size: 5.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.23
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a354e0dc610d9196fd3614cd7eedee7f2e4cc616d8d7118a5448f6db80bafa0e
|
|
| MD5 |
cb95d3e22238568d1e543535fd5a08fc
|
|
| BLAKE2b-256 |
490dc631a8b4ece1bd9b9e2a79132bba1bac24bfd1c1cfe872c97acf8391d6b6
|