Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
SermetPekin committed Apr 18, 2024
1 parent ad9d486 commit a328b0c
Show file tree
Hide file tree
Showing 12 changed files with 91 additions and 249 deletions.
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
60 changes: 0 additions & 60 deletions docs/build/html/_sources/get_series.rst.txt

This file was deleted.

61 changes: 0 additions & 61 deletions docs/build/html/_sources/home.rst.txt

This file was deleted.

20 changes: 0 additions & 20 deletions docs/build/html/_sources/index.rst.txt

This file was deleted.

28 changes: 0 additions & 28 deletions docs/build/html/_sources/menu.rst.txt

This file was deleted.

28 changes: 0 additions & 28 deletions docs/build/html/_sources/save.rst.txt

This file was deleted.

24 changes: 0 additions & 24 deletions docs/build/html/_sources/setup.rst.txt

This file was deleted.

35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
27 changes: 3 additions & 24 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

html_build_dir = '../docs'
# html_build_dir = '../docs'
# html_build_dir = 'docs'

project = 'evdspy'
copyright = '2024, Sermet Pekin'
Expand Down Expand Up @@ -40,7 +41,7 @@
html_theme = 'sphinx_book_theme'

html_static_path = ['static']
# extensions = ['myst_parser']

source_suffix = {
'.rst': 'restructuredtext',
'.txt': 'markdown',
Expand All @@ -58,7 +59,6 @@

def linkcode_resolve(domain, info):
print(domain, info, "Domain info ")
time.sleep(2)
if domain != 'py':
return None
if not info['module']:
Expand All @@ -67,24 +67,3 @@ def linkcode_resolve(domain, info):
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:]:
mod = getattr(mod, part)
obj = mod
if 'fullname' in info:
obj = getattr(obj, info['fullname'])
filename = inspect.getsourcefile(obj)
filename = os.path.relpath(filename, start=os.path.dirname(mod.__file__))
lines, _ = inspect.getsourcelines(obj)
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

0 comments on commit a328b0c

Please sign in to comment.