Skip to main content

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 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.

    Files can be specified in this option using Unix-style wildcards. The comparison is case-sensitive.

  • 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, use strict_check: true.

  • disable_warnings – disabling the output of warnings, just like strict_check supports: not_exist and duplicate.

Example of options:

preprocessors:
    - checksources:
        not_in_chapters:
          - tags.md
          - archive/*
        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  
    - ...

Metadata

Release files for foliantcontrib.checksources 1.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for foliantcontrib.checksources 1.0.6
File Size Uploaded
foliantcontrib_checksources-1.0.6.tar.gz 5.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for foliantcontrib.checksources 1.0.6
File Interpreter ABI Platform
foliantcontrib_checksources-1.0.6-py3-none-any.whl Python 3 none any Details

Total release size: 10.6 kB

Release files / foliantcontrib_checksources-1.0.6.tar.gz

Download URL foliantcontrib_checksources-1.0.6.tar.gz
Size 5.1 kB
Tags Source
SHA-256 checksum
How to use checksums
e239774a3720f446554827351c20c0af64df9bef3d9c9914b2b26865f3a81584
BLAKE2b-256 checksum
How to use checksums
7a4edccfbc48e3f263806a2f2ade70a7bd4b22b28d9a01c3e9fa0a0755482e23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release files / foliantcontrib_checksources-1.0.6-py3-none-any.whl

Download URL foliantcontrib_checksources-1.0.6-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5cd960c171e946d3aa7ae541002a380d7edb0380197d4e33ac485b288b0d27ac
BLAKE2b-256 checksum
How to use checksums
79300257bea82e2ba4557bf2af75ee69672c5bddfd17ac12737524601c52dc54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

1.0.6 This release

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page