1+ # -- Path setup --------------------------------------------------------------
2+
3+ import re
4+
5+ import regbench_data as my_module
6+ module_name = "regbench_data"
7+
8+ # -- Software version --------------------------------------------------------
9+
10+ # The short X.Y version (including .devXXXX, -devXXXX, rcX, b1 suffixes if present)
11+ version = re .sub (r'(\d+\.\d+)\.\d+([-\.].*)?' , r'\1\2' , my_module .__version__ )
12+ version = re .sub (r'([-\.]dev\d+).*?$' , r'\1' , version )
13+
14+ # The full version, including alpha/beta/rc tags.
15+ release = my_module .__version__
16+
17+ # pyData/Sphinx-Theme version switcher
18+ if "dev" in version :
19+ switcher_version = "dev"
20+ else :
21+ switcher_version = f"{ version } "
22+
23+ print (f'Building documentation for { module_name } { release } (short version: { version } , switcher version: { switcher_version } )' )
24+
25+ # -- Project information -----------------------------------------------------
26+
27+ project = 'genomics-dataloader'
28+ copyright = '2025, Regulatory Genomics Lab, Westlake University'
29+ author = 'Kai Zhang'
30+
31+ # -- General configuration ---------------------------------------------------
32+
33+ suppress_warnings = ['ref.citation' ]
34+ default_role = 'code'
35+ add_function_parentheses = False
36+
37+ # Add any Sphinx extension module names here, as strings. They can be
38+ # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
39+ # ones.
40+ extensions = [
41+ "nbsphinx" ,
42+ "myst_parser" ,
43+ "sphinx.ext.autodoc" ,
44+ "sphinx.ext.intersphinx" ,
45+ "sphinx.ext.autosummary" ,
46+ "sphinx.ext.coverage" ,
47+ "sphinx.ext.mathjax" ,
48+ "sphinx.ext.napoleon" ,
49+ "sphinx_autodoc_typehints" ,
50+ "sphinx_plotly_directive" ,
51+ ]
52+
53+ source_suffix = {
54+ '.rst' : 'restructuredtext' ,
55+ '.txt' : 'markdown' ,
56+ '.md' : 'markdown' ,
57+ }
58+
59+ myst_enable_extensions = [
60+ "amsmath" ,
61+ #"colon_fence",
62+ #"deflist",
63+ "dollarmath" ,
64+ #"fieldlist",
65+ #"html_admonition",
66+ #"html_image",
67+ #"linkify",
68+ #"replacements",
69+ #"smartquotes",
70+ #"strikethrough",
71+ #"substitution",
72+ #"tasklist",
73+ ]
74+
75+ # Generate the API documentation when building
76+ autosummary_generate = True
77+ autodoc_member_order = 'bysource'
78+ # autodoc_default_flags = ['members']
79+ napoleon_google_docstring = False
80+ napoleon_numpy_docstring = True
81+ napoleon_include_init_with_doc = False
82+ napoleon_use_rtype = True # having a separate entry generally helps readability
83+ napoleon_use_param = True
84+ napoleon_custom_sections = [('Params' , 'Parameters' )]
85+ todo_include_todos = False
86+
87+ intersphinx_mapping = {
88+ "numpy" : ("https://numpy.org/doc/stable/" , None ),
89+ "python" : ("https://docs.python.org/3" , None ),
90+ }
91+
92+ smv_branch_whitelist = r'main' # Include all branches
93+
94+ # Add any paths that contain templates here, relative to this directory.
95+ templates_path = ['_templates' ]
96+
97+ # List of patterns, relative to source directory, that match files and
98+ # directories to ignore when looking for source files.
99+ # This pattern also affects html_static_path and html_extra_path.
100+ exclude_patterns = ['_build' , 'Thumbs.db' , '.DS_Store' ]
101+
102+
103+ # -- Options for HTML output -------------------------------------------------
104+
105+ html_theme = 'pydata_sphinx_theme'
106+ html_show_sphinx = False
107+ html_show_sourcelink = False
108+ html_static_path = ['_static' ]
109+ html_css_files = [
110+ 'css/custom.css' ,
111+ ]
112+
113+ html_theme_options = {
114+ "logo" : {
115+ "text" : module_name ,
116+ "image_dark" : "_static/logo-dark.svg" ,
117+ "alt_text" : module_name ,
118+ },
119+
120+ "github_url" : f"https://github.com/regulatory-genomics/{ module_name } " ,
121+ "external_links" : [
122+ ],
123+ "header_links_before_dropdown" : 6 ,
124+
125+ "navbar_center" : ["version-switcher" , "navbar-nav" ],
126+ "navbar_end" : ["theme-switcher" , "navbar-icon-links" ],
127+ "navbar_align" : "left" ,
128+ "show_version_warning_banner" : switcher_version == "dev" ,
129+
130+ "switcher" : {
131+ "version_match" : switcher_version ,
132+ "json_url" : f"https://raw.githubusercontent.com/regulatory-genomics/{ module_name } /refs/heads/main/docs/_static/versions.json" ,
133+ },
134+ }
0 commit comments