Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exp #18

Merged
merged 3 commits into from
Apr 18, 2024
Merged

Exp #18

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@

sphinx_rtd_theme
evdspy
sphinx_rtd_theme
sphinx_book_theme
24 changes: 22 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,22 @@

# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

html_build_dir = '../docs'

project = 'evdspy'
copyright = '2024, Sermet Pekin'
author = 'Sermet Pekin'
release = 'v1.1.19'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration


extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
Expand All @@ -23,23 +28,34 @@
'sphinx.ext.autosummary',
# 'myst_parser'
]

templates_path = ['_templates']
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
html_theme = 'sphinx_rtd_theme'


# html_theme = 'sphinx_rtd_theme'
html_theme = 'sphinx_book_theme'

html_static_path = ['static']
# extensions = ['myst_parser']
source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
'.md': 'markdown',
}

import os
import inspect
from sphinx.util import logging

logger = logging.getLogger(__name__)

import time


def linkcode_resolve(domain, info):
print(domain, info, "Domain info ")
time.sleep(2)
Expand All @@ -49,9 +65,12 @@ def linkcode_resolve(domain, info):
return None
filename = info['module'].replace('.', '/')
return "https://github.com/SermetPekin/evdspy-repo/%s.py" % filename


def linkcode_resolveOLD(domain, info):
if domain != 'py' or not info['module']:
return None

try:
mod = __import__(info['module'])
for part in info['module'].split('.')[1:]:
Expand All @@ -65,6 +84,7 @@ def linkcode_resolveOLD(domain, info):
except Exception as e:
logger.warning(f"Could not get source link for module {info['module']} due to {e}")
return None

tag_or_branch = 'main' # or 'master' or the specific tag if versioned
path_to_file = os.path.join('path_to_repository', filename)
return f"https://github.com/SermetPekin/evdspy-repo/blob/{tag_or_branch}/{path_to_file}#L{lines[0]}"
Loading