Skip to content

Consider adding nested templates for subfolders #49

@tristanpoland

Description

@tristanpoland

// ============================================================================
// File Type Definitions
// ============================================================================
/// Defines the structure of a file type.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum FileStructure {
/// A single standalone file (e.g., script.rs)
Standalone,
/// A folder that appears as a file in the drawer (e.g., MyClass.class/)
/// Contains the marker file name that identifies this folder as this type
/// For example, "graph_save.json" for blueprint classes
FolderBased {
/// The marker file that must exist in the folder
marker_file: String,
/// Additional files/folders that should be created in a new instance
template_structure: Vec<PathTemplate>,
},
}
/// Template for creating files/folders in a folder-based file type.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum PathTemplate {
/// Create a file with default content
File {
path: String,
content: String,
},
/// Create a folder
Folder {
path: String,
},
}

Like this for example:

pub enum PathTemplate {
    /// Create a file with default content
    File {
        path: String,
        content: String,
    },
    /// Create a folder
    Folder {
        path: String,
        template_structure: Option<Vec<PathTemplate>>
    },
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions