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

Link Qt base class objects to Qt c++ doc pages #180

Merged
merged 1 commit into from
Sep 11, 2024
Merged
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
1 change: 1 addition & 0 deletions conf.in.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@
version_list = ("master", current_stable, current_ltr)

graphviz_output_format = "svg"
qt_docs_url_base = cfg["qt_docs_url_base"]

url = cfg["pyqgis_url"]
if not url.endswith("/"):
Expand Down
4 changes: 4 additions & 0 deletions inheritance_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,9 @@ def generate_dot(
if any(n.endswith(f".{name}") for n in self.class_names):
this_node_attrs["fillcolor"] = '"#e7f2fa"'

if fullname.startswith("PyQt"):
this_node_attrs["URL"] = f'"{env.config.qt_docs_url_base}{name.lower()}.html"'
this_node_attrs["target"] = '"_top"'
if fullname in urls:
this_node_attrs["URL"] = '"%s"' % urls[fullname]
this_node_attrs["target"] = '"_top"'
Expand Down Expand Up @@ -550,5 +553,6 @@ def setup(app: Sphinx) -> ExtensionMetadata:
app.add_config_value("inheritance_graph_attrs", {}, "")
app.add_config_value("inheritance_node_attrs", {}, "")
app.add_config_value("inheritance_edge_attrs", {}, "")
app.add_config_value("qt_docs_url_base", "", "")
app.add_config_value("inheritance_alias", {}, "")
return {"version": sphinx.__display_version__, "parallel_read_safe": True}
1 change: 1 addition & 0 deletions pyqgis_conf.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ pyqgis_url: https://qgis.org/pyqgis
current_stable: '3.38'
current_ltr: '3.34'

qt_docs_url_base: https://doc.qt.io/qt-5/

skipped:
- PyProviderMetadata
Expand Down
8 changes: 7 additions & 1 deletion scripts/make_api_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,9 +330,15 @@ def export_bases(_b):
for _base in _b.__bases__:
if _base.__name__ in ("wrapper", "simplewrapper", "object"):
continue

if re.match(r"^Q(?!gs)", _base.__name__):
doc_link = f'{cfg["qt_docs_url_base"]}{_base.__name__.lower()}.html'
else:
doc_link = f"{_base.__name__}.html"

res += make_table_row(
[
f"`{_base.__name__} <{_base.__name__}.html>`_",
f"`{_base.__name__} <{doc_link}>`_",
extract_summary(_base.__doc__),
]
)
Expand Down
Loading