Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real World Example #1

Open
taylorh140 opened this issue Jun 20, 2018 · 1 comment
Open

Real World Example #1

taylorh140 opened this issue Jun 20, 2018 · 1 comment
Labels
question Further information is requested

Comments

@taylorh140
Copy link

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.

@bausshf
Copy link
Member

bausshf commented Jun 23, 2018

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.

It's basically similar to "snippets" in Atom.

https://flight-manual.atom.io/using-atom/sections/snippets/

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.

@bausshf bausshf added the question Further information is requested label Jun 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants