Open
Description
Description of the new feature / enhancement
Add mustache templating to New+ templates.
Templates could have a config file (NewPlus.yml
) that contains options like GitHub issue forms. The config file could be located in a .powertoys
subfolder so users can add support.
When you create a template with a config file it will open a UI with these options.
Example
Template structure
📁My Template/
├── 📁.powertoys/
│ └── 📃NewPlus.yml
├── 📃package.json
└── 📁src/
├── 📃template.html
└── 📃main.js
NewPlus.yml
name: "Name to show in context menu"
description: "An example new+ config"
body:
- id: name
type: input
attributes:
label: Name
- id: version
type: input
attributes:
label: Version
- id: description
type: textarea
attributes:
label: Description
# Files that should not render.
# For when your project uses mustache
norender:
- src/template.html
package.json
{
"name": "{{ body.name }}",
"version": "{{ body.version }}",
"description": "{{ body.description }}",
"license": "MIT",
"main": ".src/main.js",
}
src/main.js
const NAME = "{{ body.name }}";
const VERSION = "{{ body.version }}";
console.log("Loading "+ NAME + " v" + VERSION);
src/template.html
This file will not be rendered.
{{string}} {{#emphasize}}{{nested.string}}{{/emphasize}}
<ul>
{{#list}}
<li>{{.}}
{{/list}}
</ul>
Example window when creating the template from the context menu.
Scenario when this would be used?
The current New+ behavior is just making a copy of the template. This feature would allow more flexibility and customizability
Supporting information
No response
Activity