# -*- coding: utf-8 -*-
#

import os
import sys

sys.path.insert(0, os.path.abspath("../../"))
sys.path.insert(0, os.path.abspath("./"))

import limits

from theme_config import *

project = "limits"
description = "limits is a python library to perform rate limiting with commonly used storage backends"
copyright = "2021, Ali-Akber Saifee"
version = release = limits.__version__.split("+")[0]

html_static_path = ["./_static"]
html_css_files = [
    "custom.css",
    "https://fonts.googleapis.com/css2?family=Fira+Code:wght@300;400;700&family=Fira+Sans:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap"
]

extensions = [
    "sphinx.ext.autodoc",
    "sphinx.ext.autosectionlabel",
    "sphinx.ext.autosummary",
    "sphinx.ext.extlinks",
    "sphinx.ext.intersphinx",
    "sphinx.ext.todo",
    "sphinx.ext.viewcode",
    "sphinxext.opengraph",
    "sphinxcontrib.programoutput",
    "sphinx_copybutton",
    "sphinx_panels",
    "sphinx_paramlinks",
]

autodoc_default_options = {
    "members": True,
    "inherited-members": True,
    "inherit-docstrings": True,
    "member-order": "bysource",
}

add_module_names = False
autoclass_content = "both"
autodoc_typehints_format = "short"
autosectionlabel_maxdepth = 3
autosectionlabel_prefix_document = True

extlinks = {"pypi": ("https://pypi.org/project/%s", "%s")}

intersphinx_mapping = {
    "python": ("http://docs.python.org/", None),
    "coredis": ("https://coredis.readthedocs.io/en/latest/", None),
    "emcache": ("https://emcache.readthedocs.io/en/latest/", None),
    "motor": ("https://motor.readthedocs.io/en/stable/", None),
    "redis-py-cluster": ("https://redis-py-cluster.readthedocs.io/en/latest/", None),
    "redis-py": ("https://redis-py.readthedocs.io/en/latest/", None),
    "pymemcache": ("https://pymemcache.readthedocs.io/en/latest/", None),
    "pymongo": ("https://pymongo.readthedocs.io/en/stable/", None),
}

@@ -341,16 +341,19 @@
 %0Aversion
+, _
  = relea
@@ -354,16 +354,22 @@
  release
+, part
  = limit
@@ -396,11 +396,8 @@
 %22+%22)
-%5B0%5D
 %0A%0Aht
@@ -686,19 +686,519 @@
 y=swap%22%0A
-
 %5D%0A%0A
+try:%0A    ahead = int(part.rsplit(%22.%22)%5B0%5D)%0A    if ahead %3E 0:%0A        html_theme_options%5B%22announcement%22%5D = f%22%22%22%0A        This is a development version. The documentation for the latest version: %3Cb%3E%7Brelease%7D%3C/b%3E can be found %3Ca href=%22/en/stable%22%3Ehere%3C/a%3E%0A        %22%22%22%0A        html_title = f%22%7Bproject%7D %3Csmall%3E%3Cb style='color: var(--color-brand-primary)'%3E%7B%7Bdev%7D%7D%3C/b%3E%3C/small%3E%22%0Aexcept Exception:%0A        html_title = f%22%7Bproject%7D %3Csmall%3E%3Cb style='color: var(--color-brand-primary)'%3E%7B%7B%7Brelease%7D%7D%7D%3C/b%3E%3C/small%3E%22%0A%0A
 extensio

Add banner for dev docs