Skip to main content

A Sphinx theme for Faculty projects.

Project description

faculty-sphinx-theme is a Sphinx theme for Faculty projects. It’s based on the Read the Docs theme, but with Faculty branding and an optional navigation bar for use in the Faculty platform docs.

Installation

pip install faculty-sphinx-theme

Usage

Install faculty-sphinx-theme and configure your Sphinx project to use the theme. In your project’s conf.py, add faculty_sphinx_theme to the list of enabled extensions:

extensions = [
    "faculty_sphinx_theme",
    # Plus any other extensions you are using
]

and modify the html_theme setting to:

html_theme = "faculty-sphinx-theme"

Theme options

The theme provides an optional extra navbar with custom links. To enable it, use the faculty_navbar settings. You’ll probably also want to set the faculty_navbar_root setting which defines the link on the “Faculty logo”:

html_theme_options = {
    "faculty_navbar": True,
    "faculty_navbar_root": "https://docs.faculty.ai/",
}

To add entries to the navbar, add sections to the faculty_navbar_content setting:

html_theme_options = {
    "faculty_navbar": True,
    "faculty_navbar_root": "https://docs.faculty.ai/",
    "faculty_navbar_content": [
        {"title": "Section 1", "url": "https://sectionone.com/"},
        {"title": "Section 2", "url": "https://sectiontwo.com/"},
    ]
}

You can also add menu items that appear on hover below the section headings. To add these, use the entries key on a section:

html_theme_options = {
    "faculty_navbar": True,
    "faculty_navbar_root": "https://docs.faculty.ai/",
    "faculty_navbar_content": [
        {
            "title": "Section 1",
            "url": "https://sectionone.com/",
            "entries": [
                {
                    "title": "Section 1.1",
                    "url": "https://sectionone.com/one",
                },
                {
                    "title": "Section 1.2",
                    "url": "https://sectionone.com/one",
                },
            ]
        },
        {"title": "Section 2", "url": "https://sectiontwo.com/"},
    ]
}

It’s also possible to mark sections and entries as external, meaning they will open in a separate tab, or to omit the URL entirely for e.g. section headings:

html_theme_options = {
    "faculty_navbar": True,
    "faculty_navbar_root": "https://docs.faculty.ai/",
    "faculty_navbar_content": [
        {
            "title": "No URL",
            "entries": [
                {
                    "title": "External link",
                    "url": "https://external.com/",
                    "external": True
                },
            ]
        },
        {"title": "Section 2", "url": "https://sectiontwo.com/"},
    ]
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for faculty-sphinx-theme, version 0.3.1
Filename, size File type Python version Upload date Hashes
Filename, size faculty_sphinx_theme-0.3.1-py2.py3-none-any.whl (15.6 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size faculty-sphinx-theme-0.3.1.tar.gz (16.7 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page