Giter VIP home page Giter VIP logo

faculty-sphinx-theme's Introduction

faculty-sphinx-theme

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/"},
    ]
}

faculty-sphinx-theme's People

Contributors

acroz avatar imrehg avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

faculty-sphinx-theme's Issues

Search not working

When searching with the docs built with this theme (v 0.2.2), the search page idles and the JS console says:

Uncaught ReferenceError: Stemmer is not defined

According to this issue it was fixed by the sphinx_rtd_repo. I imagine a simple update to 0.5.1 of the dependency should do the trick.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.