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

Projects need to explicitly opt-in to Qiskit ecosystem #622

Merged
merged 3 commits into from
Aug 22, 2024
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
16 changes: 15 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,28 @@ The `qiskit_sphinx_theme` extension defines the below custom directives for you

You can add a custom logo by adding a logo file (SVG or PNG) as a sibling to your `conf.py`, e.g. `docs/logo.svg`. Then, set `html_logo` in `conf.py` to the name of the file, e.g. `html_logo = "logo.png"`.

When using a custom logo, you may want to disable the project's name in the sidebar by setting `sidebar_hide_name` in `html_theme_options`:
When using a custom logo, you may want to disable the project's name in the sidebar by setting `sidebar_hide_name` in `html_theme_options` in `conf.py`:

```python
html_theme_options = {
"sidebar_hide_name": True,
}
```

## Qiskit ecosystem members

If your project is a member of the [Qiskit ecosystem](https://www.ibm.com/quantum/ecosystem), we encourage you to set the following configuration so that the left sidebar mentions your project being in the ecosystem.

Update `conf.py`:

```python
html_theme_options = {
"sidebar_qiskit_ecosystem_member": True,
}
```

Non-ecosystem members should not set this option.

## Tip: suggested site structure

To keep UX/UI similar across different Qiskit ecosystem packages, consider using the following structure for your sidebar, which can be set in the toctree of your `index.rst`:
Expand Down
7 changes: 7 additions & 0 deletions example_docs/docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,13 @@
"source_directory": "example_docs/docs/",
}

# Members of the Qiskit ecosystem should set `sidebar_qiskit_ecosystem_member`
# explicitly in `html_theme_options`. This convoluted code is only set up
# this way to discourage projects who copy this config file from
# unintentionally configuring this option.
if project == "Example Docs":
html_theme_options["sidebar_qiskit_ecosystem_member"] = True

# This allows including custom CSS and HTML templates.
html_static_path = ["_static"]
templates_path = ["_templates"]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
{%- endif %}
{% endblock brand_content %}
</a>
{#- Add a link to the Qiskit ecosystem web page. -#}
{% if theme_sidebar_qiskit_ecosystem_member %}
<p class="sidebar-ecosystem-link">
This project is part of the <a class="reference external" href="https://www.ibm.com/quantum/ecosystem">Qiskit ecosystem</a>
</p>
{%- endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,6 @@ sidebars =
custom_templates/sidebar_languages.html

[options]
sidebar_qiskit_ecosystem_member =
# This option is no longer used in v2+, but it's kept for backwards compatibility.
disable_ecosystem_logo =