Placeholders
For every variable there are five forms:
| Placeholder | my idea |
user_profile |
|---|---|---|
{key.raw} |
my idea |
user_profile |
{key.pascal} |
MyIdea |
UserProfile |
{key.camel} |
myIdea |
userProfile |
{key.kebab} |
my-idea |
user-profile |
{key.snake} |
my_idea |
user_profile |
Placeholders work in file names, folder names and texts. A form is always required: {key} on its own is not a placeholder, so code such as {name} in your templates is never touched by accident.
- Words are split on spaces, hyphens, underscores and lower-to-upper transitions (
UserProfilegivesuser-profile). pascal,camel,kebabandsnakekeep only Latin letters, digits, spaces,-and_. Everything else (including Cyrillic) is removed. To stop this from creating wrong names, the input box rejects such values. See Value check.rawinserts the value exactly as typed.
Example
Section titled “Example”A blueprint that uses all five forms:
{ title: "Feature", variables: [{ key: "name", prompt: "Feature name" }], structure: { folders: [ { name: "{name.kebab}", files: [ { name: "{name.pascal}.tsx", content: [ "export function {name.pascal}() {", ' return <section className="{name.kebab}">{name.raw}</section>;', "}", ], }, { name: "{name.camel}.ts", content: ["// id: {name.snake}", 'export const {name.camel} = "{name.raw}";'], }, { name: "{name.kebab}.css", content: [".{name.kebab} {", " display: block;", "}"], }, ], }, ], },}With the value user profile it creates:
Directoryuser-profile
- UserProfile.tsx
- userProfile.ts
- user-profile.css
export function UserProfile() { return <section className="user-profile">user profile</section>;}// id: user_profileexport const userProfile = "user profile";.user-profile { display: block;}