|
|
|
|
|
|
|
|
|
|
|
import pathlib |
|
import re |
|
import sys |
|
|
|
from sphinx.ext import autodoc |
|
|
|
sys.path.insert(0, pathlib.Path(__file__).parents[2].resolve().as_posix()) |
|
|
|
|
|
|
|
|
|
|
|
project = "geneformer" |
|
copyright = "2024, Christina Theodoris" |
|
author = "Christina Theodoris" |
|
release = "0.1.0" |
|
repository_url = "https://huggingface.co/ctheodoris/Geneformer" |
|
|
|
|
|
|
|
|
|
extensions = [ |
|
"sphinx.ext.autodoc", |
|
"sphinx.ext.autosummary", |
|
"nbsphinx", |
|
"sphinx.ext.viewcode", |
|
"sphinx.ext.doctest", |
|
] |
|
|
|
templates_path = ["_templates"] |
|
exclude_patterns = [ |
|
"**.ipynb_checkpoints", |
|
] |
|
autoclass_content = "both" |
|
|
|
|
|
class MockedClassDocumenter(autodoc.ClassDocumenter): |
|
def add_line(self, line: str, source: str, *lineno: int) -> None: |
|
if line == " Bases: :py:class:`object`": |
|
return |
|
super().add_line(line, source, *lineno) |
|
|
|
|
|
autodoc.ClassDocumenter = MockedClassDocumenter |
|
add_module_names = False |
|
|
|
|
|
def process_signature(app, what, name, obj, options, signature, return_annotation): |
|
|
|
|
|
signature = re.sub(r"PosixPath\(.*?\)", "FILEPATH", signature) |
|
return (signature, None) |
|
|
|
|
|
def setup(app): |
|
app.connect("autodoc-process-signature", process_signature) |
|
|
|
|
|
|
|
|
|
|
|
html_theme = "sphinx_rtd_theme" |
|
html_show_sphinx = False |
|
html_static_path = ["_static"] |
|
html_logo = "_static/gf_logo.png" |
|
html_theme_options = { |
|
"collapse_navigation": False, |
|
"sticky_navigation": True, |
|
"navigation_depth": 3, |
|
"logo_only": True, |
|
} |
|
html_css_files = [ |
|
"css/custom.css", |
|
] |
|
html_show_sourcelink = False |
|
|