Skip to content

tensorly/tensorly-sphinx-theme

Repository files navigation

TensorLy Sphinx Theme

This is the TensorLy theme for Sphinx documentations, based on Bulma.

Installation

After cloning this repository, simply run:

pip install -e .

Usage

To use the theme in your project, add the following to the conf.py file of your sphinx documentation:

html_theme = "tensorly_sphinx_theme"

Configuration

Project logo

The logo of your project will be used in the navigation bar. You can specify the path to it in your conf.py:

html_logo = '_static/image.png'

Navigation and main options

You can set most of the parameters in your sphinx configuration file (conf.py).

The options are:

  • 'google_analytics' : str, your Google analytics ID, if any.
  • 'nav_links' : tuple list, a list of ('Link display name', 'local.file'), contains the links to the local documentation, in the top navigation bar. If the link starts with 'http', it will be considered as an external link.
  • 'nav_dropdowns' : same as above but contains multiple links in a dropdown.

Example:

html_theme_options = {
    'google_analytics' : 'YOUR_GOOGLE_ANALYTICS_ID',
    'nav_links' : [('Install', 'installation'),
                   ('User Guide', 'user_guide/index'),
                   ('TensorLy', 'https://github.com/tensorly/tensorly'),
                   ('TensorLy-Torch', 'https://github.com/tensorly/torch')],
    'nav_dropdowns': [('LinksInDropdown', [('TensorLy', 'https://tensorly.org/dev'),
                                           ('TensorLy-Viz', 'https://tensorly.org/viz'),
                                           ('TensorLy-Quantum', 'https://tensorly.org/quantum')]
                      )],
}

In rst files

In your documentation itself, you can use :no-toc:, :no-localtoc: and :no-pagination: to remove the side-menu's table of content (toc), local toc ("on this page") and pagination buttons, respectively. For instance, if you don't want file.rst to have a toc, simply add in the file:

:no-toc: