Conversation
tools/doc/allhtml.js
Outdated
| fs.writeFileSync(source + '/all.html', all, 'utf8'); | ||
|
|
||
| // Validate all hrefs have a target | ||
| const ids = {}; |
There was a problem hiding this comment.
Can we use a Set for this? I think that might be a tad more natural 🙂
cjihrig
left a comment
There was a problem hiding this comment.
LGTM, but agreed on using a Set.
vsemozhetbyt
left a comment
There was a problem hiding this comment.
Thank you! Glad to see this automated.
tools/doc/allhtml.js
Outdated
| // Write results. | ||
| fs.writeFileSync(source + '/all.html', all, 'utf8'); | ||
|
|
||
| // Validate all hrefs have a target |
There was a problem hiding this comment.
Nit: a period in the end.
This comment has been minimized.
This comment has been minimized.
|
Ignorable nit: not sure if this |
|
Just wanted to say thank you – this is super awesome ❤️ |
|
|
||
| const href_re = / href="#(\w+)"/g; | ||
| while (match = href_re.exec(all)) { | ||
| if (!ids.has(match[1])) throw new Error(`link not found: ${match[1]}`); |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
There was a problem hiding this comment.
I don't think efficiency is a concern here... it will only be retrieved twice at most one time per run, and only if an error is thrown.
This comment has been minimized.
This comment has been minimized.
tools/doc/allhtml.js
Outdated
|
|
||
| // Validate all hrefs have a target. | ||
| const ids = new Set(); | ||
| const id_re = / id="(\w+)"/g; |
PR-URL: #21889 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
|
Landed in 78039b5 |
PR-URL: #21889 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com>
When an API signature changes, it may break a link made to it in another part of the documentation. As a part of the generation of
all.html, check all such links to make sure that they have a valid target.Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes