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

feat(docs): keep a changelog #4411

Merged
merged 5 commits into from
Aug 26, 2024
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
3 changes: 3 additions & 0 deletions fern/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,9 @@ navigation:
- page: Reusable snippets
icon: fa-regular fa-recycle
path: ./pages/fern-docs/content/reusable-snippets.mdx
- page: Changelog
path: ./pages/docs/writing-content/changelog.mdx
icon: fa-regular fa-clock

- section: API References
contents:
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
153 changes: 153 additions & 0 deletions fern/pages/docs/writing-content/changelog.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,153 @@
---
title: Keep a Changelog
subtitle: Record the notable changes to your project
---

Keep a record of how your project has changed by writing changelog entries. The changelog will automatically populate with the files contained within the `changelog` folder.

<Frame
caption="Keep your users updated as your project evolves"
background="subtle"
>
<img src="changelog-humanloop.png" />
</Frame>

## Configure your Changelog

<AccordionGroup>
<Accordion title='Top-level Changelog'>
Configure a changelog for your project by creating a changelog folder.

<CodeBlock title="Configure a Changelog">
```yaml {4-6}
fern/
├─ fern.config.json
├─ docs.yml
├─ changelog
├─ 07-08-24.md
└─ 08-21-24.mdx
```
</CodeBlock>

Once you've configured your changelog, specify where it should appear within your docs in your `docs.yml`.

<CodeBlock title="docs.yml">
```yaml {8-11}
tabs:
guides:
display-name: Guides
icon: light book-open
api:
display-name: API Reference
icon: light code
changelog:
display-name: Changelog
icon: light clock
changelog: ../changelog
```
</CodeBlock>

[View an example](https://github.com/humanloop/humanloop-docs/blob/30ddedaf6d2779361e8ee1f373f722364e5dd71d/fern/versions/v5.yml#L10-L13) in GitHub of Humanloop's `docs.yml` which powers [their Changelog](https://humanloop.com/docs/changelog).

</Accordion>
<Accordion title='API-level Changelog'>
Configure a changelog at the API-level by creating a changelog folder specific to an API.

<CodeBlocks>
<CodeBlock title="OpenAPI">
```yaml {6-8}
fern/
├─ fern.config.json
├─ docs.yml
└─ openapi/
├─ openapi.yml
└─ changelog
├─ 07-15-24.md
└─ 08-23-24.mdx
```
</CodeBlock>
<CodeBlock title="Fern Definition">
```yaml {7-9}
fern/
├─ fern.config.json
├─ docs.yml
└─ definition/
├─ api.yml
├─ imdb.yml
└─ changelog
├─ 07-15-24.md
└─ 08-23-24.mdx
```
</CodeBlock>
<CodeBlock title="Multiple APIs">
```yaml {8-10,14-17}
fern/
├─ fern.config.json
├─ docs.yml
└─ user-api
└─ openapi/
├─ openapi.yml
├─ openapi-overrides.yml
└─ changelog
├─ 07-15-24.md
└─ 08-23-24.mdx
└─ admin-api
└─ openapi/
├─ openapi.yml
└─ changelog
├─ 06-29-24.md
└─ 08-02-24.md
└─ 08-15-24.md
```
</CodeBlock>
</CodeBlocks>

Changelogs contained within your API folder will automatically be displayed at the bottom of your API reference. You do not need to configure your changelog(s) within `docs.yml`.

View an example of a changelog per API in [Astronomer's docs](https://www.astronomer.io/docs/api/iam-api-reference/changelog).

<Frame
caption="A unique changelog per API"
background="subtle"
>
<img src="changelog-astronomer.png" />
dannysheridan marked this conversation as resolved.
Show resolved Hide resolved
</Frame>

</Accordion>
</AccordionGroup>

## Write a Changelog Entry

Create a new changelog entry by writing a markdown file. You can use `.md` or `.mdx` files. The benefit of using `.mdx` is that you can leverage the built-in [component library](../components/overview.mdx) within an entry.

<CodeBlock title = "fern/openapi/changelog/2024-07-31.mdx">
```mdx
## Summary

In the latest release, we've added endpoints to create a new Plant.

### What's new?

New endpoints:

- `POST /plant` add a new plant to inventory.
dannysheridan marked this conversation as resolved.
Show resolved Hide resolved

New object schemas:

- `CreatePlantRequest`

<Note> Have questions? Reach out to your local botanist. </Note>
```
</CodeBlock>

### Entry date

Changelog entries are automatically sorted chronologically by the date specific in the file name. Specify the date of your entry using one of the following formats:

- MM-DD-YYYY (e.g., 10-06-2024)
- MM-DD-YY (e.g., 10-06-24)
- YYYY-MM-DD (e.g., 2024-04-21)

### Linking to an Entry

Each changelog entry has a unique URL you can direct users to. For example, `https://humanloop.com/docs/v5/changelog/2024/8/16`
Loading