Skip to content

Commit 7cc53e4

Browse files
committed
fixed whitespace?
1 parent b57c993 commit 7cc53e4

File tree

7 files changed

+382
-287
lines changed

7 files changed

+382
-287
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ py2fern write /path/to/your/package --output ./docs/api
2626

2727
This creates:
2828
- **MDX files** with Fern-compatible frontmatter and slugs
29-
- **`navigation.yml`** for Fern docs structure
29+
- **`navigation.yml`** for Fern docs structure
3030

3131
## Acknowledgments
3232

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ urls = {Home = "https://github.com/fern-api/py2fern"}
2020
requires-python = ">=3.8"
2121
dependencies = [
2222
"astroid>=2.7,<4",
23-
"tomli; python_version<'3.11'",
23+
"tomli; python_version<'3.11'",
2424
"typing-extensions",
2525
"typer[all]",
2626
"PyYAML"
@@ -29,7 +29,7 @@ dependencies = [
2929
[project.optional-dependencies]
3030
testing = [
3131
"pytest",
32-
"pytest-regressions",
32+
"pytest-regressions",
3333
"pytest-cov",
3434
"PyYAML", # Needed for navigation YAML tests
3535
]

src/autodoc2/__init__.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,27 @@
33
A simplified fork of sphinx-autodoc2 focused purely on Python → Fern markdown output.
44
"""
55

6-
import subprocess
76
import os
7+
import subprocess
8+
89

910
def _get_version():
1011
"""Get version from git tag or fallback to default."""
1112
try:
12-
if os.path.exists('.git'):
13+
if os.path.exists(".git"):
1314
result = subprocess.run(
14-
['git', 'describe', '--tags', '--exact-match', 'HEAD'],
15-
capture_output=True, text=True, check=True
15+
["git", "describe", "--tags", "--exact-match", "HEAD"],
16+
capture_output=True,
17+
text=True,
18+
check=True,
1619
)
1720
version = result.stdout.strip()
18-
return version[1:] if version.startswith('v') else version
21+
return version[1:] if version.startswith("v") else version
1922
except (subprocess.CalledProcessError, FileNotFoundError):
2023
pass
21-
24+
2225
# Fallback version for development
2326
return "0.1.2-dev"
2427

28+
2529
__version__ = _get_version()

src/autodoc2/cli.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -255,19 +255,20 @@ def _warn(msg: str, type_: WarningSubtypes) -> None:
255255
progress.console.print(f"[yellow]Warning[/yellow] {msg} [{type_.value}]")
256256

257257
config = Config()
258-
258+
259259
# Always use FernRenderer
260260
from autodoc2.render.fern_ import FernRenderer
261+
261262
render_class = FernRenderer
262-
263+
263264
for mod_name in to_write:
264265
progress.update(task, advance=1, description=mod_name)
265266
content = "\n".join(
266267
render_class(db, config, warn=_warn).render_item(mod_name)
267268
)
268-
269+
269270
# Use hyphens in filenames to match Fern slugs
270-
filename = mod_name.replace('.', '-').replace('_', '-')
271+
filename = mod_name.replace(".", "-").replace("_", "-")
271272
out_path = output / (filename + render_class.EXTENSION)
272273
paths.append(out_path)
273274
if out_path.exists() and out_path.read_text("utf8") == content:
@@ -286,17 +287,21 @@ def _warn(msg: str, type_: WarningSubtypes) -> None:
286287
# Validate all links
287288
console.print("[bold]Validating links...[/bold]")
288289
validation_results = renderer_instance.validate_all_links(str(output))
289-
290+
290291
if validation_results["errors"]:
291-
console.print(f"[red]❌ {len(validation_results['errors'])} link errors found:[/red]")
292+
console.print(
293+
f"[red]❌ {len(validation_results['errors'])} link errors found:[/red]"
294+
)
292295
for error in validation_results["errors"]:
293296
console.print(f" [red]• {error}[/red]")
294-
297+
295298
if validation_results["warnings"]:
296-
console.print(f"[yellow]⚠️ {len(validation_results['warnings'])} link warnings:[/yellow]")
299+
console.print(
300+
f"[yellow]⚠️ {len(validation_results['warnings'])} link warnings:[/yellow]"
301+
)
297302
for warning in validation_results["warnings"]:
298303
console.print(f" [yellow]• {warning}[/yellow]")
299-
304+
300305
if not validation_results["errors"] and not validation_results["warnings"]:
301306
console.print("[green]✅ All links validated successfully![/green]")
302307

src/autodoc2/render/base.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
"""Convert the database items into documentation."""
2+
23
from __future__ import annotations
34

45
import abc

0 commit comments

Comments
 (0)