Commit Graph

6 Commits

Author SHA1 Message Date
Han Han
28141adfdc scripts: Fix the flake8 syntax-check failures
Fix the syntax-check failures (which can be seen after
python3-flake8-import-order package is installed) with the help
of isort[1]:

289/316 libvirt:syntax-check / flake8   FAIL   5.24s   exit status 2

[1]: https://pycqa.github.io/isort/

Signed-off-by: Han Han <hhan@redhat.com>
Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
2023-06-29 11:51:27 +02:00
Peter Krempa
edac6ca756 scripts: check-html-refernces: Add checking for image file usage
Check both that a file is referenced from our pages and also that pages
reference existing images.

The mode for dumping external references now also dumps images.

'--ignore-image' can be used repeatedly to suppress errors for specific
images.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15 12:38:45 +01:00
Peter Krempa
61dcca1b23 scripts: check-html-references: Detect pages that are not linked to
Prevent sub-pages without a way to reach them.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15 12:38:45 +01:00
Peter Krempa
00956b55bf scripts: check-html-references: Improve error messages and don't mess with relative paths
Now that we have the source file name as a custom attribute we can use
it to report which file actually needs to be edited to fix the error:

 ERROR: 'docs/uri.rst': broken link to: 'drvqemu.html#exaple'

rather than:

 broken link targets:
 docs/uri.html broken link: drvqemu.html#exaple

which pointed to file which does not exist in the source directory.

This also allows us to delete all the relative path handling needed to
report at least somewhat user-legible errors before.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15 12:38:45 +01:00
Peter Krempa
70211d7368 scripts: check-html-references: Rename --prefix to --webroot and make it mandatory
Force users to pass the path to the root of the webpage the script
should check. The script lives in a different subdirectory so the
default of the current directory doesn't make much sense.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
2023-02-15 12:38:45 +01:00
Peter Krempa
8452124669 docs: Add HTML reference checker
In many cases we move around or rename internal anchors which may break
links leading to the content.

docutils handle the case of links inside a document, but we are lacking
the same form of checking between documents.

Introduce a script which cross-checks all the anchors and links in HTML
output files and prints problems and use it as a test case for the
'docs' directory.

Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
2022-06-01 12:27:10 +02:00