Skip to content

Commit 3bde2dc

Browse files
Revathyvenugopal162akaszynskijorgepiloto
authored
Feat/generalize to ansys theme (#58)
* rename the theme to ansys-sphinx-theme * add ansys logo to the theme * Update readme to ansys * Update readme for ansys-sphinx-theme * rename css file to ansys-sphinx-theme * rename to ansys sphinx theme in doc files * rename pyansys to ansys in workflow an makefile * Apply suggestions from code review Co-authored-by: Alex Kaszynski <[email protected]> * Update Makefile Co-authored-by: Alex Kaszynski <[email protected]> * update makefile for pdf * Apply suggestions from code review Co-authored-by: Jorge Martínez <[email protected]> * update target and name for badge. Co-authored-by: Alex Kaszynski <[email protected]> Co-authored-by: Jorge Martínez <[email protected]>
1 parent bcf9b07 commit 3bde2dc

40 files changed

+58
-56
lines changed

.github/workflows/ci_cd.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ jobs:
6060
uses: actions/upload-artifact@v2
6161
with:
6262
name: PDF-Documentation
63-
path: doc/build/latex/pyansys*.pdf
63+
path: doc/build/latex/ansys_sphinx_theme.pdf
6464
retention-days: 7
6565

6666
- name: Deploy to gh-pages
@@ -92,7 +92,7 @@ jobs:
9292
- name: Upload wheel and sdist to artifacts
9393
uses: actions/upload-artifact@v2
9494
with:
95-
name: pyasys-sphinx-theme
95+
name: ansys-sphinx-theme
9696
path: dist/
9797
retention-days: 7
9898

@@ -126,7 +126,7 @@ jobs:
126126
files: |
127127
./**/*.whl
128128
./**/*.tar.gz
129-
./PDF-Documentation/pyansys_sphinx_theme.pdf
129+
./PDF-Documentation/ansys_sphinx_theme.pdf
130130
- name: Release
131131
uses: softprops/action-gh-release@v1
132132
with:

README.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
PyAnsys Sphinx Theme
2-
====================
1+
Ansys Sphinx Theme
2+
==================
33
|pyansys| |python| |pypi| |GH-CI| |MIT| |black|
44

55
.. |pyansys| image:: https://img.shields.io/badge/Py-Ansys-ffc107.svg?logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAABDklEQVQ4jWNgoDfg5mD8vE7q/3bpVyskbW0sMRUwofHD7Dh5OBkZGBgW7/3W2tZpa2tLQEOyOzeEsfumlK2tbVpaGj4N6jIs1lpsDAwMJ278sveMY2BgCA0NFRISwqkhyQ1q/Nyd3zg4OBgYGNjZ2ePi4rB5loGBhZnhxTLJ/9ulv26Q4uVk1NXV/f///////69du4Zdg78lx//t0v+3S88rFISInD59GqIH2esIJ8G9O2/XVwhjzpw5EAam1xkkBJn/bJX+v1365hxxuCAfH9+3b9/+////48cPuNehNsS7cDEzMTAwMMzb+Q2u4dOnT2vWrMHu9ZtzxP9vl/69RVpCkBlZ3N7enoDXBwEAAA+YYitOilMVAAAAAElFTkSuQmCC
6-
:target: https://docs.pyansys.com/
7-
:alt: PyAnsys
6+
:target: https://ansys.github.io/
7+
:alt: Ansys
88

99
.. |python| image:: https://img.shields.io/badge/Python-3.7%20%7C%203.8%20%7C%203.9%20%7C%203.10-blue
1010
:target: https://pypi.org/project/pyansys-sphinx-theme/
@@ -29,7 +29,7 @@ PyAnsys Sphinx Theme
2929

3030
Introduction and Purpose
3131
------------------------
32-
The PyAnsys Sphinx theme is an extension of the popular `PyData
32+
The Ansys Sphinx theme is an extension of the popular `PyData
3333
Sphinx Theme <https://pydata-sphinx-theme.readthedocs.io/>`_ used by
3434
`numpy <https://numpy.org/doc/stable/>`_, `pandas
3535
<https://pandas.pydata.org/docs/>`_, `PyVista
@@ -41,10 +41,10 @@ consistently.
4141
Documentation
4242
~~~~~~~~~~~~~
4343
Full documentation can be found at `PyAnsys Sphinx Theme Documentation <https://sphinxdocs.pyansys.com>`_. The webpage was
44-
also built using the ``pyansys-sphinx-theme``, so visit the site for a
44+
also built using the ``ansys-sphinx-theme``, so visit the site for a
4545
preview of the theme.
4646

47-
Other PyAnsys packages using the PyAnsys theme include:
47+
Other PyAnsys packages using the Ansys theme include:
4848

4949
- `PyMAPDL <https://mapdldocs.pyansys.com/>`__
5050
- `PyAEDT <https://aedtdocs.pyansys.com/>`__
@@ -59,10 +59,10 @@ Install this theme with:
5959

6060
.. code::
6161
62-
pip install pyansys-sphinx-theme
62+
pip install ansys-sphinx-theme
6363
6464
Next, modify your sphinx ``conf.py`` to use ``html_theme =
65-
'pyansys_sphinx_theme'``. If you are new to using
65+
'ansys_sphinx_theme'``. If you are new to using
6666
Sphinx, see `Sphinx Getting Started
6767
<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_
6868
documentation.

doc/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,4 @@ clean:
2727
pdf:
2828
@$(SPHINXBUILD) -M latex "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2929
cd build/latex && latexmk -r latexmkrc -pdf *.tex -interaction=nonstopmode || true
30-
(test -f build/latex/pyansys*.pdf && echo pdf exists) || exit 1
30+
(test -f build/latex/ansys_sphinx*.pdf && echo pdf exists) || exit 1

doc/make.bat

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ goto end
3535
:pdf
3636
%SPHINXBUILD% -M latex %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
3737
cd "%BUILDDIR%\latex"
38-
pdflatex pyansys_sphinx_theme.tex --interaction=nonstopmode
38+
pdflatex ansys_sphinx_theme.tex --interaction=nonstopmode
3939

4040
:end
4141
popd

doc/source/class_documentation.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ using the ``autoclass`` directive:
4343

4444
.. code::
4545
46-
.. autoclass:: pyansys_sphinx_theme.samples.ExampleClass
46+
.. autoclass:: ansys_sphinx_theme.samples.ExampleClass
4747
:members:
4848
4949
50-
.. autoclass:: pyansys_sphinx_theme.samples.ExampleClass
50+
.. autoclass:: ansys_sphinx_theme.samples.ExampleClass
5151
:members:
5252

5353

@@ -63,15 +63,15 @@ documented via the ``autosummary`` directive. For example:
6363
.. autosummary::
6464
:toctree: _autosummary
6565
66-
pyansys_sphinx_theme.samples.Complex
66+
ansys_sphinx_theme.samples.Complex
6767
6868
6969
This code will generate the following documentation:
7070

7171
.. autosummary::
7272
:toctree: _autosummary
7373

74-
pyansys_sphinx_theme.samples.Complex
74+
ansys_sphinx_theme.samples.Complex
7575

7676
Each class will have its own dedicated page, and each method and
7777
attribute in that class will also have its own page.

doc/source/conf.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,25 @@
55

66
LaTeXBuilder.supported_image_types = ["image/png", "image/pdf", "image/svg+xml"]
77

8-
from pyansys_sphinx_theme import (
8+
from ansys_sphinx_theme import (
99
__version__,
1010
ansys_favicon,
11+
ansys_logo_black,
1112
ansys_logo_white,
1213
ansys_logo_white_cropped,
1314
latex,
14-
pyansys_logo_black,
1515
watermark,
1616
)
1717

1818
# Project information
19-
project = "pyansys_sphinx_theme"
19+
project = "ansys_sphinx_theme"
2020
copyright = f"(c) {datetime.now().year} ANSYS, Inc. All rights reserved"
2121
author = "Ansys Inc."
2222
release = version = __version__
2323

24-
# use the default pyansys logo
25-
html_logo = pyansys_logo_black
26-
html_theme = "pyansys_sphinx_theme"
24+
# use the default ansys logo
25+
html_logo = ansys_logo_black
26+
html_theme = "ansys_sphinx_theme"
2727

2828
# specify the location of your github repo
2929
html_theme_options = {
@@ -33,7 +33,7 @@
3333
],
3434
}
3535

36-
html_short_title = html_title = "PyAnsys Sphinx Theme"
36+
html_short_title = html_title = "Ansys Sphinx Theme"
3737

3838
# Sphinx extensions
3939
extensions = [
@@ -42,6 +42,7 @@
4242
"numpydoc",
4343
"sphinx.ext.intersphinx",
4444
"sphinx_copybutton",
45+
"ansys_sphinx_theme",
4546
]
4647

4748
# Intersphinx mapping

doc/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
============================================
2-
PyAnsys Sphinx Theme Documentation |version|
3-
============================================
1+
==========================================
2+
Ansys Sphinx Theme Documentation |version|
3+
==========================================
44

55
..
66
Simply reuse the root readme
@@ -20,7 +20,7 @@ PyAnsys Sphinx Theme Documentation |version|
2020
Code Examples
2121
~~~~~~~~~~~~~
2222
Here's a quick preview for how Python code looks using the
23-
``pyansys-sphinx-theme``. For more examples, click the links at the
23+
``ansys-sphinx-theme``. For more examples, click the links at the
2424
top of the page to see function, method, and class documentation.
2525

2626

doc/source/style.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ Methods and functions should generally be documented with the
1212
``Examples`` docstring section to make the usage of the method or
1313
function clear. Here is a sample function:
1414

15-
.. literalinclude:: ../../src/pyansys_sphinx_theme/sample_func.py
15+
.. literalinclude:: ../../src/ansys_sphinx_theme/sample_func.py
1616

1717
To include the docstring of function within sphinx, use the
1818
``autofunction::`` directive:
1919

2020
.. code::
2121
22-
.. autofunction:: pyansys_sphinx_theme.sample_func.func
22+
.. autofunction:: ansys_sphinx_theme.sample_func.func
2323
2424
Which causes the function to be rendered as:
2525

26-
.. autofunction:: pyansys_sphinx_theme.sample_func.func
26+
.. autofunction:: ansys_sphinx_theme.sample_func.func
2727

2828

2929
More Details

doc/source/usage.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ Install this theme with:
66

77
.. code::
88
9-
pip install pyansys-sphinx-theme
9+
pip install ansys-sphinx-theme
1010
1111
If you are are new to Sphinx, see the
1212
`Sphinx Getting Started
1313
<https://www.sphinx-doc.org/en/master/usage/quickstart.html>`_ documentation.
1414
Next, modify your Sphinx ``conf.py`` file to use ``html_theme =
15-
'pyansys_sphinx_theme'``. Consider using the following ``conf.py`` for this repository:
15+
'ansys_sphinx_theme'``. Consider using the following ``conf.py`` for this repository:
1616

1717
.. literalinclude:: ./conf.py
1818
:language: python
@@ -21,7 +21,7 @@ Next, modify your Sphinx ``conf.py`` file to use ``html_theme =
2121
For additional configuration options, see the `Configuration
2222
<https://pydata-sphinx-theme.readthedocs.io/en/latest/user_guide/configuring.html>`_
2323
topic for the PyData Sphinx theme, which is the basis for the style of this
24-
PyAnsys theme.
24+
theme.
2525

2626

2727
Editing the CSS
@@ -58,13 +58,13 @@ Use your ``custom.css`` file to override the CSS style of this theme.
5858

5959
Adding Breadcrumbs
6060
~~~~~~~~~~~~~~~~~~
61-
The PyAnsys Sphinx theme supports the display of breadcrumbs on
61+
The ``ansys-sphinx-theme`` supports the display of breadcrumbs on
6262
the body of documentation pages to make navigation easier. These
6363
breadcrumbs are disabled by default. To add
6464
breadcrumbs to the pages of your documentation, in the ``conf.py``
6565
file, add ``"show_breadcrumbs": True`` to the ``html_theme_options`` dictionary.
6666

67-
If you want to add additional 'root' breadcrumbs, such as to the PyAnsys
67+
If you want to add additional 'root' breadcrumbs, such as to the Ansys
6868
Documentation homepage, add them to the ``html_theme_options`` dictionary as a
6969
list of tuples with the ``"additional_breadcrumbs"`` key. The tuples are of the
7070
form ``("Link text", "url")``.
@@ -90,7 +90,7 @@ the title of the ``index.rst`` page. For example:
9090

9191
.. code:: python
9292
93-
html_short_title = html_title = 'PyAnsys Sphinx Theme'
93+
html_short_title = html_title = 'Ansys Sphinx Theme'
9494
9595
If you want to use the version number in
9696
the ``index.rst`` title, use ``|version|`` to include the package version

pyproject.toml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "flit_core.buildapi"
44

55
[project]
66
# Check https://flit.readthedocs.io/en/latest/pyproject_toml.html for all available sections
7-
name = "pyansys-sphinx-theme"
7+
name = "ansys-sphinx-theme"
88
dynamic = ["version", "description"]
99
readme = "README.rst"
1010
requires-python = ">=3.5"
@@ -30,19 +30,19 @@ dependencies = [
3030
]
3131

3232
[project.entry-points."sphinx.html_themes"]
33-
pyansys_sphinx_theme = "pyansys_sphinx_theme"
33+
ansys_sphinx_theme = "ansys_sphinx_theme"
3434

3535
[tool.flit.module]
36-
name = "pyansys_sphinx_theme"
36+
name = "ansys_sphinx_theme"
3737

3838
[tool.flit.sdist]
3939
include = [
40-
"src/pyansys_sphinx_theme/layout.html",
41-
"src/pyansys_sphinx_theme/breadcrumbs.html",
42-
"src/pyansys_sphinx_theme/docs-navbar.html",
43-
"src/pyansys_sphinx_theme/theme.conf",
44-
"src/pyansys_sphinx_theme/_templates/",
45-
"src/pyansys_sphinx_theme/static/",
40+
"src/ansys_sphinx_theme/layout.html",
41+
"src/ansys_sphinx_theme/breadcrumbs.html",
42+
"src/ansys_sphinx_theme/docs-navbar.html",
43+
"src/ansys_sphinx_theme/theme.conf",
44+
"src/ansys_sphinx_theme/_templates/",
45+
"src/ansys_sphinx_theme/static/",
4646
]
4747

4848
[project.urls]

0 commit comments

Comments
 (0)