# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "pypergraph"
copyright = "2022, Xavier Lin"
author = "Xavier Lin"

# The full version, including alpha/beta/rc tags
release = "0.0.1"


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
    "myst_parser",
    "sphinx.ext.autodoc",
    "sphinx.ext.napoleon",
    "sphinx.ext.doctest",
]

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

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

source_suffix = {".md": "markdown"}

today_fmt = "%Y-%m-%d"

# -- doctest settings --------------------------------------------------------
doctest_global_setup = """
try:
    import pypergraph as ppg
except ImportError:
    ppg = None
"""

# -- MyST settings -----------------------------------------------------------
myst_enable_extensions = [
    "substitution",
]

myst_substitutions = {
    "project": project,
    "release": release,
}


# -- Autodoc settings --------------------------------------------------------
autoclass_content = "class"
autodoc_class_signature = "separated"
autodoc_typehints = "description"


# -- Napoleon settings -------------------------------------------------------
napoleon_google_docstring = True
napoleon_numpy_docstring = False


# -- Options for HTML output -------------------------------------------------

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

# 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_use_index = False
html_title = f"{project} documentation v{release}"

codeberg_icon_blue_svg = """
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   width="16"
   height="16"
   viewBox="0 0 4.2333332 4.2333335"
   version="1.1"
   id="svg1468"
   sodipodi:docname="codeberg-logo_icon_blue.svg"
   inkscape:version="1.2-alpha1 (b6a15bb, 2022-02-23)"
   inkscape:export-filename="/home/mray/Projects/Codeberg/logo/icon/png/codeberg-logo_icon_blue.png"
   inkscape:export-xdpi="384"
   inkscape:export-ydpi="384"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title
     id="title16">Codeberg logo</title>
  <defs
     id="defs1462">
    <linearGradient
       xlink:href="#linearGradient6924"
       id="linearGradient6918"
       x1="42519.285"
       y1="-7078.7891"
       x2="42575.336"
       y2="-6966.9307"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       id="linearGradient6924">
      <stop
         style="stop-color:#2185d0;stop-opacity:0"
         offset="0"
         id="stop6920" />
      <stop
         id="stop6926"
         offset="0.49517274"
         style="stop-color:#2185d0;stop-opacity:0.48923996" />
      <stop
         style="stop-color:#2185d0;stop-opacity:0.63279623"
         offset="1"
         id="stop6922" />
    </linearGradient>
    <linearGradient
       xlink:href="#linearGradient6924-6"
       id="linearGradient6918-3"
       x1="42519.285"
       y1="-7078.7891"
       x2="42575.336"
       y2="-6966.9307"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       id="linearGradient6924-6">
      <stop
         style="stop-color:#2185d0;stop-opacity:0;"
         offset="0"
         id="stop6920-7" />
      <stop
         id="stop6926-5"
         offset="0.49517274"
         style="stop-color:#2185d0;stop-opacity:0.30000001;" />
      <stop
         style="stop-color:#2185d0;stop-opacity:0.30000001;"
         offset="1"
         id="stop6922-3" />
    </linearGradient>
  </defs>
  <sodipodi:namedview
     showborder="false"
     id="base"
     pagecolor="#ffffff"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0.0"
     inkscape:pageshadow="2"
     inkscape:zoom="22.627417"
     inkscape:cx="12.948893"
     inkscape:cy="12.661631"
     inkscape:document-units="px"
     inkscape:current-layer="svg1468"
     inkscape:document-rotation="0"
     showgrid="false"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     units="px"
     inkscape:snap-global="false"
     inkscape:snap-page="true"
     showguides="false"
     inkscape:window-width="1531"
     inkscape:window-height="873"
     inkscape:window-x="69"
     inkscape:window-y="27"
     inkscape:window-maximized="1"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1">
    <inkscape:grid
       type="xygrid"
       id="grid2067" />
  </sodipodi:namedview>
  <metadata
     id="metadata1465">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title>Codeberg logo</dc:title>
        <cc:license
           rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
        <dc:creator>
          <cc:Agent>
            <dc:title>Robert Martinez</dc:title>
          </cc:Agent>
        </dc:creator>
        <dc:rights>
          <cc:Agent>
            <dc:title>Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.</dc:title>
          </cc:Agent>
        </dc:rights>
        <dc:date>2020-04-09</dc:date>
        <dc:publisher>
          <cc:Agent>
            <dc:title>Codeberg e.V.</dc:title>
          </cc:Agent>
        </dc:publisher>
        <dc:source>codeberg.org</dc:source>
      </cc:Work>
      <cc:License
         rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Reproduction" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Distribution" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
      </cc:License>
    </rdf:RDF>
  </metadata>
  <g
     id="g370484"
     inkscape:label="logo"
     transform="matrix(0.06551432,0,0,0.06551432,-2.232417,-1.431776)">
    <path
       id="path6733-5"
       style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:url(#linearGradient6918-3);fill-opacity:1;stroke:none;stroke-width:3.67846;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:2;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill;stop-color:#000000;stop-opacity:1"
       d="m 42519.285,-7078.7891 a 0.76086879,0.56791688 0 0 0 -0.738,0.6739 l 33.586,125.8886 a 87.182358,87.182358 0 0 0 39.381,-33.7636 l -71.565,-92.5196 a 0.76086879,0.56791688 0 0 0 -0.664,-0.2793 z"
       transform="matrix(0.37058478,0,0,0.37058478,-15690.065,2662.0533)"
       inkscape:label="berg" />
    <path
       id="path360787"
       style="opacity:1;fill:#2185d0;fill-opacity:1;stroke-width:17.0055;paint-order:markers fill stroke;stop-color:#000000"
       d="m 11249.461,-1883.6961 c -12.74,0 -23.067,10.3275 -23.067,23.0671 0,4.3335 1.22,8.5795 3.522,12.2514 l 19.232,-24.8636 c 0.138,-0.1796 0.486,-0.1796 0.624,0 l 19.233,24.8646 c 2.302,-3.6721 3.523,-7.9185 3.523,-12.2524 0,-12.7396 -10.327,-23.0671 -23.067,-23.0671 z"
       sodipodi:nodetypes="sccccccs"
       inkscape:label="sky"
       transform="matrix(1.4006354,0,0,1.4006354,-15690.065,2662.0533)" />
  </g>
</svg>
"""
codeberg_icon_white_svg = """
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
   width="16"
   height="16"
   viewBox="0 0 4.2333332 4.2333335"
   version="1.1"
   id="svg1468"
   sodipodi:docname="codeberg-logo_icon_white.svg"
   inkscape:version="1.2-alpha1 (b6a15bb, 2022-02-23)"
   inkscape:export-filename="/home/robert/Documents/Codeberg/Logo-Kit/svg/Codeberg-favicon_64px.png"
   inkscape:export-xdpi="384"
   inkscape:export-ydpi="384"
   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
   xmlns:xlink="http://www.w3.org/1999/xlink"
   xmlns="http://www.w3.org/2000/svg"
   xmlns:svg="http://www.w3.org/2000/svg"
   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
   xmlns:cc="http://creativecommons.org/ns#"
   xmlns:dc="http://purl.org/dc/elements/1.1/">
  <title
     id="title16">Codeberg logo</title>
  <defs
     id="defs1462">
    <linearGradient
       xlink:href="#linearGradient6924"
       id="linearGradient6918"
       x1="42519.285"
       y1="-7078.7891"
       x2="42575.336"
       y2="-6966.9307"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       id="linearGradient6924">
      <stop
         style="stop-color:#2185d0;stop-opacity:0"
         offset="0"
         id="stop6920" />
      <stop
         id="stop6926"
         offset="0.49517274"
         style="stop-color:#2185d0;stop-opacity:0.48923996" />
      <stop
         style="stop-color:#2185d0;stop-opacity:0.63279623"
         offset="1"
         id="stop6922" />
    </linearGradient>
    <linearGradient
       xlink:href="#linearGradient6924-6"
       id="linearGradient6918-3"
       x1="42519.285"
       y1="-7078.7891"
       x2="42575.336"
       y2="-6966.9307"
       gradientUnits="userSpaceOnUse" />
    <linearGradient
       id="linearGradient6924-6">
      <stop
         style="stop-color:#ffffff;stop-opacity:0;"
         offset="0"
         id="stop6920-7" />
      <stop
         id="stop6926-5"
         offset="0.49517274"
         style="stop-color:#ffffff;stop-opacity:0.30000001;" />
      <stop
         style="stop-color:#ffffff;stop-opacity:0.30000001;"
         offset="1"
         id="stop6922-3" />
    </linearGradient>
  </defs>
  <sodipodi:namedview
     showborder="false"
     id="base"
     pagecolor="#000000"
     bordercolor="#666666"
     borderopacity="1.0"
     inkscape:pageopacity="0"
     inkscape:pageshadow="2"
     inkscape:zoom="22.627417"
     inkscape:cx="2.8505242"
     inkscape:cy="18.274291"
     inkscape:document-units="px"
     inkscape:current-layer="svg1468"
     inkscape:document-rotation="0"
     showgrid="false"
     fit-margin-top="0"
     fit-margin-left="0"
     fit-margin-right="0"
     fit-margin-bottom="0"
     units="px"
     inkscape:snap-global="false"
     inkscape:snap-page="true"
     showguides="false"
     inkscape:window-width="1531"
     inkscape:window-height="873"
     inkscape:window-x="69"
     inkscape:window-y="27"
     inkscape:window-maximized="1"
     inkscape:pagecheckerboard="0"
     inkscape:deskcolor="#d1d1d1">
    <inkscape:grid
       type="xygrid"
       id="grid2067" />
  </sodipodi:namedview>
  <metadata
     id="metadata1465">
    <rdf:RDF>
      <cc:Work
         rdf:about="">
        <dc:format>image/svg+xml</dc:format>
        <dc:type
           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
        <dc:title>Codeberg logo</dc:title>
        <cc:license
           rdf:resource="http://creativecommons.org/publicdomain/zero/1.0/" />
        <dc:creator>
          <cc:Agent>
            <dc:title>Robert Martinez</dc:title>
          </cc:Agent>
        </dc:creator>
        <dc:rights>
          <cc:Agent>
            <dc:title>Codeberg and the Codeberg Logo are trademarks of Codeberg e.V.</dc:title>
          </cc:Agent>
        </dc:rights>
        <dc:date>2020-04-09</dc:date>
        <dc:publisher>
          <cc:Agent>
            <dc:title>Codeberg e.V.</dc:title>
          </cc:Agent>
        </dc:publisher>
        <dc:source>codeberg.org</dc:source>
      </cc:Work>
      <cc:License
         rdf:about="http://creativecommons.org/publicdomain/zero/1.0/">
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Reproduction" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#Distribution" />
        <cc:permits
           rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
      </cc:License>
    </rdf:RDF>
  </metadata>
  <g
     id="g370484"
     inkscape:label="logo"
     transform="matrix(0.06551432,0,0,0.06551432,-2.232417,-1.431776)">
    <path
       id="path6733-5"
       style="font-variation-settings:normal;opacity:1;vector-effect:none;fill:url(#linearGradient6918-3);fill-opacity:1;stroke:none;stroke-width:3.67846;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:2;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;paint-order:stroke markers fill;stop-color:#000000;stop-opacity:1"
       d="m 42519.285,-7078.7891 a 0.76086879,0.56791688 0 0 0 -0.738,0.6739 l 33.586,125.8886 a 87.182358,87.182358 0 0 0 39.381,-33.7636 l -71.565,-92.5196 a 0.76086879,0.56791688 0 0 0 -0.664,-0.2793 z"
       transform="matrix(0.37058478,0,0,0.37058478,-15690.065,2662.0533)"
       inkscape:label="berg" />
    <path
       id="path360787"
       style="opacity:1;fill:#ffffff;fill-opacity:1;stroke-width:17.0055;paint-order:markers fill stroke;stop-color:#000000"
       d="m 11249.461,-1883.6961 c -12.74,0 -23.067,10.3275 -23.067,23.0671 0,4.3335 1.22,8.5795 3.522,12.2514 l 19.232,-24.8636 c 0.138,-0.1796 0.486,-0.1796 0.624,0 l 19.233,24.8646 c 2.302,-3.6721 3.523,-7.9185 3.523,-12.2524 0,-12.7396 -10.327,-23.0671 -23.067,-23.0671 z"
       sodipodi:nodetypes="sccccccs"
       inkscape:label="sky"
       transform="matrix(1.4006354,0,0,1.4006354,-15690.065,2662.0533)" />
  </g>
</svg>
"""

html_theme_options = {
    "footer_icons": [
        {
            "name": "Codeberg",
            "url": "https://codeberg.org/meadow/pypergraph",
            "html": codeberg_icon_white_svg,
            "class": "only-dark",
        },
        {
            "name": "Codeberg",
            "url": "https://codeberg.org/meadow/pypergraph",
            "html": codeberg_icon_blue_svg,
            "class": "only-light",
        },
    ],
}
