Skip to content

Commit

Permalink
Update some of the diverging links.
Browse files Browse the repository at this point in the history
Update the script with colors for better readability.

It is weird but www.sphinx-doc.org redirecto to sphinx-doc.org/en/master,
and display docs. But base sphinx-doc.org/ (without www) hangs for me.
  • Loading branch information
Carreau committed Oct 10, 2024
1 parent 5135b8f commit 5856575
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/community/structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Location and structure of documentation

The documentation for this theme is in the `docs/` folder.
It is structured as a [Sphinx documentation site](https://sphinx-doc.org).
It is structured as a [Sphinx documentation site](https://www.sphinx-doc.org/).
The content is written in a combination of reStructuredText and MyST Markdown.

## Location and structure of CSS/JS assets
Expand Down
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"external_links": [
{
"url": "https://pydata.org",
"name": "PyData",
"name": "PyData Website",
},
{
"url": "https://numfocus.org/",
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/kitchen-sink/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Kitchen Sink

.. note::

The Kitchen Sink was generated from the `Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase of themes for `Sphinx <https://sphinx-doc.org>`_.
The Kitchen Sink was generated from the `Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase of themes for `Sphinx <https://www.sphinx-doc.org/>`_.
Check it out to see other great themes.

.. button-link:: https://sphinx-themes.org
Expand Down
2 changes: 1 addition & 1 deletion docs/scripts/update_kitchen_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
EXTRA_MESSAGE = """\
.. note::
The Kitchen Sink was generated from the `Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase of themes for `Sphinx <https://sphinx-doc.org>`_.
The Kitchen Sink was generated from the `Sphinx Themes website <https://sphinx-themes.org/>`_, a community-supported showcase of themes for `Sphinx <https://www.sphinx-doc.org/>`_.
Check it out to see other great themes.
.. button-link:: https://sphinx-themes.org
Expand Down
9 changes: 5 additions & 4 deletions tools/divergent_links.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
from urllib.parse import urljoin

from bs4 import BeautifulSoup
from rich import print

# when looking at inconsistent links across pages,
# a number of text is recurrent and appear on many pages.
Expand Down Expand Up @@ -90,16 +91,16 @@ def duplicates(self):
uniq_url = {u for u, _ in url_pages}
if len(uniq_url) >= 2:
print(
f'The link text "{content!r}" appears {len(url_pages)} times, '
f"The link text [red]{content!r}[/red] appears {len(url_pages)} times, "
f"and links to {len(uniq_url)} different URLs, on the following pages:"
)
dct = defaultdict(list)
for u, p in url_pages:
dct[u].append(p)
for u, ps in dct.items():
print(" ", u, "in")
for p in ps:
print(" ", p)
print(f" [blue]{u}[/blue] in")
for p in set(ps):
print(f" [green]{p}[/green]")


if len(sys.argv) == 3 and sys.argv[2] == "--all":
Expand Down

0 comments on commit 5856575

Please sign in to comment.