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

Warn if files in Pages of @content, @index do not exist #2302

Open
goerz opened this issue Oct 16, 2023 · 3 comments
Open

Warn if files in Pages of @content, @index do not exist #2302

goerz opened this issue Oct 16, 2023 · 3 comments

Comments

@goerz
Copy link
Member

goerz commented Oct 16, 2023

While writing the test for JuliaDocs/DocumenterCitations.jl#48, I stumbled on some issues with the Pages attribute in @content and @index blocks:

  1. There is no warning if a file listed in Pages does not exist. I'd even argue that in strict mode (default), referencing a file that does not exist should throw an exception.
  2. Pages in @content and @index blocks does not have normpath applied to it, which is inconsistent with @autodocs, as already noted in About non canonical bibliography inconsistencies (to autodocs) DocumenterCitations.jl#22 (comment). This is especially pernicious in combination with (1), as people are probably somewhat likely to just write unix path separators (/), and then have their documentation build be subtly wrong (but not fail) on Windows.

Arguably, @autodocs should also warn if its Pages contains an entry that doesn't match anything.

Both of the above problems are handled in DocumenterCitation's @bibliography block, leading to the inconsistencies shown in this example:

https://github.com/JuliaDocs/DocumenterCitations.jl/pull/48/files#diff-94253cd814e34a8eed4ea72a3fe7c963d73ea2149f6f080d42a8f933545c8bf1

@goerz goerz changed the title Warn if files in Pages of @content, @index, @autodocs do not exist Warn if files in Pages of @content, @index do not exist Oct 16, 2023
@goerz goerz changed the title Warn if files in Pages of @content, @index do not exist Warn if files in Pages of @content, @index do not exist Oct 16, 2023
@mortenpi
Copy link
Member

I'd even argue that in strict mode (default), referencing a file that does not exist should throw an exception.

I agree that this would be ideal. I am wondering how we should handle new build-breaking errors now that we have promised not to break things for a while (i.e. whether this would constitute a breaking change or not).

@laborg
Copy link
Contributor

laborg commented Oct 24, 2023

As a user, I would warmly accept this “breaking” change as it would help me avoid providing incorrect documentation (missing pages!).

@goerz
Copy link
Member Author

goerz commented Oct 24, 2023

Personally, I wouldn’t think of this as “breaking”, but I suppose it’s debatable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants