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

improvement: logo and primary colors #6

Merged
merged 3 commits into from
Nov 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ instances:
1. Install the Fern CLI by running:

```bash
npm install -g fern-api
$ npm install -g fern-api
```

2. Generate your documentation with the following command:

```bash
fern generate --docs
$ fern generate --docs
```

You will be prompted to log in and connect your GitHub account.
Expand All @@ -67,12 +67,19 @@ Once the documentation is generated, you will receive a URL where your documenta
└─
```

### Step 5: Customize Your Documentation
### Step 5: Choose an API definition format

To get started, replace the provided OpenAPI specification with your own. Then, modify the markdown pages located in the [content](fern/docs/content/) directory. You can further tailor your documentation to match your brand by adjusting settings in the [docs.yml](fern/docs.yml) file.
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.

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.

### Step 6: Set Up a Custom Domain
### Step 6: Customize Your Documentation

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.

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

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:

Expand All @@ -83,13 +90,14 @@ If you wish to use a custom domain like `docs.your-organization.com` or a subdir

### Step 7: Explore Advanced Features

For advanced documentation features and options, visit the [Fern Docs Advanced Repo](https://github.com/fern-api/docs-advanced).
For advanced documentation features and options, visit the [Fern Docs](https://docs.buildwithfern.com/generate-docs).

**Advanced features** include:

- Versioning
- Changelog
- Multiple APIs
- Custom background
- Bring your own fonts

Good luck creating beautiful and functional documentation! 🌿
Good luck creating beautiful and functional documentation! 🌿
92 changes: 92 additions & 0 deletions fern/definition/__package__.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

types:
PlantInput:
docs: Input for adding a new plant.
properties:
name: string
category:
type: optional<PlantCategory>
photoUrls:
type: map<string, string>
status:
type: optional<PlantStatus>

OwnerId:
type: string
docs: Unique identifier for an owner.

PlantOwner:
properties:
id:
type: optional<PlantOwnerId>
age:
type: optional<OwnerAge>
plants:
type: optional<list<Plant>>

OwnerAge:
docs: Age category of an owner.
enum:
- name: child
value: child
- name: adult
value: adult
- name: senior
value: senior

PlantOwnerId:
type: OwnerId
docs: Identifier for a plant owner.

PlantId:
type: string
docs: Unique identifier for a plant.

CategoryId:
type: string
docs: Unique identifier for a plant category.

PlantCategory:
docs: Category information for a plant.
properties:
id:
type: CategoryId
name: string

PlantStatus:
docs: Status of a plant.
enum:
- name: available
value: available
- name: pending
value: pending
- name: sold
value: sold

Plant:
docs: Information about a plant.
properties:
id:
type: optional<PlantId>
category:
type: optional<PlantCategory>
name:
type: optional<string>
photoUrls:
type: optional<map<string, string>>
status:
type: optional<PlantStatus>

Error:
properties:
message: string

errors:
BadRequestError:
status-code: 400
type: Error

NotFoundError:
status-code: 404
type: Error
7 changes: 7 additions & 0 deletions fern/definition/api.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
imports:
root: __package__.yml
name: api
display-name: Plant Store API
error-discrimination:
strategy: status-code
auth: bearer
43 changes: 43 additions & 0 deletions fern/definition/owner.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
root: __package__.yml

service:
auth: false
base-path: ""
endpoints:
addOwner:
path: /owners
method: POST
auth: false
display-name: Add a new owner
request:
name: PlantOwnerInput
body:
properties:
name: string
age:
type: root.OwnerAge
plants:
type: list<root.PlantInput>
response:
docs: Owner added successfully
type: root.PlantOwner
errors:
- root.BadRequestError

deleteOwner:
path: /owners/{ownerId}
method: DELETE
auth: false
path-parameters:
ownerId:
docs: Identifier for an owner.
type: root.OwnerId
display-name: Delete an owner
errors:
- root.NotFoundError
examples:
- path-parameters:
ownerId: owner-id
56 changes: 56 additions & 0 deletions fern/definition/plant.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# yaml-language-server: $schema=https://raw.githubusercontent.com/fern-api/fern/main/fern.schema.json

imports:
root: __package__.yml

service:
auth: false
base-path: ""
endpoints:
addPlant:
path: /plants
method: POST
auth: false
display-name: Add a new plant
request:
body:
type: root.PlantInput
docs: Input for adding a new plant.
errors:
- root.BadRequestError

getPlantById:
path: /plants/{plantId}
method: GET
auth: false
path-parameters:
plantId:
docs: Identifier for a plant.
type: root.PlantId
display-name: Get a plant
response:
docs: Plant retrieved successfully
type: root.Plant
errors:
- root.NotFoundError
examples:
- path-parameters:
plantId: plant-id
response:
body:
status: available

deletePlantById:
path: /plants/{plantId}
method: DELETE
auth: false
path-parameters:
plantId:
docs: Identifier for a plant.
type: root.PlantId
display-name: Delete a plant
errors:
- root.NotFoundError
examples:
- path-parameters:
plantId: plant-id
11 changes: 7 additions & 4 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,12 @@ navbar-links:

colors:
accentPrimary:
dark: "#1FBAB4"
light: "#126d69"
dark: "#18ed9d"
light: "#13A06C"

logo:
dark: ./docs/assets/fern_logo.png
light: ./docs/assets/fern_logo.png
dark: ./docs/assets/logo_white.png
light: ./docs/assets/logo_black.png
height: 25

favicon: ./docs/assets/favicon.png
Binary file added fern/docs/assets/favicon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed fern/docs/assets/fern_logo.png
Binary file not shown.
Binary file removed fern/docs/assets/helloworld.png
Binary file not shown.
Binary file added fern/docs/assets/logo_black.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added fern/docs/assets/logo_white.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
16 changes: 15 additions & 1 deletion fern/generators.yml
Original file line number Diff line number Diff line change
@@ -1 +1,15 @@
{}
# To run the code generator
# 1. `$ npm i -g fern-api`
# 2. `$ fern generate`

default-group: local
groups:
local:
generators:
- name: fernapi/fern-openapi
version: 0.0.28
config:
format: yaml
output:
location: local-file-system
path: ../openapi
Loading
Loading