Skip to content

Commit

Permalink
Update README.md for docs-starter quickstart instructions (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
minaelee authored Jan 11, 2024
1 parent 08f020c commit a7e06ca
Showing 1 changed file with 51 additions and 28 deletions.
79 changes: 51 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,22 @@ Your docs can look this good:

---

## Let's Get Started
## Let's get started

### Step 1: Use This Template
### Step 1: Use this template

1. Click on the "Use this template" button.
2. Create a new repository. Name it anything you like, `docs` is a common naming choice.
1. Click on the "Use this template" button. You must be logged into GitHub.
2. Create a new repository. Name it anything you like; `docs` is a common naming choice.

### Step 2: Open in Your Preferred IDE
### Step 2: Clone and open in your preferred code editor

Clone your newly created repository and open it in your favorite integrated development environment (IDE) or code editor.

### Step 3: Customize Organization Name
The files and folders discussed in the following steps will be inside a `fern` folder in your repository.

In the fern.config.json file, replace the placeholder organization name with your actual organization name. For example:
### Step 3: Customize organization name

In the `fern.config.json` file, replace the placeholder organization name with your actual organization name. For example:

```json
{
Expand All @@ -48,22 +50,48 @@ In the fern.config.json file, replace the placeholder organization name with you
}
```

Also, in the docs.yml file, update the docs URL to match your organization's naming convention. For example:
In the `docs.yml` file, update the docs URL to match your organization's naming convention. For example:

```yml
instances:
- url: your-organization.docs.buildwithfern.com
```
### Step 4: Generate Your Documentation
1. Install the Fern CLI by running:
### Step 4: Install the Fern CLI
Install the Fern CLI globally by running:
```bash
npm install -g fern-api
```
As this is a global command, you can run it from any location. The CLI commands in the following steps must be run from within your repository.

### Step 5 (Optional): Use an OpenAPI Specification

If you will be using [Fern Definitions](https://docs.buildwithfern.com/api-definition/fern-definition/overview) to describe your API, skip to [Step 6](#step-6-generate-your-documentation).

If you will be using the [OpenAPI Specification](https://chat.openai.com/share/47bcc007-17d8-483a-ab5a-91c10c4a73e1) (OAS), follow these steps:
1. Delete the `definition` folder.
2. Run:

```bash
fern init --openapi URL_OR_PATH_TO_YOUR_OPENAPI_SPEC
```

1. Generate your documentation with the following command:
Examples:

```fern init --openapi https://petstore3.swagger.io/api/v3/openapi.json```

```fern init --openapi ../apis/openapi.yml```

You can use a URL to an OAS file online, or you can use a local path. The file must be formatted as JSON or YAML.

Confirm that you see a new folder named `openapi` and that it contains the OAS file you specified, in YAML format.

### Step 6: Generate your documentation

Generate and publish your documentation with the following command:

```bash
fern generate --docs
Expand All @@ -78,38 +106,33 @@ Once the documentation is generated, you will receive a URL where your documenta
│ ✓ your-organization.docs.buildwithfern.com
└─
```
### Step 7: Customize your documentation

### Step 5: Choose an API definition format
To update your API definitions:
- For [Fern Definitions](https://docs.buildwithfern.com/api-definition/fern-definition/overview), update the files in the `definition` folder.
- For OpenAPI definitions, update the file in the `openapi` folder.

If you're using a [Fern Definition](https://docs.buildwithfern.com/api-definition/fern-definition/overview), you can edit the files within the [`definition`](/fern/definition/) folder.
Next, modify the markdown pages located in the `docs/pages` folder, such as the Welcome page.

If you're using an [OpenAPI Specification](https://docs.buildwithfern.com/api-definition/openapi/extensions), then run the command: `fern generate`. You'll see a new folder created called `openapi` that contains your spec. You can edit this spec to make it your own OR copy and paste a spec you already have. Then, delete the `definition` folder.
Further tailor your documentation to match your brand by adjusting settings in the `docs.yml` file.

### Step 6: Customize Your Documentation
To re-publish the updates to your documentation, run `fern generate --docs` again.

Next, modify the markdown pages located in the [pages](fern/docs/pages/) directory. You can further tailor your documentation to match your brand by adjusting settings in the [docs.yml](fern/docs.yml) file.
To preview updates to your documentation before publishing changes, run `fern generate --docs --preview`.

Fern has a built-in component library for you to use. [Explore the components.](https://docs.buildwithfern.com/generate-docs/component-library/)

### Step 6: Set Up a Custom Domain
### Step 8: Set up a custom domain

If you wish to use a custom domain like `docs.your-organization.com` or a subdirectory like `your-organization.com/docs`, you can subscribe to the [Starter plan](https://buildwithfern.com/pricing). Once subscribed, update [docs.yml](fern/docs.yml) with the custom domain configuration:
If you wish to use a custom subdomain like `https://docs.your-organization.com` or a subpath like `https://your-organization.com/docs`, you can subscribe to the [Starter plan](https://buildwithfern.com/pricing). Once subscribed, update `docs.yml` with the custom domain configuration:

``` yaml
- url: your-organization.docs.buildwithfern.com
custom-domain: docs.your-organization.com
```
### Step 7: Explore Advanced Features
For advanced documentation features and options, visit the [Fern Docs](https://docs.buildwithfern.com/generate-docs).
**Advanced features** include:
### Step 9: Explore advanced features
- Versioning
- Changelog
- Multiple APIs
- Custom background
- Bring your own fonts
For advanced documentation features and options, view the full [configuration docs](https://docs.buildwithfern.com/generate-docs/overview/configuration).
Good luck creating beautiful and functional documentation! 🌿

0 comments on commit a7e06ca

Please sign in to comment.