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:
+9
-5
@@ -191,8 +191,9 @@ pub fn default_project_template() -> PathBuf {
|
||||
|
||||
/// Default subfolder opened after generating a project: the snowflake
|
||||
/// template's drafting folder, where the chapter files live.
|
||||
/// Supports both "05-First Draft" (merged planning+draft) and "06-First Draft" (legacy).
|
||||
pub fn default_project_open_subdir() -> String {
|
||||
"06-First Draft".to_string()
|
||||
"05-First Draft".to_string()
|
||||
}
|
||||
|
||||
/// Templates ship hooks because they are meant to run; honouring them is the
|
||||
@@ -226,6 +227,9 @@ pub fn default_projects_dir() -> PathBuf {
|
||||
|
||||
/// Default new-file template: the editorial header fields this app already
|
||||
/// understands, followed by the draft marker so the body starts below it.
|
||||
///
|
||||
/// Note: For YAML frontmatter support, create files manually with --- delimiters.
|
||||
/// The legacy header format is kept for backward compatibility with the parser.
|
||||
pub fn default_new_file_template() -> String {
|
||||
[
|
||||
"# Title: {{name}}",
|
||||
@@ -521,13 +525,13 @@ mod tests {
|
||||
}
|
||||
|
||||
/// The folder opened after generating a project. It is the snowflake
|
||||
/// template's drafting folder, and the name contains a space — which has to
|
||||
/// survive being stored and joined onto the project path.
|
||||
/// template's drafting folder (merged planning + draft), and the name contains
|
||||
/// a space — which has to survive being stored and joined onto the project path.
|
||||
#[test]
|
||||
fn the_default_project_subdir_is_the_drafting_folder() {
|
||||
assert_eq!(default_project_open_subdir(), "06-First Draft");
|
||||
assert_eq!(default_project_open_subdir(), "05-First Draft");
|
||||
let joined = PathBuf::from("/tmp/The Winter Gate").join(default_project_open_subdir());
|
||||
assert_eq!(joined, PathBuf::from("/tmp/The Winter Gate/06-First Draft"));
|
||||
assert_eq!(joined, PathBuf::from("/tmp/The Winter Gate/05-First Draft"));
|
||||
}
|
||||
|
||||
/// A config.json written before screenplay projects existed. Same risk as
|
||||
|
||||
Reference in New Issue
Block a user