You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The templates are for like code snippets etc. that you can "scaffold" into your project to ex. auto generate modules, configuration files, resources etc.
If you look in templates each folder represents a type of template.
WIthin each type of templates there are files.
Each file represents a template.
The data that is "mixed" into the templates are the data that is passed to the command-line.
Then the template is simply put into the folder you're working in with the result of that.
Except emeralD templates can be used as both content snippets, but also as file snippets.
Example:
emerald d class myclass myclass MyClass
The above command will go into "d" templates" and then look for the template called "class" and then it will generate a class with the following arguments:
myclass myclass MyClass
Which corresponds to:
filename module-name class-name
The final result is a file called "myclass.d" with the following content:
module myclass;
class MyClass
{
public:
this()
{
}
}
Scaffolding is a little different than templates.
Scaffolding are basically just archives of files etc. that you can pull into your project.
An example of it would be the dub scaffolding archive, which is basically a preset for an empty dub project.
Example:
emerald --scaffold dub
The above will scaffold dub and create an empty dub project within your working directory.
Basically emeralD is a tool that can be used to ease file generation, scaffolding etc. of a project.
It's useful when you have different stacks etc. because you can integrate the thing into your build-system, deployment etc.
I just took a look at this. I'm not quite sure what kind of templating it does? (Html,D,code in general) It would be nice to have a use case shown.
The text was updated successfully, but these errors were encountered: