Skip to content

Commit e767a15

Browse files
committed
Fix API reference.
1 parent c555e5b commit e767a15

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

docs/conf.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), "..")))
55

66
os.environ["SDL_DOC_GENERATOR"] = "0"
7+
os.environ["SDL_CTYPES_ALIAS_FIX"] = "1"
78
os.environ["SDL_DISABLE_METADATA"] = "1"
89
os.environ["SDL_PLATFORM_AGNOSTIC"] = "1"
910
os.environ["SDL_IGNORE_MISSING_FUNCTIONS"] = "1"
@@ -25,11 +26,11 @@
2526
extensions = [
2627
"sphinx.ext.autodoc",
2728
"sphinx.ext.autosummary",
28-
"sphinx.ext.napoleon",
29+
"sphinx.ext.inheritance_diagram",
2930
"sphinx.ext.intersphinx",
3031
"sphinx.ext.viewcode",
31-
"sphinx.ext.todo",
32-
"sphinx.ext.inheritance_diagram"
32+
"sphinx.ext.napoleon",
33+
"sphinx.ext.todo"
3334
]
3435

3536
templates_path = []

sdl3/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ def SDL_GENERATE_DOCS(modules: list[str] = list(SDL_BINARY_VAR_MAP_INV.keys()),
400400
result = "" if rst else f"\"\"\"\n# This file is auto-generated, do not modify it.\nmeta = "
401401
if not rst: result += f"{{\"target\": \"v{__version__}\", \"system\": \"{SDL_SYSTEM}\"}}\n\"\"\"\n\n"
402402
result += f"from {'sdl3' if rst else ''}.SDL import *\n\n"
403-
result += f"from {'sdl3' if rst else ''}.__init__ import raw, ctypes, typing, SDL_POINTER\n\n"
403+
result += f"from {'sdl3' if rst else ''}.__init__ import {'' if rst else 'raw, '}ctypes, typing, SDL_POINTER\n\n"
404404
types, definitions = set(), ""
405405

406406
def SDL_GET_NAME(i):
@@ -424,7 +424,8 @@ def SDL_GET_NAME(i):
424424
if description is not None: definitions += f" {description}\n"
425425
if not rst: definitions += f"\n{' ' * 4}https://wiki.libsdl.org/{module}/{func}\n"
426426
if not rst or description is not None: definitions += f"{' ' * 4}\"\"\"\n"
427-
definitions += f"{' ' * 4}return raw.{func}({', '.join(arguments)})"
427+
if not rst: definitions += f"{' ' * 4}return raw.{func}({', '.join(arguments)})"
428+
else: definitions += f"{' ' * 4}..."
428429

429430
if _index != len(__module__.functions[module]) - 1:
430431
definitions += "\n\n"

0 commit comments

Comments
 (0)