feat: Merge 05-Plot and 06-First Draft into 05-First Draft with YAML frontmatter
- Add YAML frontmatter support with split_yaml_frontmatter() in preprocess.rs - Update create_scene_pair to create single merged files with YAML frontmatter - Rename 06-First Draft to 05-First Draft and merge with 05-Plot content - Update default_project_open_subdir to '05-First Draft' - Add capitalizes filter to MiniJinja environment for template rendering - Fix template placeholder escaping in CONSISTENCY.md - Update all references from 06-First Draft and 05-Plot to 05-First Draft - Update test expectations to match new folder structure The merged approach uses YAML frontmatter (--- delimiters) at the top of each draft file to store planning metadata, allowing it to be collapsed in the editor while keeping all planning and draft content in one file. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -110,6 +110,20 @@ pub fn render_template(config: &RenderConfig) -> RenderResult {
|
||||
.map(|(i, c)| if i == 0 { c.to_uppercase().collect::<String>() } else { c.to_lowercase().collect::<String>() })
|
||||
.collect::<String>()) // Simplified title case
|
||||
});
|
||||
// Capitalize filter - capitalizes the first letter of each word
|
||||
env.add_filter("capitalize", |value: String| -> Result<String, minijinja::Error> {
|
||||
Ok(value.chars()
|
||||
.enumerate()
|
||||
.map(|(i, c)| if i == 0 { c.to_uppercase().collect::<String>() } else { c.to_lowercase().collect::<String>() })
|
||||
.collect::<String>())
|
||||
});
|
||||
// capitalizes filter (plural) - same as capitalize but handles the common template usage
|
||||
env.add_filter("capitalizes", |value: String| -> Result<String, minijinja::Error> {
|
||||
Ok(value.chars()
|
||||
.enumerate()
|
||||
.map(|(i, c)| if i == 0 { c.to_uppercase().collect::<String>() } else { c.to_lowercase().collect::<String>() })
|
||||
.collect::<String>())
|
||||
});
|
||||
|
||||
// Get the context from variables
|
||||
let context = config.variables.to_context();
|
||||
|
||||
Reference in New Issue
Block a user