|
1 | 1 | .. _ref_user_guide:
|
2 | 2 |
|
3 |
| -========== |
4 | 3 | 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`. |
9 | 60 |
|
10 |
| -While the Ansys Sphinx theme is often used as is, you can customize the following: |
11 | 61 |
|
12 | 62 | .. grid:: 1 1 2 2
|
13 | 63 | :gutter: 2
|
|
0 commit comments