Skip to main content
Ctrl+K
Logo image Logo image

Site Navigation

  • Quickstart
  • Customization

Site Navigation

  • Quickstart
  • Customization
Logo image Logo image
Ctrl+K
  • Quickstart
  • Customization
    • Customize the primary sidebar
    • Customize the secondary sidebar
    • Announcement banners
    • Header content
    • Add a download page button
    • Add buttons to link to your source
    • Add your own CSS rules
    • Use a single-page version of this theme
  • .md

Add buttons to link to your source

Contents

  • Add a link to your repository
  • Add a button to open issues
  • Add a button to suggest edits

Add buttons to link to your source#

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. In each case, they require the following configuration to exist:

html_theme_options = {
    ...
    "repository_url": "https://github.com/{your-docs-url}",
    ...
}

Add a link to your repository#

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

html_theme_options = {
    ...
    "repository_url": "https://github.com/{your-docs-url}",
    "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 = {
    ...
    "repository_url": "https://github.com/{your-docs-url}",
    "use_issues_button": True,
    ...
}

Add a button to suggest edits#

You can add a button to each page that will allow users to edit the page text directly and submit a pull request to update the documentation. To include this button, use the following configuration:

html_theme_options = {
    ...
    "repository_url": "https://github.com/{your-docs-url}",
    "use_edit_page_button": True,
    ...
}

By default, the edit button will point to the master branch, but if you’d like to change this, use the following configuration:

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

By default, the edit button will point to the root of the repository. If your documentation is hosted in a sub-folder, use the following configuration:

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

previous

Add a download page button

next

Add your own CSS rules

On this page
  • Add a link to your repository
  • Add a button to open issues
  • Add a button to suggest edits

By AnyBody Technology

©; Copyright 2022, AnyBody Technology.

Last updated on None.