Templates
If your Repl can be used as a good starting point for other project, you might want to submit it as a template! Let's learn what a Replit template is and how to make a good one.
What a template?
Templates are a of published Repl that can be used to build upon. The official templates, made by Replit, have a checkbox next to the name of the template:
The HTML, CSS, JS template template is very popular and can be used as a starting point for creating a vanilla JavaScript project. You can fork the template to use it.
Other templates have been created by community members, like this one:
Creating a template
Public Repls can be published by checking the "Publish as Template" box in the last step of the Publish this Repl flow.
Before you publish your template, make sure it's as easy to use as possible. It should include all the boiler plate code that is needed to get a project started, and it should work right away when the "Run" button is pressed.
A good template should always include well-commented code, easily editable variables, and a README file. It's always important to comment your code, but it's even more important when others will be using your code for their own projects. In the README.md
file, add descriptive details about your template, and information about the variables that the user can change. READMEs help users understand how your template works, and if there are any requirements, licensing, or other factors they should be aware of.
The .md
in README.md
stands for Markdown, which is a basic text language. READMEs can be written in any text format, but we'll use Markdown as it's the best pratice.
Here's an example outline for a README - feel free to use this for your own templates!
# Template Name
Choose a self-descriptive name, you can also add a simple description about your template.
# Usage
Explain how you can install / use this template. Make sure to provide a detailed explanation and make it easy for people to read. Also, add any code snippets if needed.
# License
This will define how people can use your template. You can visit https://opensource.org/licenses to choose a license.
You can also edit your submitted template and share update messages to show how your project has changed over time.