Skip to content

Commit

Permalink
Switched to Furo theme.
Browse files Browse the repository at this point in the history
  • Loading branch information
lextm committed Mar 18, 2024
1 parent bd995bb commit c020baa
Show file tree
Hide file tree
Showing 7 changed files with 111 additions and 63 deletions.
19 changes: 0 additions & 19 deletions docs/source/.templates/layout.html

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes
48 changes: 41 additions & 7 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
sitemap_url_scheme = "{link}"

# Add any paths that contain templates here, relative to this directory.
templates_path = [".templates"]
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
Expand All @@ -56,7 +56,7 @@
master_doc = "index"

# General information about the project.
project = "SNMP SMI Compiler"
project = "PySMI 1.4 Documentation"
copyright = "2015-2020, Ilya Etingof; © Copyright 2022-2024, LeXtudio Inc."
author = "LeXtudio Inc. <[email protected]>"

Expand Down Expand Up @@ -103,6 +103,7 @@

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
pygments_dark_style = "monokai"

# A list of ignored prefixes for module index sorting.
# modindex_common_prefix = []
Expand All @@ -125,16 +126,39 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme = "furo"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = { 'collapse_navigation': False }
html_theme_options = {
"source_repository": "https://github.com/lextudio/pysmi",
"source_branch": "main",
"source_directory": "docs/source/",
"light_css_variables": {
"color-brand-primary": "white",
"color-brand-content": "#CC3333",
"color-admonition-background": "blue",
},
"footer_icons": [
{
"name": "GitHub",
"url": "https://github.com/lextudio/pysmi",
"html": "",
"class": "fa-brands fa-solid fa-github fa-2x",
},
],
}

html_css_files = [
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css",
"https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css",
]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
# html_title = None
html_title = "PySMI 1.4 Documentation"

# A shorter title for the navigation bar. Default is the same as html_title.
# html_short_title = None
Expand All @@ -146,12 +170,12 @@
# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = ".static/favicon.ico"
html_favicon = "_static/favicon.ico"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = [".static"]
html_static_path = ["_static"]

# Custom CSS theme
# html_style = 'css/rtdimproved.css'
Expand Down Expand Up @@ -323,3 +347,13 @@
napoleon_use_ivar = False
napoleon_use_param = False
napoleon_use_rtype = False


def setup(app):
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
if not on_rtd:
"""Insert Google Analytics tracker
Based on this Stackoverflow suggestion: https://stackoverflow.com/a/41885884
"""
app.add_js_file("https://www.googletagmanager.com/gtag/js?id=G-DYQGY4MKR3")
app.add_js_file("google_analytics_tracker.js")
105 changes: 69 additions & 36 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ isort = "^5.10.1"
importlib-metadata = { version = ">=0.12", python = "<3.8" }
sphinx-sitemap = "^2.5.1"
sphinx = "^5.0.0"
sphinx-rtd-theme = "^2.0.0"
furo = "^2023.1.1"
sphinx-copybutton = "^0.5.2"

[tool.poetry_bumpversion.file."pysmi/__init__.py"]
Expand Down

0 comments on commit c020baa

Please sign in to comment.