Publish a Typesafe Activator Template
Template Developer Documentation
Create a New Template
Step 1: Fork a Template
Although you can start from scratch it's easiest to pick one of the existing templates and navigate to its source code on GitHub. Then fork the template and rename it.
Step 2: Make Changes
Clone the newly forked template to your local computer. Launch Activator and open the template. Update the template metadata, license, sources, tests, and tutorial.
Step 3: Publish the Template
Once your changes are committed and pushed to GitHub, use the form above to publish the template.
Update a Template
Once your changes have been pushed to your git repo, use the form above to publish a new version.
You may also configure a GitHub repository to auto-republish when you push.
See "Adding a webhook" on this GitHub help page.
Following those instructions, add the WebHook URL:
Whenever you push to a GitHub branch you've published by hand at least once, this hook will republish that branch.
There are four main parts to a template:
- sbt Build
These four pieces are combined into a project that can be used in Activator and as a regular sbt project. With Activator, when a user creates a new app from a template, the tutorial and the metadata are not included in the new project.
Activator templates must provide an
activator.properties file which contains the template metadata. The required properties are:
name- A globally unique, URL friendly name for the template
title- A human readable name for the template
description- A plain text description for the template
tags- A comma-seperated list of tags for the template
These values will be verified when you publish your template.
name=play-with-angular title=Play Framework with AngularJS description=A starter application with Play Framework and AngularJS. tags=playframework,angularjs,java,scala
Activator templates must have a license which permits others to build an app based on the template. This template must be in a file that has a name beginning with
LICENSE and can be in plain text or Markdown. Markdown licenses should be named
The project must set a required sbt version in the
project/build.properties file, like:
Projects can use the legacy Maven layout (which is the default for plain sbt projects) or Play Framework's layout.
The tutorial for a template is in a
Each section of the tutorial must be in a
<div> tag that is inside the
<body> tag. Each section must have a single
<h2> tag that contains the section's title.
The tutorial can provide shortcut links to places in Activator by using an anchor link (
#) and the
shortcut class, like:
<a href="#code/tutorial/index.html" class="shortcut">/tutorial/index.html</a>
Code blocks can use
<pre><code></code></pre> tags, like:
<pre><code>println("hello, Scala!") val foo = "Bar"</code></pre>
In-line code can use just the
<code></code> tag, like:
The <code>val foo = "Bar"</code> statement sets <code>foo</code> to <code>Bar</code>
Images can be embedded by putting them in the
tutorial directory and using a relative URL to the image, like: