Skip to content

Commit 3c3ae4a

Browse files
docs: reformat the userguide and logos
1 parent cf50886 commit 3c3ae4a

16 files changed

+66
-14
lines changed

doc/source/getting_started/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Getting started
55

66
This section explains how to install the Ansys Sphinx theme and then set up your
77
Sphinx ``conf.py`` file to use this theme to generate your documentation.
8-
If you are interested in contributing to the theme, see the `Contributing <Pyansys_contributing>` for
8+
If you are interested in contributing to the theme, see the `PyAnsys Contributing <Pyansys_contributing>`_ for
99
information on installing the theme in development mode.
1010

1111
Package dependencies

doc/source/user_guide/index.rst

+56-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,63 @@
11
.. _ref_user_guide:
22

3-
==========
43
User guide
5-
==========
6-
The Ansys Sphinx theme is based on the `PyData Sphinx theme <https://github.com/pydata/pydata-sphinx-theme>`_.
7-
For more information on its configuration, see
8-
`Configuration <https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/>`_.
4+
##########
5+
6+
This section provides information on how to customize the Ansys Sphinx theme.
7+
8+
Basic usage
9+
===========
10+
Add the following to your `conf.py` file to use the Ansys Sphinx theme:
11+
12+
.. code-block:: python
13+
14+
html_theme = "ansys_sphinx_theme"
15+
16+
From ansys sphinx theme you can use the following features:
17+
18+
#. **PyAnsys and Ansys logos**
19+
20+
The Ansys Sphinx theme includes the PyAnsys and Ansys logos. All The logos
21+
are available in the
22+
`ansys_sphinx_theme/static/ <https://github.com/ansys/ansys-sphinx-theme/blob/main/src/ansys_sphinx_theme/theme/ansys_sphinx_theme/static/logos>`_
23+
directory. You can use the following code to add the logos to your documentation:
24+
25+
.. code-block:: python
26+
27+
from ansys_sphinx_theme import pyansys_logo_black, ansys_logo_black, ansys_favicon
28+
29+
html_logo = pyansys_logo_black
30+
html_favicon = ansys_favicon
31+
32+
``favicon`` is the icon that appears in the browser tab.
33+
34+
#. **Version switcher**
35+
36+
The Ansys Sphinx theme includes a version switcher that allows users to switch between different versions of the documentation.
37+
To use the version switcher, add the following code to your `conf.py` file:
38+
39+
.. code::
40+
41+
from ansys_sphinx_theme import get_version_match
42+
43+
version = "<your_version>"
44+
switcher_versions = get_version_match(version)
45+
cname = "<your_cname>"
46+
html_theme_options = {
47+
"switcher": {
48+
"json_url": f"https://{cname}/versions.json",
49+
"version_match": switcher_version,
50+
},
51+
52+
The switcher requires a `versions.json` file that contains the versions of the documentation and their URLs in the given ``json_url``.
53+
see `PyAnsys multi-version documentation <https://dev.docs.pyansys.com/how-to/documenting.html#enable-multi-version-documentation>`_
54+
for more information.
55+
56+
#. PDF cover page
57+
58+
The Ansys Sphinx theme includes a PDF cover page that you can customize.
59+
To customize the PDF cover page, see :ref:`ref_user_guide_pdf_cover`.
960

10-
While the Ansys Sphinx theme is often used as is, you can customize the following:
1161

1262
.. grid:: 1 1 2 2
1363
:gutter: 2

doc/styles/config/vocabularies/ANSYS/accept.txt

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ link_code_branch
1111
html_context
1212
autoapi
1313
(?i)HTML
14+
multi-version
1415
CSS
1516
PDF
1617
namespaces

src/ansys_sphinx_theme/__init__.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,17 @@
5252
TEMPLATES_PATH = THEME_PATH / "_templates"
5353
AUTOAPI_TEMPLATES_PATH = TEMPLATES_PATH / "autoapi"
5454
JS_FILE = JS_PATH / "table.js"
55+
LOGOS_PATH = STATIC_PATH / "logos"
5556

5657
# make logo paths available
57-
ansys_favicon = str((STATIC_PATH / "ansys-favicon.png").absolute())
58-
ansys_logo_black = str((STATIC_PATH / "ansys_logo_black_cropped.jpg").absolute())
59-
ansys_logo_white = str((STATIC_PATH / "ansys_logo_white.pdf").absolute())
60-
ansys_logo_white_cropped = str((STATIC_PATH / "ansys_logo_white_cropped.pdf").absolute())
58+
ansys_favicon = str((LOGOS_PATH / "ansys-favicon.png").absolute())
59+
ansys_logo_black = str((LOGOS_PATH / "ansys_logo_black_cropped.jpg").absolute())
60+
ansys_logo_white = str((LOGOS_PATH / "ansys_logo_white.pdf").absolute())
61+
ansys_logo_white_cropped = str((LOGOS_PATH / "ansys_logo_white_cropped.pdf").absolute())
6162
page_404 = str((STATIC_PATH / "404.rst").absolute())
62-
pyansys_logo_black = str((STATIC_PATH / "pyansys-logo-black-cropped.png").absolute())
63-
pyansys_logo_white = str((STATIC_PATH / "pyansys-logo-white-cropped.png").absolute())
64-
watermark = str((STATIC_PATH / "watermark.pdf").absolute())
63+
pyansys_logo_black = str((LOGOS_PATH / "pyansys-logo-black-cropped.png").absolute())
64+
pyansys_logo_white = str((LOGOS_PATH / "pyansys-logo-white-cropped.png").absolute())
65+
watermark = str((LOGOS_PATH / "watermark.pdf").absolute())
6566

6667

6768
def get_html_theme_path() -> pathlib.Path:

0 commit comments

Comments
 (0)