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
Warning if reference cannot be found #2268
Comments
@fap- can you please have a look? |
This is all part of the fix I'm working on for #858. Pulling one thread tugs on a whole row of related behaviors. The reason we aren't warning for invalid xrefs is because we don't yet catalog all the targets (i.e., anchors). We've added some additional ones, but we still have some to go. What we could do in the meantime is report any mismatches when the verbose flag is on. Once we can validate all of them, we can warn even when the verbose flag is not on. Related: #2257. |
Btw, this required some design work because AsciiDoc Python never tracked references at all. So we've had to define what it means to catalog the references so we're in a position to validate them. It's definitely a process. |
Here's the line in substitutors.rb where the xref is matched to a ref: asciidoctor/lib/asciidoctor/substitutors.rb Lines 1025 to 1034 in 4f78f60
Notice we don't yet validate there. But we could. |
The warning has the following form: asciidoctor: WARNING: could not resolve xref: closes asciidoctor#2268
The warning has the following form: asciidoctor: WARNING: could not resolve xref: closes asciidoctor#2268
Thanks, @mojavelinux for applying the patch and thanks to @fap- for providing the patch. This is very, very helpful to avoid errors in our documentation build. |
This doesn't seem to work from the gradle plugin..? I don't get any warnings printed out.. |
Most reference warnings only show when verbose mode is enabled. I can't remember if this setting is available via the Gradle plugin. I would follow-up there: https://github.com/asciidoctor/asciidoctor-gradle-plugin |
I frequently find that a reference is not working anymore. Would be great if Asciidoctor could (either always or optional) issue a warning for that.
We use a small Gradle extension to fail our documentation builds if a warning is issued.
Would be great if we could avoid having missing cross-references also.
Example:
The text was updated successfully, but these errors were encountered: