@@ -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 :
@@ -283,6 +284,27 @@ def _warn(msg: str, type_: WarningSubtypes) -> None:
283284 nav_path .write_text (nav_content , "utf8" )
284285 console .print (f"Navigation written to: { nav_path } " )
285286
287+ # Validate all links
288+ console .print ("[bold]Validating links...[/bold]" )
289+ validation_results = renderer_instance .validate_all_links (str (output ))
290+
291+ if validation_results ["errors" ]:
292+ console .print (
293+ f"[red]❌ { len (validation_results ['errors' ])} link errors found:[/red]"
294+ )
295+ for error in validation_results ["errors" ]:
296+ console .print (f" [red]• { error } [/red]" )
297+
298+ if validation_results ["warnings" ]:
299+ console .print (
300+ f"[yellow]⚠️ { len (validation_results ['warnings' ])} link warnings:[/yellow]"
301+ )
302+ for warning in validation_results ["warnings" ]:
303+ console .print (f" [yellow]• { warning } [/yellow]" )
304+
305+ if not validation_results ["errors" ] and not validation_results ["warnings" ]:
306+ console .print ("[green]✅ All links validated successfully![/green]" )
307+
286308 # remove any files that are no longer needed
287309 if clean :
288310 console .print ("[bold]Cleaning old files[/bold]" )
0 commit comments