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

[Docs] Add link checker for docs #475

Merged
merged 9 commits into from
May 14, 2024
2 changes: 1 addition & 1 deletion vizro-ai/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ build:
python: "3.11"
commands:
- pip install hatch
- cd vizro-ai/ && hatch run docs:mkdocs build --strict
antonymilne marked this conversation as resolved.
Show resolved Hide resolved
- cd vizro-ai/ && hatch run docs:build && hatch run docs:link-check
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-ai/site/ $READTHEDOCS_OUTPUT/html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Removed

- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
12 changes: 10 additions & 2 deletions vizro-ai/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,18 @@ dependencies = [
"mkdocs",
"mkdocs-material",
"mkdocs-git-revision-date-localized-plugin",
"mkdocstrings[python]"
"mkdocstrings[python]",
"linkchecker"
]
detached = true
scripts = {serve = "mkdocs serve --strict"}

[envs.docs.scripts]
build = "mkdocs build --strict"
# Disable warnings on the linkcheck so that HTTP redirects are accepted. We could ignore only that warning and specify
# more advanced settings using a linkcheckerrc config file. openai.com doesn't seem to work well with linkchecking,
# throwing 403 errors, but these are not real errors.
link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1 --ignore-url=https://platform.openai.com/docs/models --ignore-url=openai.com --ignore-url=https://openai.com/"
serve = "mkdocs serve --strict"

[envs.lint]
dependencies = [
Expand Down
2 changes: 1 addition & 1 deletion vizro-core/.readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ build:
python: "3.11"
commands:
- pip install hatch
- cd vizro-core/ && hatch run docs:mkdocs build --strict
- cd vizro-core/ && hatch run docs:build && hatch run docs:link-check
- mkdir --parents $READTHEDOCS_OUTPUT
- mv vizro-core/site/ $READTHEDOCS_OUTPUT/html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!--
A new scriv changelog fragment.

Uncomment the section that is right (remove the HTML comment wrapper).
-->

<!--
### Highlights ✨

- A bullet item for the Highlights ✨ category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Removed

- A bullet item for the Removed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Added

- A bullet item for the Added category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Changed

- A bullet item for the Changed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Deprecated

- A bullet item for the Deprecated category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Fixed

- A bullet item for the Fixed category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
<!--
### Security

- A bullet item for the Security category with a link to the relevant PR at the end of your entry, e.g. Enable feature XXX ([#1](https://github.com/mckinsey/vizro/pull/1))

-->
2 changes: 1 addition & 1 deletion vizro-core/docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Vizro is a toolkit for creating modular data visualization applications.
---

[:octicons-arrow-right-24: How is Vizro different to Streamlit?](pages/explanation/faq/#how-does-vizro-differ-from-dash-or-streamlit) <br/>
[:octicons-arrow-right-24: Other FAQs](/pages/explanation/faq/)
[:octicons-arrow-right-24: Other FAQs](pages/explanation/faq/)



Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ This is the style guide we apply to the [Vizro documentation](https://vizro.read

We ask anyone kind enough to contribute documentation changes to follow this style for consistency and simplicity.

What follows is a set of lightweight guidelines rather than rules. There are always edge cases and exceptions, and if it's not obvious what the style should be, consult the [Microsoft style guide](https://docs.microsoft.com/en-gb/style-guide/welcome/) for an example of good practice. We also use the [INCITS Inclusive Terminology Guidelines](https://standards.incits.org/apps/group_public/download.php/131246/eb-2021-00288-001-INCITS-Inclusive-Terminology-Guidelines.pdf).
What follows is a set of lightweight guidelines rather than rules. There are always edge cases and exceptions, and if it's not obvious what the style should be, consult the [Microsoft style guide](https://docs.microsoft.com/en-gb/style-guide/welcome/) for an example of good practice. We also check the [ensure inclusive terminology](https://developers.google.com/style/inclusive-documentation) with the Google developer documentation style guide.
antonymilne marked this conversation as resolved.
Show resolved Hide resolved

## Vizro lexicon

Expand Down
11 changes: 9 additions & 2 deletions vizro-core/hatch.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,10 +66,17 @@ dependencies = [
"mkdocs",
"mkdocs-material",
"mkdocs-git-revision-date-localized-plugin",
"mkdocstrings[python]"
"mkdocstrings[python]",
"linkchecker"
]
detached = true
scripts = {serve = "mkdocs serve --strict"}

[envs.docs.scripts]
build = "mkdocs build --strict"
# Disable warnings on the linkcheck so that HTTP redirects are accepted. We could ignore only that warning and specify
# more advanced settings using a linkcheckerrc config file.
link-check = "linkchecker site --check-extern --no-warnings --ignore=404.html --ignore-url=127.0.0.1"
serve = "mkdocs serve --strict"

[envs.lint]
dependencies = [
Expand Down
Loading