Skip to content

Commit a910676

Browse files
committed
fix: serve_docs
1 parent 68a1513 commit a910676

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

sphinx_autodoc_vyper/server.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111
def serve_docs(build_dir: Path, port: int = 8000) -> NoReturn: # type: ignore [misc]
1212
"""Serve the documentation on a local development server."""
1313

14-
if not build_dir.exists():
14+
html_dir = build_dir / "html"
15+
16+
if not html_dir.exists():
1517
raise FileNotFoundError(
1618
"Documentation not found. Run 'sphinx-autodoc-vyper' first to generate the documentation."
1719
)
1820

19-
os.chdir(build_dir)
21+
os.chdir(html_dir)
2022

2123
handler = http.server.SimpleHTTPRequestHandler
2224

tests/test_server.py

+5-3
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@
1414
def test_server_start(tmp_path: Path) -> None:
1515
"""Test server startup and accessibility."""
1616
# Create mock build directory
17-
build_dir = tmp_path / "docs" / "_build" / "html"
18-
build_dir.mkdir(parents=True)
19-
(build_dir / "index.html").write_text("<html><body>Test</body></html>")
17+
build_dir = tmp_path / "docs" / "_build"
18+
19+
html_dir = build_dir / "html"
20+
html_dir.mkdir(parents=True)
21+
(html_dir / "index.html").write_text("<html><body>Test</body></html>")
2022

2123
# Generate documentation
2224
cli._main(contracts_dir="", output_dir=str(build_dir))

0 commit comments

Comments
 (0)