Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 61 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
name: Docs

on:
pull_request:
push:
branches: [ main ]

# Allow job to be triggered manually.
workflow_dispatch:

# Cancel in-progress jobs when pushing to the same branch.
concurrency:
cancel-in-progress: true
group: ${{ github.workflow }}-${{ github.ref }}

jobs:

tests:

runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: [
"3.14",
]

env:
PYTHON: ${{ matrix.python-version }}
UV_SYSTEM_PYTHON: true

name: Link checker
steps:

- name: Acquire sources
uses: actions/checkout@v6

- name: Set up Python
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}

- name: Set up uv
uses: astral-sh/setup-uv@v7
with:
cache-dependency-glob: |
pyproject.toml
cache-suffix: ${{ matrix.python-version }}
enable-cache: true
version: "latest"

- name: Set up project
run: |

# Install package in editable mode.
uv pip install --editable='.[develop,docs]'

- name: Run link checker
run: |
poe docs-linkcheck
5 changes: 2 additions & 3 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@
- Dependencies: Added compatibility with sphinx 7 - 9

## v0.4.0 - 2024-06-27
- Dependencies: Update to sphinx-design 0.6.0
See also [sphinx-design change log].
- Dependencies: Updated to [sphinx-design 0.6.0]
- Remove support for Python 3.7 and 3.8, following `sphinx-design`.

## v0.3.2 - 2024-05-28
Expand Down Expand Up @@ -41,4 +40,4 @@
- Add "tag(s)" shortcuts, using roles `tag` and `tags`


[sphinx-design change log]: https://sphinx-design.readthedocs.io/en/furo-theme/changelog.html#v0-6-0-2024-05-23
[sphinx-design 0.6.0]: https://github.com/executablebooks/sphinx-design/releases/tag/v0.6.0
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ and maintaining [MyST Parser] and [sphinx-design].
[sphinx-design-elements]: https://sphinx-design-elements.readthedocs.io/

[badge-coverage]: https://codecov.io/gh/tech-writing/sphinx-design-elements/branch/main/graph/badge.svg
[badge-downloads-per-month]: https://pepy.tech/badge/sphinx-design-elements/month
[badge-downloads-per-month]: https://static.pepy.tech/badge/sphinx-design-elements/month
[badge-license]: https://img.shields.io/github/license/tech-writing/sphinx-design-elements.svg
[badge-docutils-versions]: https://img.shields.io/badge/docutils-0.19%20--%200.22-blue.svg
[badge-package-version]: https://img.shields.io/pypi/v/sphinx-design-elements.svg
Expand All @@ -80,7 +80,7 @@ and maintaining [MyST Parser] and [sphinx-design].
[badge-status]: https://img.shields.io/pypi/status/sphinx-design-elements.svg
[badge-tests]: https://github.com/tech-writing/sphinx-design-elements/actions/workflows/main.yml/badge.svg
[project-codecov]: https://codecov.io/gh/tech-writing/sphinx-design-elements
[project-downloads]: https://pepy.tech/project/sphinx-design-elements/
[project-downloads]: https://pepy.tech/project/sphinx-design-elements
[project-docutils]: https://docutils.sourceforge.io/
[project-license]: https://github.com/tech-writing/sphinx-design-elements/blob/main/LICENSE
[project-pypi]: https://pypi.org/project/sphinx-design-elements
Expand Down
2 changes: 1 addition & 1 deletion docs/backlog.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ orphan: true
- Documentation: Render on multiple themes, like `sphinx-design`.
- From `sphinx-design`
- horizontal card (grid row inside card, picture on left)
- subtitle for card (see <https://material.io/components/cards#anatomy>)
- subtitle for card (see <https://m3.material.io/components/cards/guidelines>)
- hyper: Maintain a synthetic intersphinx inventory for caching titles from
extracted HTML pages, so that subsequent invocations do not need to
extract titles over and over again.
Expand Down
18 changes: 16 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import os

project = "Sphinx Design Elements"
copyright = "2023-2025, Panodata Developers"
author = "Panodata Developers"
copyright = "2023-2026, Tech Writing Developers"
author = "Tech Writing Developers"

extensions = [
"myst_parser",
Expand Down Expand Up @@ -34,6 +34,20 @@
}

exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Configure link checker.
linkcheck_ignore = [
"https://github.com/",
"https://jkalina.carrd.co/",
"https://simpleicons.org/",
"https://unsplash.com/",
]
linkcheck_anchors_ignore_for_url = [
# Requires JavaScript.
# After opting-in to new GitHub issues, Sphinx can no longer grok the HTML anchor references.
"https://github.com/",
]

myst_enable_extensions = [
"attrs_block",
"attrs_inline",
Expand Down
2 changes: 1 addition & 1 deletion docs/css_classes.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ Taxi quer durch Bayern.
::::
:::::

[`compiled/style.css`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css
[`compiled/style.css`]: https://github.com/tech-writing/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css
2 changes: 1 addition & 1 deletion docs/get_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Getting Started

```{article-info}
:author: "[The Panodata Developers](https://github.com/panodata)"
:author: "[The Tech Writing Developers](https://github.com/tech-writing)"
:date: "{sub-ref}`today`"
:read-time: "1 min read"
```
Expand Down
2 changes: 1 addition & 1 deletion docs/infocard.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ without the maintenance nightmares of tables.

:::{grid-item}
:columns: 8
[example.org/beagles](https://example.org/beagles)
[example.org](https://example.org/)

A module for collecting votes from beagles, \
and for consolidating them.
Expand Down
10 changes: 5 additions & 5 deletions docs/sandbox.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ After invoking `poe check`, and observing the software tests succeed, you
should be ready to start hacking.

```shell
git clone https://github.com/panodata/sphinx-design-elements
git clone https://github.com/tech-writing/sphinx-design-elements
cd sphinx-design-elements
python3 -m venv .venv
source .venv/bin/activate
Expand Down Expand Up @@ -66,7 +66,7 @@ poe release
```


[`compiled/style.css`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css
[`gridtable.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/gridtable.py
[`infocard.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/infocard.py
[`tag.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/tag.py
[`compiled/style.css`]: https://github.com/tech-writing/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css
[`gridtable.py`]: https://github.com/tech-writing/sphinx-design-elements/blob/main/sphinx_design_elements/gridtable.py
[`infocard.py`]: https://github.com/tech-writing/sphinx-design-elements/blob/main/sphinx_design_elements/infocard.py
[`tag.py`]: https://github.com/tech-writing/sphinx-design-elements/blob/main/sphinx_design_elements/tag.py
2 changes: 1 addition & 1 deletion docs/snippets/myst/infocard.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

:::{grid-item}
:columns: 8
[example.org/beagles](https://example.org/beagles)
[example.org](https://example.org/)

A module for collecting votes from beagles, \
and for consolidating them.
Expand Down
2 changes: 1 addition & 1 deletion docs/snippets/rst/infocard.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
.. grid-item::
:columns: 8

`example.org/beagles <https://example.org/beagles>`_
`example.org <https://example.org/>`_

| A module for collecting votes from beagles,
| and for consolidating them.
Expand Down
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,10 @@ optional-dependencies.test = [
"sphinx-pytest<0.3",
"verlib2",
]
urls.changelog = "https://github.com/panodata/sphinx-design-elements/blob/main/CHANGES.md"
urls.changelog = "https://github.com/tech-writing/sphinx-design-elements/blob/main/CHANGES.md"
urls.documentation = "https://sphinx-design-elements.readthedocs.io/"
urls.homepage = "https://sphinx-design-elements.readthedocs.io/"
urls.repository = "https://github.com/panodata/sphinx-design-elements"
urls.repository = "https://github.com/tech-writing/sphinx-design-elements"

[tool.setuptools.packages.find]
namespaces = false
Expand Down Expand Up @@ -238,7 +238,10 @@ docs-autobuild = [
{ cmd = "sphinx-autobuild --open-browser --watch sphinx_design_elements docs docs/_build" },
]
docs-html = [
{ cmd = "sphinx-build -W --keep-going docs docs/_build" },
{ cmd = "sphinx-build --builder=html -W --keep-going docs docs/_build" },
]
docs-linkcheck = [
{ cmd = "sphinx-build --builder=linkcheck -W --keep-going docs docs/_build" },
]

format = [
Expand Down
12 changes: 6 additions & 6 deletions tests/test_hyper.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def test_hyper_http_url_valid(sphinx_doctree_no_tr: CreateDoctree):
ptree
== """
<reference refuri="https://example.org">
Example Domain
https://example.org
""".lstrip()
)

Expand Down Expand Up @@ -152,7 +152,7 @@ def test_hyper_button_basic(render):
== """
<reference classes="sd-sphinx-override sd-btn sd-text-wrap sd-btn-primary" refuri="https://example.org">
<inline>
Example Domain
https://example.org
""".lstrip()
)

Expand All @@ -166,7 +166,7 @@ def test_hyper_button_with_icon(render):
assert '<raw format="html"' in text
assert '<svg version="1.1"' in text
assert "example.org" in text
assert "Example Domain" in text
assert "https://example.org" in text


def test_hyper_button_icon_only(render):
Expand All @@ -192,7 +192,7 @@ def test_hyper_badge(render):
== """
<reference classes="sd-sphinx-override sd-badge sd-bg-primary sd-bg-text-primary" refuri="https://example.org">
<inline>
Example Domain
https://example.org
""".lstrip()
)

Expand All @@ -208,7 +208,7 @@ def test_hyper_card_minimal(render):
<container classes="sd-card sd-sphinx-override sd-mb-3 sd-shadow-sm sd-card-hover" design_component="card" is_div="True">
<container classes="sd-card-body" design_component="card-body" is_div="True">
<paragraph classes="sd-card-text">
Example Domain
https://example.org
<PassthroughTextElement>
<reference classes="sd-stretched-link sd-hide-link-text" refuri="https://example.org">
<inline>
Expand All @@ -234,7 +234,7 @@ def test_hyper_card_full(render):
<PassthroughTextElement>
title
<paragraph classes="sd-card-text">
Example Domain
https://example.org
<container classes="sd-card-footer" design_component="card-footer" is_div="True">
<paragraph classes="sd-card-text">
footer
Expand Down
4 changes: 2 additions & 2 deletions tests/test_snippets/snippet_myst_post_infocard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<container classes="sd-row sd-m-0 sd-p-0" design_component="grid-row" is_div="True">
<container classes="sd-col sd-d-flex-column sd-col-8 sd-col-xs-8 sd-col-sm-8 sd-col-md-8 sd-col-lg-8" design_component="grid-item" is_div="True">
<paragraph>
<reference refuri="https://example.org/beagles">
example.org/beagles
<reference refuri="https://example.org/">
example.org
<paragraph>
A module for collecting votes from beagles,
<raw format="html" xml:space="preserve">
Expand Down
4 changes: 2 additions & 2 deletions tests/test_snippets/snippet_myst_pre_infocard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@
<container classes="sd-row sd-m-0 sd-p-0" design_component="grid-row" is_div="True">
<container classes="sd-col sd-d-flex-column sd-col-8 sd-col-xs-8 sd-col-sm-8 sd-col-md-8 sd-col-lg-8" design_component="grid-item" is_div="True">
<paragraph>
<reference refuri="https://example.org/beagles">
example.org/beagles
<reference refuri="https://example.org/">
example.org
<paragraph>
A module for collecting votes from beagles,
<raw format="html" xml:space="preserve">
Expand Down
6 changes: 3 additions & 3 deletions tests/test_snippets/snippet_rst_post_infocard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<container classes="sd-row sd-m-0 sd-p-0" design_component="grid-row" is_div="True">
<container classes="sd-col sd-d-flex-column sd-col-8 sd-col-xs-8 sd-col-sm-8 sd-col-md-8 sd-col-lg-8" design_component="grid-item" is_div="True">
<paragraph>
<reference name="example.org/beagles" refuri="https://example.org/beagles">
example.org/beagles
<target ids="example-org-beagles" names="example.org/beagles" refuri="https://example.org/beagles">
<reference name="example.org" refuri="https://example.org/">
example.org
<target ids="example-org" names="example.org" refuri="https://example.org/">
<line_block>
<line>
A module for collecting votes from beagles,
Expand Down
6 changes: 3 additions & 3 deletions tests/test_snippets/snippet_rst_pre_infocard.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
<container classes="sd-row sd-m-0 sd-p-0" design_component="grid-row" is_div="True">
<container classes="sd-col sd-d-flex-column sd-col-8 sd-col-xs-8 sd-col-sm-8 sd-col-md-8 sd-col-lg-8" design_component="grid-item" is_div="True">
<paragraph>
<reference name="example.org/beagles" refuri="https://example.org/beagles">
example.org/beagles
<target ids="example-org-beagles" names="example.org/beagles" refuri="https://example.org/beagles">
<reference name="example.org" refuri="https://example.org/">
example.org
<target ids="example-org" names="example.org" refuri="https://example.org/">
<line_block>
<line>
A module for collecting votes from beagles,
Expand Down