feat: improve documentation quality with real data
- Extract file-level docstrings from Python files (module-level string expressions) - Use __init__.py docstrings as module doc_summary - Use file docstrings as file purpose in layout tables (instead of 'Source file') - Populate module outbound_modules/inbound_modules from import edges (internal only) - Make filename sanitization consistent (sanitize_for_link matches sanitize_filename) - Clean up stale .md files from previous runs before generating - Fill ARCHITECTURE.md template with real layout, modules index, and critical points - Add file_docstring field to ParsedModule and file_purpose to FileDoc
This commit is contained in:
@@ -105,6 +105,19 @@ pub fn generate_docs(model: &ProjectModel, out: &str, verbose: bool, _config: &C
|
||||
std::fs::create_dir_all(&modules_path)?;
|
||||
std::fs::create_dir_all(&files_path)?;
|
||||
|
||||
// Clean up stale files from previous runs
|
||||
for subdir in &["modules", "files"] {
|
||||
let dir = out_path.join(subdir);
|
||||
if dir.exists()
|
||||
&& let Ok(entries) = std::fs::read_dir(&dir) {
|
||||
for entry in entries.flatten() {
|
||||
if entry.path().extension().map(|e| e == "md").unwrap_or(false) {
|
||||
let _ = std::fs::remove_file(entry.path());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let renderer = archdoc_core::renderer::Renderer::new();
|
||||
let writer = archdoc_core::writer::DiffAwareWriter::new();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user