How to add file templates to intellij plugin? - templates

How can i add (already created) file templates to a custom plugin for intellij idea?
The official docs are empty for file templates, only live templates are described.
https://www.jetbrains.org/intellij/sdk/docs/tutorials/live_templates.html

Maybe someone needs the solution too...
Move your file templates to the resources subfolder, e.g. resources/fileTemplates
Add a .ft extension to your template files, e.g. TestTemplate.py.ft
A good example can be found here:
File templates of the Julia plugin for the IntelliJ Platform
See also:
File Template extension with IntelliJ plugin

Related

in smarty version3 I see in folder structure we have 2 plugin directory which should use for create custom plugin function?

see file structure in screenshot atachment
Hello Friends,
I see in smarty template version3 two plugin directory.
one into project folder and other into libs.
In libs folder we have plugins and sysplugins directory.
My question is I need to create a custom function so I need to put new
file into which
directory is best way?
Both way working I checked but which is the best way to put custom plugin file in which directory?
You can put plugins in any directory that has been added to the Smarty plugins_dir, but looking at your screenshot, it appears that the "other" plugins directory you are looking at is part of the demo application included in the Smarty distribution. You should just remove the demo directory entirely and put your plugins in the smarty/libs/plugins directory.

C# Files not getting added in a custom project template - VS 2017

I am creating a New Project Template in VS2017 based on ASPNET Core Web API project. I have followed steps as outlined here: https://learn.microsoft.com/en-us/visualstudio/ide/how-to-create-project-templates
The zip file contains all the files (C# files).
When the new project is created based on the above project template, none of the C# files are added to the project.
Are there any special steps or settings to include the C# files?
I know this response is late but it may save someone else some other day.
I had this issue as well and i realized the solution was to include the CreateInPlace tag as a child of the TemplateData tag in the .vsTemplate for the project.
Unzip the zip file and update this template file. Add the following line
<CreateInPlace>true</CreateInPlace>
as a child of the TemplateData tag
<TemplateData></TemplateData>

Custom Project Type Templates

When you create a new project in WebStorm, you are given the option to create a new directory structure prepopulated with files: libraries, stylesheets, etc. for patterns like HTM5 boilerplate, Twitter boilerplate, etc.
How does one create one's own template for this? Is importing dummy projects the hack for it?
I suggest not using templates. I find it far more easy and maintainable to create "empty" projects (from existing projects, of course) in a git repo (bitbucket, github, ...), clone one, and start from there.
The .idea should be in the repo, but .idea/workspace.xml should be ignored, as per the documentation.
This gives you the opportunity to gradually refine your template, and share it easily with a team.
Use the LivePlugin plugin to create a project template:
<projectTemplate projectType="foo" templatePath="resources/bar.zip" category="true"/>
Use the Velocity Template Language (VTL) to create a file template:
File and code templates are written in the Velocity Template Language (VTL). So they may include:
Fixed text (markup, code, comments, etc.).
In a file based on a template, the fixed text is used literally, as-is.
File template variables.
When creating a file, the variables are replaced with their values.
#parse directives to include other templates defined in the Includes tab on the File and Code Templates page of the Settings dialog box.
Other VTL constructs.
References
Create project template extensions using "user defined" templates
Creation of Extension to applicationConfigurable
IdeaPlugin.xml
PlatformExtensionPoints.xml
LivePlugin: Plugin for writing IDE plugins
Webstorm Help: File and Code Templates
Configuring JetBrains WebStorm for UI5 development
Webstorm Project and IDE Settings
Idea NodeJS Plugin
Apache Velocity Engine VTL Reference

Cherrypy: Where should I keep my templates

I'm trying to use jinja2 as the template lib for cherrypy.
I'm unable to figure out where should I keep my template files.
The way I'm using it is as documented here:
http://docs.cherrypy.org/stable/progguide/choosingtemplate.html#id2
Can we indicate the path in config file? If yes, what should be the key under which config should be put? Or is it relative to the directory from where app (the file with quickstart call) is invoke?
CherryPy does not tell you where to put your templates, but you can add the location to a config file (under whatever heading you like) and supply it to FileSystemLoader manually.
If you follow the guide you linked to, your templates should be located in a 'templates' folder in the directory you are running the server from.
(N.B. I use pystache, not Jinja, but the principle is the same)

What is the Anjuta project template (automake) *.wiz format (syntax)?

Apparently it's XML-like. Example templates can be found in the gnome Anjuta shares on an Ubuntu install at /usr/share/anjuta/project/
I think I'll go back to Eclipse and gedit if it doesn't look like Anjuta has documented a decent auto-completion, project build, and syntax-highlighting template format. Others with the same question went fishing on Ubuntu forums and had no luck.
The answer might also help people trying to build automake scripts for svn repos at [https://stackoverflow.com/questions/5926366/using-anjuta-with-svn-how-to-create-the-project]
A bit overdue, but I found the official documentation, and remembered having seen your post. From the docs:
The template files look like xml documents and have normally the
extension .wiz. All templates and others related files are installed
by default in $anjuta_install_dir/share/anjuta/templates. But the
project wizard looks for templates in the sub directory
anjuta/templates of all user data directories as defined by XDG Base
Directory Specification too. It is possible to override a Anjuta
project template by an user one put, by example, in
~/.local/share/anjuta/templates.
The template file is divided in four parts: an header block, one or
more page blocks, a content block and an optional action block. The
file is read several times, one time for each block but before reading
it, the whole file go though a transformation pass and only the
resulting file must be a valid xml file. The transformation pass uses
autogen.