* 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>
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.
We have the translation guideline as [1], and that contains what are
valid Japanese words for the corresponding English words.
This adds a script to verify those words based on the guideline.
[1]: https://kubernetes.io/ja/docs/contribute/localization/
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.
The logic in the previous fix for supporting directory comparison was
incorrect. It was using the last commit in the target directory for
history checking. However, some files in the target directory might be
out of sync long before the last commit to the directory.
This PR changes the script to do a history checking on a per-file basis.
This PR improves the lsync script so that it can handle directories
(recursively). For example, you can run the following command to find
the detailed changes that are out of sync:
```
./scripts/lsync content/zh/docs/concepts/_index.md
```
and you can run the following command to identify how many files are
out of sync under a given directory:
```
> ./scripts/lsync content/zh/docs/concepts/
content/en/docs/concepts/architecture/control-plane-node-communication.md | 2 +-
content/en/docs/concepts/architecture/controller.md | 10 ++++++++++
content/en/docs/concepts/cluster-administration/logging.md | 4 ++--
content/en/docs/concepts/cluster-administration/system-metrics.md | 2 +-
content/en/docs/concepts/configuration/pod-priority-preemption.md | 2 +-
content/en/docs/concepts/containers/runtime-class.md | 2 +-
content/en/docs/concepts/extend-kubernetes/compute-storage-net/device-plugins.md | 2 +-
content/en/docs/concepts/extend-kubernetes/operator.md | 2 +-
content/en/docs/concepts/extend-kubernetes/service-catalog.md | 2 +-
content/en/docs/concepts/overview/kubernetes-api.md | 2 +-
content/en/docs/concepts/overview/what-is-kubernetes.md | 3 +--
content/en/docs/concepts/overview/working-with-objects/labels.md | 2 +-
content/en/docs/concepts/scheduling-eviction/kube-scheduler.md | 4 ++--
content/en/docs/concepts/services-networking/dual-stack.md | 2 +-
content/en/docs/concepts/storage/ephemeral-volumes.md | 11 +++++------
content/en/docs/concepts/storage/persistent-volumes.md | 2 +-
content/en/docs/concepts/storage/storage-classes.md | 2 +-
content/en/docs/concepts/storage/volumes.md | 5 ++---
content/en/docs/concepts/workloads/_index.md | 2 +-
content/en/docs/concepts/workloads/controllers/replicaset.md | 4 ++--
content/en/docs/concepts/workloads/pods/_index.md | 4 ++--
content/en/docs/concepts/workloads/pods/pod-lifecycle.md | 3 ++-
```
This PR adds a utility script for localization team to check changes
made to the English (upstream) source since last time the localized
version is updated (synchronized).
When a localization user uses diff_l10n_branches.py,
the directory of content on 'Proposed Solution' is fixed.
Thus, this commit changes the directory name according to the l10n language.
* Add a helper script for localization
The script generates a report of outdated contents in
`content/<l10n-lang>` directory by comparing two l10n
team milestone branches.
* Add description for scripts/diff_l10n_branches.py
This script will query all the changes that happen to a reference document (in English) since the last time a given translation was merged (For instance in French).
This could help all the translation team to keep up with the changes that happened inside the reference document.
* Check for examples changes in all branch commits
Review all the commits in the branch looking for changes inside
content/*/examples and if any are found, trigger testing.
This assumes that the main line branch is named "master"
* Tidy examples testing wrapper
- print diagnostics to standard error
- check for a "Yes" value rather than for absence of "No"