Skip to content
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

CI: Check asciidoc link/linkdoc/... validity during builds #1958

Open
jimklimov opened this issue Jun 5, 2023 · 3 comments
Open

CI: Check asciidoc link/linkdoc/... validity during builds #1958

jimklimov opened this issue Jun 5, 2023 · 3 comments
Labels
bug CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) documentation
Milestone

Comments

@jimklimov
Copy link
Member

As confirmed during issue #1957 investigation, we can generate documentation entries intended to be cross-linked (within the present set of documents) with such links leading nowhere in fact, e.g. if some anchors were planned but forgotten, lost in refactoring, mis-typed or with wrong markup so not recognized, etc.

This issue is about somehow (using asciidoc itself? parsing the HTMLs/PDFs?) determining that documentation links which should lead to targets in the same codebase (not absolute URLs) in fact lead nowhere, and making it a fatal problem for automated builds eventually.

Feels related to #823 (fightwarn in C/C++ code) :)

For examples currently online, a generated wrong link for "A.2.2 ups: General unit information -> ups.status -> OL" looks like this:

  • in PDF:
    https://networkupstools.org/docs/developer-guide.pdf#[0,{%22name%22:%22Fit%22}]
    
  • in HTML:
    https://networkupstools.org/docs/developer-guide.chunked/index.html
    

For comparison, a nearby link to "NUT daisychain support notes" looks like this:

  • in PDF:
    https://networkupstools.org/docs/developer-guide.pdf#daisychain
    
  • in HTML:
    https://networkupstools.org/docs/developer-guide.chunked/apb.html
    
@jimklimov jimklimov added bug documentation CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) labels Jun 5, 2023
@jimklimov jimklimov added this to the NUT 2.9 milestone Jun 5, 2023
@jimklimov
Copy link
Member Author

When it gets to this, also check if nut-website handles these links somehow differently compared to "local HTML" documentation builds. Maybe the solution would need to cater to many situations.

@jimklimov
Copy link
Member Author

FWIW, it may make sense to adopt somehow the auto-URI scheme which includes the original filename, and makes some things easier, maybe. Looking at URLs like https://git-scm.com/docs/pretty-formats#Documentation/pretty-formats.txt-emnem as inspiration for this part of the idea.

@jimklimov jimklimov changed the title CI: Check asciidoc link/linkdoc/... validity during buidls CI: Check asciidoc link/linkdoc/... validity during builds Jun 7, 2023
@jimklimov
Copy link
Member Author

Related to networkupstools/nut-website#52 and (partially?) addressed by networkupstools/nut-website#53 and networkupstools/nut-website#54 introducing htmlproofer check ability into NUT-Website builds.

At the moment the subject is left "as is". Some issues were found and fixed, others await their time, and it does not seem like something for NUT CI to pick up soon, as the check takes tens of minutes (maybe a bit less if not crawling external dead links, but only cross-page references).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug CI Entries related to continuous integration infrastructure (historically also recipes like Makefiles) documentation
Projects
None yet
Development

No branches or pull requests

1 participant