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

[on hold] Add infrastructure for qiskit_legacy and qiskit_ecosystem_legacy themes #229

Closed
wants to merge 16 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
dd930c6
Add infrastructure for `qiskit_sdk__legacy_pytorch` and `qiskit_ecosy…
Eric-Arellano Mar 27, 2023
f8733d7
Review feedback: use simpler theme names & better folder organization
Eric-Arellano Mar 28, 2023
45a4332
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Mar 28, 2023
5c46f7c
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Mar 30, 2023
3185d3a
CI builds both themes & uploads both artifacts
Eric-Arellano Mar 30, 2023
2ef8708
Fix build dir
Eric-Arellano Mar 30, 2023
050795e
Merge branch 'main' into ecosystem-theme-infra
Eric-Arellano Mar 30, 2023
462515c
Review feedback: name folder `qiskit` not `terra`, and shorter MANIFE…
Eric-Arellano Mar 30, 2023
ce42bb5
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Mar 30, 2023
fa69aa6
Merge branch 'ecosystem-theme-infra' of https://github.com/Eric-Arell…
Eric-Arellano Mar 30, 2023
5e5532d
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Apr 7, 2023
877abfa
Make GitHub output more clear
Eric-Arellano Apr 7, 2023
03e75fd
Work around issue with Jupyter extension & custom BUILD_DIR
Eric-Arellano Apr 10, 2023
22cc881
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Apr 11, 2023
edf871a
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Apr 12, 2023
32e492f
Merge branch 'main' of https://github.com/Qiskit/qiskit_sphinx_theme …
Eric-Arellano Apr 13, 2023
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
11 changes: 8 additions & 3 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,17 @@ jobs:
run: |
python -m pip install -U 'tox<4'
- name: Build Docs
run: tox -e py
run: |
# Make sure that all themes can build.
BUILD_DIR=docs/_build_ecosystem_legacy/html tox -e py -- -D html_theme=qiskit_ecosystem_legacy
BUILD_DIR=docs/_build_terra_legacy/html tox -e py -- -D html_theme=qiskit_legacy
- name: Compress Artifacts
run: |
mkdir artifacts
tar -zcvf html_docs.tar.gz docs/_build/html
mv html_docs.tar.gz artifacts/.
tar -zcvf ecosystem_legacy_html_docs.tar.gz docs/_build_ecosystem_legacy/html
tar -zcvf terra_legacy_html_docs.tar.gz docs/_build_terra_legacy/html
mv ecosystem_legacy_html_docs.tar.gz artifacts/.
mv terra_legacy_html_docs.tar.gz artifacts/.
- uses: actions/upload-artifact@v2
with:
name: html_docs
Expand Down
4 changes: 3 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
recursive-include qiskit_sphinx_theme *.html
recursive-include qiskit_sphinx_theme theme.conf
graft qiskit_sphinx_theme/pytorch_base/static
graft qiskit_sphinx_theme/pytorch/base/static
graft qiskit_sphinx_theme/pytorch/ecosystem/static
graft qiskit_sphinx_theme/pytorch/terra/static
Eric-Arellano marked this conversation as resolved.
Show resolved Hide resolved
3 changes: 1 addition & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@

release = qiskit_sphinx_theme.__version__

html_theme = 'qiskit_sphinx_theme' # use the theme in subdir 'theme'
templates_path = ['_templates']
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you intend to remove templates_path? There does appear to be something in docs/_templates.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I meant to comment on this. It was a duplicate of a value lower in the file.

html_theme = 'qiskit_ecosystem_legacy'

rst_prolog = """
.. |version| replace:: {0}
Expand Down
14 changes: 12 additions & 2 deletions qiskit_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,20 @@ def get_html_theme_path():
stacklevel=2,
category=DeprecationWarning,
)
return _get_theme_absolute_path("pytorch_base")
return _get_theme_absolute_path("pytorch/ecosystem")


# See https://www.sphinx-doc.org/en/master/development/theming.html
def setup(app):
app.add_html_theme("qiskit_sphinx_theme", _get_theme_absolute_path("pytorch_base"))
# Note: base themes should not be exposed in the entry_points for the package
# (in setup.py/pyproject.toml). We only need to register the theme for `inherit` in `theme.conf`
# to work.
app.add_html_theme("__qiskit_pytorch_base", _get_theme_absolute_path("pytorch/base"))

app.add_html_theme('qiskit_legacy', _get_theme_absolute_path("pytorch/terra"))
Eric-Arellano marked this conversation as resolved.
Show resolved Hide resolved

ecosystem_pytorch_theme = _get_theme_absolute_path("pytorch/ecosystem")
app.add_html_theme('qiskit_sphinx_theme', ecosystem_pytorch_theme)
app.add_html_theme("qiskit_ecosystem_legacy", ecosystem_pytorch_theme)

return {'parallel_read_safe': True, 'parallel_write_safe': True}
Empty file.
3 changes: 3 additions & 0 deletions qiskit_sphinx_theme/pytorch/ecosystem/theme.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[theme]
inherit = __qiskit_pytorch_base
stylesheet = css/theme.css, css/overrides.css
Empty file.
3 changes: 3 additions & 0 deletions qiskit_sphinx_theme/pytorch/terra/theme.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[theme]
inherit = __qiskit_pytorch_base
stylesheet = css/theme.css, css/overrides.css
2 changes: 2 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
entry_points={
'sphinx.html_themes': [
'qiskit_sphinx_theme = qiskit_sphinx_theme',
'qiskit_ecosystem_legacy = qiskit_sphinx_theme',
'qiskit_legacy = qiskit_sphinx_theme',
],
},
license='Apache 2',
Expand Down
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,23 @@ usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
-r{toxinidir}/requirements-dev.txt
commands = sphinx-build -b html -W --keep-going -j auto {posargs} docs/ docs/_build/html
commands = sphinx-build -b html -W --keep-going -j auto {posargs} docs/ {env:BUILD_DIR:docs/_build/html}

[testenv:docs-guide]
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/docs_guide/requirements-extra.txt
commands = sphinx-build -b html -W --keep-going -j auto {posargs} docs_guide/ docs_guide/_build/html
commands = sphinx-build -b html -W --keep-going -j auto {posargs} docs_guide/ {env:BUILD_DIR:docs_guide/_build/html}

[testenv:doctest]
usedevelop = True
install_command = pip install -U {opts} {packages}
deps =
-r{toxinidir}/requirements-dev.txt
-r{toxinidir}/docs_guide/requirements-extra.txt
commands = sphinx-build -b doctest -W --keep-going -j auto {posargs} docs_guide/ docs_guide/_build/doctest
commands = sphinx-build -b doctest -W --keep-going -j auto {posargs} docs_guide/ {env:BUILD_DIR:docs_guide/_build/doctest}

[testenv:lint]
envdir = .tox/lint
Expand Down