refactor: Simplify text normalization comments
- Remove outdated comments related to normalization - Update comments for clarity
This commit is contained in:
@@ -24,7 +24,7 @@ fn (mut self Atlas) add_collection(mut path pathlib.Path) !Collection {
|
||||
name = params.get('name')!
|
||||
}
|
||||
}
|
||||
// Normalize collection name
|
||||
|
||||
name = texttools.name_fix(name)
|
||||
console.print_item("Adding collection '${name}' to Atlas '${self.name}' at path '${path.path}'")
|
||||
|
||||
|
||||
@@ -49,7 +49,6 @@ fn (mut c Collection) init_post() ! {
|
||||
|
||||
// Add a page to the collection
|
||||
fn (mut c Collection) add_page(mut path pathlib.Path) ! {
|
||||
// Use name_fix_no_ext to normalize the name
|
||||
name := path.name_fix_no_ext()
|
||||
if name in c.pages {
|
||||
return error('Page ${name} already exists in collection ${c.name}')
|
||||
|
||||
@@ -154,7 +154,6 @@ fn (mut p Page) parse_link_target(mut link Link) {
|
||||
if target.contains(':') {
|
||||
parts := target.split(':')
|
||||
if parts.len >= 2 {
|
||||
// Normalize collection name
|
||||
link.target_collection_name = texttools.name_fix(parts[0])
|
||||
link.target_item_name = normalize_page_name(parts[1])
|
||||
}
|
||||
@@ -272,12 +271,11 @@ fn (mut p Page) process_links(mut export_dir pathlib.Path) !string {
|
||||
|
||||
/////////////TOOLS//////////////////////////////////
|
||||
|
||||
// Normalize page name (remove .md and apply name_fix)
|
||||
// Normalize page name (remove .md, apply name_fix)
|
||||
fn normalize_page_name(name string) string {
|
||||
mut clean := name
|
||||
if clean.ends_with('.md') {
|
||||
clean = clean[0..clean.len - 3]
|
||||
}
|
||||
// Use name_fix to normalize
|
||||
return texttools.name_fix(clean)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user