Refactor directory structure creation and enhance documentation generation

- Simplified the creation of output directory structure in `init_project` and `generate_docs` functions.
- Added a `sanitize_filename` function to ensure valid filenames for generated documentation files.
- Implemented individual documentation file creation for modules and files in the `generate_docs` function.
- Updated links in the renderer to use the new `sanitize_for_link` function for safe URL generation.
- Adjusted the `extract_docstring` method in `PythonAnalyzer` to accept the body parameter without using it, preparing for future enhancements.
This commit is contained in:
2026-01-25 20:38:49 +03:00
parent 3701cee205
commit df50701764
3 changed files with 57 additions and 11 deletions

View File

@@ -164,7 +164,7 @@ impl PythonAnalyzer {
}
}
fn extract_docstring(&self, body: &[Stmt]) -> Option<String> {
fn extract_docstring(&self, _body: &[Stmt]) -> Option<String> {
// For now, just return None until we figure out the correct way to extract docstrings
// TODO: Implement proper docstring extraction
None
@@ -213,11 +213,13 @@ impl PythonAnalyzer {
flags
}
#[allow(dead_code)]
fn extract_function_def(&self, _func_def: &StmtFunctionDef, _symbols: &mut Vec<Symbol>, _calls: &mut Vec<Call>, _depth: usize) {
// Extract function information
// This is a simplified implementation - a full implementation would extract more details
}
#[allow(dead_code)]
fn extract_class_def(&self, _class_def: &StmtClassDef, _symbols: &mut Vec<Symbol>, _depth: usize) {
// Extract class information
// This is a simplified implementation - a full implementation would extract more details