refactor: Simplify text normalization comments

- Remove outdated comments related to normalization
- Update comments for clarity
This commit is contained in:
Mahmoud-Emad
2025-11-05 10:04:57 +02:00
parent 2150b93a80
commit a2ac8c0027
4 changed files with 2 additions and 8 deletions

View File

@@ -147,8 +147,6 @@ fn cmd_atlas_execute(cmd Command) ! {
console.print_header('Running Atlas for: ${atlas_path.path}')
// Run HeroScript if exists
// Note: emptycheck is false because !!include actions in markdown files
// are processed internally by atlas during export, not through the playbook system
playcmds.run(
heroscript_path: atlas_path.path
reset: false
@@ -163,7 +161,6 @@ fn cmd_atlas_execute(cmd Command) ! {
}
// Default behavior: scan and export if no flags specified
// Also enable scan and export if dev is requested
if !scan && !export {
scan = true
export = true

View File

@@ -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}'")

View File

@@ -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}')

View File

@@ -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)
}