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

Show more context in invalid local link warnings #2100

Merged
merged 3 commits into from Apr 16, 2023
Merged

Conversation

mortenpi
Copy link
Member

@mortenpi mortenpi commented Apr 14, 2023

Currently, if you have a problematic local link (like when at-ref doesn't get updated), we print an error, but it's often difficult to find it because it's just:

┌ Warning: invalid local link: unresolved path in tutorials/getting-started.md
│   link_url = "@ref"
└ @ Documenter.HTMLWriter ~/.julia/packages/Documenter/tAFWi/src/html/HTMLWriter.jl:2196

This makes the warnings a bit more verbose, by printing the whole link Node, which will also show the link text:

┌ Warning: invalid local link: unresolved path in tutorials/getting-started.md
│   link =
│    @ast MarkdownAST.Link("@ref", "") do
│      MarkdownAST.Code("Authentication")
│    end
│
└ @ Documenter.HTMLWriter ~/juliadocs/Documenter/src/html/HTMLWriter.jl:2195

It does render it as the MarkdownAST AST tree, and it would be better to print Markdown. But MarkdownAST does not (currently) have a AST -> Markdown converter, so this is the best we can do easily right now.

@mortenpi mortenpi merged commit ac0d556 into master Apr 16, 2023
20 of 21 checks passed
@mortenpi mortenpi deleted the mp/link-context branch April 16, 2023 05:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant