#
Getting Started
Getting started with Retype is super quick and you can be up and running within seconds. Check out the Quick Start for the condensed process, or continue here with the full details and expanded steps.
#
Prerequisites
Retype is installed using either npm
, yarn
, or the dotnet
CLI.
You only need one of those three as a prerequisite, although all three could be installed on your computer too. It's up to you. 🙌
Package Manager | Supported Platforms |
---|---|
npm |
Mac , Win , Linux |
yarn |
Mac , Win , Linux |
dotnet |
Mac , Win , Linux |
#
Install
It takes just a few seconds to install Retype using any of the following commands. Choose a command for a Package Manager you have installed on your computer.
npm install --global retypeapp
retype watch
yarn global add retypeapp
retype watch
dotnet tool install --global retypeapp
retype watch
If you already have the dotnet
CLI installed on your machine, installing using dotnet tool install --global retypeapp
will be the fastest option, but any of the options should install within seconds. They all produce the same result and run at the same performance.
#
Init
The next step is to create a retype.json
configuration file for you project. The retype.json
file isn't actually required, but you will want to make customizations to your project and this is how those instructions are passed to Retype.
You can manually create a retype.json
file, or you can have Retype stub out a basic file with a few initial values by running the command retype init
.
From your command line, navigate to any folder location where you have one or more Markdown .md
files, such as the root of a GitHub project, then run the following command:
retype init
Calling the retype init
command will create a simple retype.json
file with the following default values:
#
Sample retype.json
{
"input": ".",
"output": "./retype",
"identity":
{
"title": "Project Name",
"label": "Docs"
},
"links": [
{
"text": "Getting Started",
"link": "https://retype.com/getting_started/"
}
],
"nav": [
{
"path": "/",
"icon": "home"
}
],
"footer": {
"copyright": "© Copyright {{ year }}. All rights reserved."
}
}
All the configs are optional, but the above demonstrates a few of the options you will typically want to start with. See the Project Configuration docs for a full list of all options.
To change the title of the project, revise the identity.title
config. For instance, let's change to "Company X"
:
{
"identity":
{
"title": "Company X",
}
}
#
Build
To generate your new website, run the command retype build
.
retype build
Within just a few seconds, Retype will create a new website and save to the output
location as defined in the retype.json
. By default, the output
location is a new folder named retype
. You can rename to whatever you like, or adjust the path to generate the output to any other location, such as another sub-folder.
If the .md
documentation files for your project were located not in the root (.
) but in a docs
subfolder AND you wanted to have Retype send the output to a website
folder, you would use the following config:
{
"input": "docs",
"output": "website",
}
Let's say you wanted the your new Retype website to run from within a docs
folder which was then also inside of a root website
folder, then you would configure:
{
"input": "docs",
"output": "website/docs"
}
If you are hosting your website using GitHub Pages, you should output to the docs
folder. You could then move your .md
files into a different subfolder and configure as follows:
{
"input": "src",
"output": "docs"
}
The input
and output
configs provide an unlimited flexibility to instruct Retype on where to get your project .md
files and where to output the generated website.
#
Run
To view the new Retype generated website, just run the command retype run
.
retype run
That's it! Your new Retype website should be up and running.
The website generated by Retype is a static HTML and JavaScript site. No special server-side hosting, such as PHP or Ruby is required. A Retype generated website can be hosted on any web server, including as a GitHub Pages website.
You can also use any other local web server instead of retype run
. Retype only includes a web server out of convenience, not requirement. Any web server will do. A couple other simple options could be live-server or static-server.
#
Uninstall
Done with Retype? It's okay, we understand. 😢
Uninstalling Retype is just as simple as installing. Use the same Package Manager to uninstall as you did to install. For instance, if you used npm
to install Retype, run the npm
uninstall command to remove.
# npm
npm uninstall --global retypeapp
# yarn
yarn global remove retypeapp
# dotnet
dotnet tool uninstall --global retypeapp
Any Retype related files within your project can be deleted, such as the retype.json
.