fix: only generate links to modules whose source files still exist - #421
Open
david-christiansen wants to merge 5 commits into
Open
david-christiansen wants to merge 5 commits into
david-christiansen wants to merge 5 commits into
Conversation
When a module is deleted, rebuilding documentation can leave stale module rows in the database. This PR adds a source path column to the modules table so the HTML generator can check whether the source file still exists and disregard the module if it doesn't. This change removes obsolete content from the tactic list as well as obsolete links. Source paths are stored relative to the module's package, which is now also stored. Lake now passes package directories to HTML generation. This keeps DB files cacheable and makes them robust to varying Lake settings that change where package sources are placed.
Contributor
Author
|
I believe this supersedes #416, and it can serve as a basis for #419 (which can provide a #416 resolves whether to link to module differently: it checks if it's either imported, or if there's already HTML for it. I think that approach has the following disadvantages relative to this one:
|
The navigation bar and the search index are built from the pages and the per-module search data on disk. They now cover only the modules found in the linking context, so a module whose source file is deleted is not included.
Updates the `headerData` command to also check whether files exist.
If a module's source path is bogus, `fromDb` now emits a warning on stderr instead of just generating a page that can't be linked to.
Package names that weren't valid Lean identifiers, like `doc-gen4`, were getting French-quoted.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When a module is deleted, rebuilding documentation can leave stale module rows in the database. This PR adds a source path column to the modules table so the HTML generator can check whether the source file still exists and disregard the module if it doesn't.
This change removes obsolete content from the tactic list as well as obsolete links.
Source paths are stored relative to the module's package, which is now also stored. Lake now passes package directories to HTML generation. This keeps DB files cacheable and makes them robust to varying Lake settings that change where package sources are placed.