11import os
22import sys
3+ import tomlkit
34
45sys .path .insert (0 , os .path .abspath ("../../src" ))
56
7+
8+ def get_version ():
9+ pyproject_path = os .path .abspath ("../../pyproject.toml" )
10+ try :
11+ with open (pyproject_path , "r" , encoding = "utf-8" ) as f :
12+ data = tomlkit .parse (f .read ())
13+ version = data .get ("project" , {}).get ("version" , "0.0.0" )
14+ return version
15+ except (FileNotFoundError , KeyError ):
16+ return "0.0.0"
17+
18+
619# Configuration file for the Sphinx documentation builder.
720#
821# For the full list of built-in configuration values, see the documentation:
1124# -- Project information -----------------------------------------------------
1225# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
1326
27+ full_version = get_version ()
28+ version = "." .join (full_version .split ("." )[:2 ])
29+ release = full_version
30+
1431project = "QSS Parser"
1532copyright = "2025, OniMock"
1633author = "OniMock"
17- release = "0.1.3"
1834
1935# -- General configuration ---------------------------------------------------
2036# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
2137
2238extensions = ["sphinx.ext.autodoc" , "sphinx.ext.viewcode" , "sphinx.ext.napoleon" ]
2339
2440templates_path = ["_templates" ]
25- exclude_patterns = []
26-
41+ exclude_patterns = ["modules.rst" ]
2742
2843# -- Options for HTML output -------------------------------------------------
2944# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
3045
3146html_theme = "sphinx_rtd_theme"
32- html_static_path = ["_static" ]
47+ html_static_path = ["" ]
48+ autodoc_member_order = "groupwise"
3349
3450
3551def skip (app , what , name , obj , skip , options ):
@@ -38,8 +54,12 @@ def skip(app, what, name, obj, skip, options):
3854 return skip
3955
4056
41- def setup (app ):
42- app .connect ("autodoc-skip-member" , skip )
57+ def process_docstring (app , what , name , obj , options , lines ):
58+ # Strip the 'qss_parser.qss_parser.' prefix from docstrings
59+ for i in range (len (lines )):
60+ lines [i ] = lines [i ].replace ("qss_parser.qss_parser." , "" )
4361
4462
45- autodoc_member_order = "groupwise"
63+ def setup (app ):
64+ app .connect ("autodoc-skip-member" , skip )
65+ app .connect ("autodoc-process-docstring" , process_docstring )
0 commit comments