Skip to main content
Ctrl+K
⚠️This is an experimental release sphinx-syft-theme ⚠️

Syft Theme

  • Documentation
  • About
  • Contributing
  • Tutorial
  • Syft Theme
  • Twitter
  • GitHub
  • Slack
  • Join on slack for #support
  • Documentation
  • About
  • Contributing
  • Tutorial
  • Syft Theme
  • Twitter
  • GitHub
  • Slack
  • Join on slack for #support

Section Navigation

  • About the Sphinx Syft Theme
  • Standalone Pages
  • Change Log

Tutorials

  • Get started
  • Notebook Demo Template

Components

  • Add your own CSS rules
  • Add a download page button
  • Icon links and badges
  • Logo and branding
  • Buttons that link to source files
  • Persona in Syft Theme

Sections

  • Announcement banners
  • Content footer
  • Page footer
  • Header and navbar
  • Secondary sidebar and table of contents

Contribute

  • Set up your development workflow
  • Style and design
  • Creating sub-themes
  • Testing infrastructure
  • Translation workflow
  • Releases and version numbers
Feedback Form
Feedback sent!
  • .md

Buttons that link to source files#

There are a collection of buttons that you can use to link back to your source repository. This lets users browse the repository, or take actions like suggest an edit or open an issue.

Set your source repository#

You need to define a source repository for this functionality to work. This is the online space where your code / documentation is hosted. In each case, they require the following configuration to exist:

html_theme_options = {
    ...
    "repository_url": "https://{your-provider}/{org}/{repo}",
    ...
}

Three providers are supported:

  • GitHub: For example, https://github.com/executablebooks/sphinx-book-theme. This includes custom URLs for self-hosted GitHub.

  • GitLab: For example, https://gitlab.com/gitlab-org/gitlab. This includes custom URLs for self-hosted GitLab.

  • BitBucket: For example, https://opensource.ncsa.illinois.edu/bitbucket/scm/u3d/3dutilities.

In each case, we assume the final two URL items are the org/repo pair.

Manually specify the provider#

If your provider URL is more complex (e.g., if you’re self-hosting your provider), you can manually specify the provider with the following configuration:

html_theme_options = {
    ...
    "repository_provider": "gitlab"  # or "github", "bitbucket",
    "repository_url": "selfhostedgh.mycompany.org/user/repo",
    ...
}

Once this is provided, you may add source buttons by following the following sections.

Add a button to the page source#

Show the raw source of the page on the provider you’ve proivded. To add a button to the page source, first configure your source repository and then add:

html_theme_options = {
    ...
    "use_source_button": True,
    ...
}

Then configure the repository branch to use for your source. By default it is main, but if you’d like to change this, use the following configuration:

html_theme_options = {
    ...
    "repository_branch": "{your-branch}",
    ...
}

Finally, configure the relative path to your documentation. By default, this is the root of the repository, but if your documentation is hosted in a sub-folder, use the following configuration:

html_theme_options = {
    ...
    "path_to_docs": "{path-relative-to-site-root}",
    ...
}

Add a button to suggest edits#

Allow users to edit the page text directly on the provider and submit a pull request to update the documentation. To add a button to edit the page, first configure your source repository and then add:

html_theme_options = {
    ...
    "use_edit_page_button": True,
    ...
}

Then follow the branch and relative path instructions in the source file section.

Add a link to your repository#

To add a link to your repository, add the following configuration:

html_theme_options = {
    ...
    "use_repository_button": True,
    ...
}

Add a button to open issues#

To add a button to open an issue about the current page, use the following configuration:

html_theme_options = {
    ...
    "use_issues_button": True,
    ...
}

previous

Logo and branding

next

Persona in Syft Theme

On this page
  • Set your source repository
    • Manually specify the provider
  • Add a button to the page source
  • Add a button to suggest edits
  • Add a link to your repository
  • Add a button to open issues
Edit on GitHub
Show Source

Copyright © 2025

By Syft Theme Maintainer

Last updated on Jan 31, 2025.