Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/3axap4eHko/file-templates-manager
VSCode file templates manager extension
https://github.com/3axap4eHko/file-templates-manager
template templates vscode vscode-extension
Last synced: 3 months ago
JSON representation
VSCode file templates manager extension
- Host: GitHub
- URL: https://github.com/3axap4eHko/file-templates-manager
- Owner: 3axap4eHko
- Created: 2018-05-17T17:37:13.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T05:16:18.000Z (almost 2 years ago)
- Last Synced: 2024-06-17T22:48:53.414Z (5 months ago)
- Topics: template, templates, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=3axap4eHko.file-templates-manager
- Size: 5.64 MB
- Stars: 12
- Watchers: 2
- Forks: 6
- Open Issues: 26
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
- jimsghstars - 3axap4eHko/file-templates-manager - VSCode file templates manager extension (TypeScript)
README
# File Templates Manager for VSCode
File Templates Manager for VSCode allows you to manage your file templates and generate files from them.
:heart: Like it? :coffee: [![Donate][donate-image]][donate-url]
![Screen Cast][screen-cast]
## Features
File Template Manager is powerful extension with following features that improve your productivity and do routine work for you.
### Manage file template
![Explorer][explorer]
![Template Picker][template-picker]
### Interactive integrated `doT` template engine
* `{{ }}` - evaluation
* `{{= }}` - interpolation
* `{{! }}` - interpolation with encoding
* `{{# }}` - compile-time evaluation/includes and partials
* `{{## #}}` - compile-time defines
* `{{? }}` - conditionals
* `{{~ }}` - array iteration[Full Documentation](http://olado.github.io/doT/index.html) of `doT` template engine
---
Variables available by default- `DIR` - directory of created file
- `NAME` - name from input prompt
- `FILE` - `NAME` + template extension
- `FILE_PATH` - `DIR` + `FILE`
- `USER` - name of user
- `DATE` - date of file creation
---Evaluation and interpolation example for `HTML` file
```html
{{ for(let i = 0; i < 10; i++ ) }}Item {{=i}}
```result is
```html
Item 0Item 1Item 2Item 3Item 4Item 5Item 6Item 7Item 8Item 9
```---
Select prompt example for `C#` language file
```cs
using System;{{#def.select('TYPE', 'Select file type', ['class','interface','struct','enum'])}}
/*
{{=$.NAME}} {{=$.TYPE}}
*/
public {{=$.TYPE}} {{=$.NAME}}
{}
```you will see a prompt
![Select value][type-selector]
and get result for `class` type
```cs
using System;/*
CSharp class
*/
public class CSharp {}
```---
`tsconfig.json` example file
```js
{{#def.select('MODULE', 'Specify module code generation', ['none','commonjs','amd','system','umd','es6','es2015','esnext'])}}
{{#def.select('TARGET', 'Specify ECMAScript target version', ['es3','es6','es2016','es2017','esnext'])}}
{{#def.confirm('SOURCE_MAP', 'Should generate corresponding .map file?')}}
{
"compilerOptions": {
"module": "{{=$.MODULE}}",
"target": "{{=$.TARGET}}",
"sourceMap": {{=$.SOURCE_MAP}}
},
"exclude": [
"node_modules"
]
}
```## Extension Settings
This extension contributes the following settings:
* `templates.showExplorer`: show/hide templates explorer
* `templates.customVars`: you can define custom variables like AUTHOR, LICENSE, PROJECT and etc## License
[The MIT License](http://opensource.org/licenses/MIT)
Copyright (c) 2019 Ivan Zakharchanka[screen-cast]: https://github.com/3axap4eHko/file-templates-manager/raw/master/docs/screen-cast.gif 'File Templates Manager Screen Cast'
[explorer]: https://github.com/3axap4eHko/file-templates-manager/raw/master/docs/explorer.png 'File Templates Manager Explorer'
[template-picker]: https://github.com/3axap4eHko/file-templates-manager/raw/master/docs/template-picker.png 'File Templates Manager Picker'
[type-selector]: https://github.com/3axap4eHko/file-templates-manager/raw/master/docs/select-type.png 'File Templates Manager Selector'[donate-image]: https://img.shields.io/badge/Donate-PayPal-green.svg 'PayPal Donate'
[donate-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=LJWEQTUUZ977C&lc=US&item_name=file-templates-manager¤cy_code=USD