Commit Graph

7 Commits (be49f238794f3a7dd6d4df820fa6ce4ede04a4a3)

Author SHA1 Message Date
Mauren Berti a3b7cfd886
Add in-place substitution option for linkchecker.py (#41983)
* Add in-place replacement option for linkchecker.py

Add a new flag '-w' to enable an experimental in-place replacement for Markdown
links only.

* Apply suggestions from code review

Use formatted string literals instead of simple concatenation.

Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>

* Remove other paths that should not be changed.

* Add more logic to remove paths that start with http or paths that are already linking to the localized page (i.e. start with '/<language-code>').

* Apply suggestions from code review

Simplify expressions.

Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>

* Avoid updating pages in English.

* Fix syntax error in set comprehension

* Expand on documentation for new -w flag

* Update documentation for linkchecker.py in README

* Add a blurb with information about the new -w
  switch that describes what it does and what is
  the purpose of adding this behaviour change.
* Update the previously existing description to
  match the currently available script flags.

---------

Co-authored-by: Matt Boersma <Matt.Boersma@microsoft.com>
2023-07-14 10:07:49 -07:00
Miguel Garcia 754bee9fab linkchecker: detect absolute links with missing leading slash
When an absolute link is missing the leading slash (it starts with
"docs/foo" instead of "/docs/foo/"), print a more specific error instead
of the generic catch-all warning.

Without the leading slash, these are treated as relative paths and so
lead to non-existing pages.

Also, while we're at it, fix the instance it detects.
2023-05-27 23:19:29 +02:00
howieyuen f0ccbff316 [zh]Update other pages for links with '/zh/' prefix, using new prefix '/zh-cn/' 2022-06-24 11:13:35 +08:00
Qiming Teng 95257a2edd Improve the linkchecker script
The linkchecker script is not working the same way as the `scripts/lsync.sh`.

- The path must start with '/docs'. This is not implied in any way.
- The language can be deduced if user provides a full path to a markdown
  file, e.g. `content/en/docs/concepts/security/controlling-access.md`.
- The path parameter could use a positional argument for ease of use.

This PR improves the user experience for the tool.
2022-05-03 18:56:34 +08:00
Philippe Martin 216b34a3d1 Update script to check api-reference links 2021-09-11 10:59:46 +02:00
TAKAHASHI Shuuji f1349a26bb
Fix the description of `-f` argument 2021-04-18 11:31:01 +09:00
Qiming Teng d13f959fa1 Link checker for doc site.
Please see the in-file comment for details.
2020-07-20 16:19:06 +08:00