Skip to content

Commit

Permalink
feat: changelog endpoints (#543)
Browse files Browse the repository at this point in the history
* refactor: make `pushDoc` more generic

... so we can reuse it for Changelog! 🚀

No functional changes were made, docs tests should still pass.

* chore: camelcase filePath, grammar tweaks

* test: split out fixtures

* chore: add changelog command category, rearrange

* feat: initial pass at changelog commands

* test: add test suite

let's hope this is right lol

* docs: update README.md

* test: use fixtures in changelog subdir
  • Loading branch information
kanadgupta authored Jul 26, 2022
1 parent da0f370 commit 9d1bcec
Show file tree
Hide file tree
Showing 12 changed files with 826 additions and 6 deletions.
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,26 @@ rdme docs:edit <slug> --version={project-version}
rdme docs:single path-to-markdown-file --version={project-version}
```

### Changelogs

#### Syncing a Folder of Markdown to ReadMe

The Markdown files will require YAML front matter with certain ReadMe documentation attributes. Check out [our docs](https://docs.readme.com/docs/rdme#markdown-file-setup) for more info on setting up your front matter.

Passing in a path to a directory will also sync any Markdown files that are located in subdirectories.

```sh
rdme changelogs path-to-markdown-files
```

This command also has a dry run mode, which can be useful for initial setup and debugging. You can read more about dry run mode [in our docs](https://docs.readme.com/docs/rdme#dry-run-mode).

#### Syncing a Single Markdown File to ReadMe

```sh
rdme changelogs:single path-to-markdown-file
```

### Versions

#### Get All Versions Associated With Your Project
Expand Down
Empty file.
4 changes: 4 additions & 0 deletions __tests__/__fixtures__/changelogs/existing-docs/simple-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: This is the changelog title
---
Body
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
title: This is another changelog title
---
Another body
1 change: 1 addition & 0 deletions __tests__/__fixtures__/changelogs/failure-docs/fail-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Body
6 changes: 6 additions & 0 deletions __tests__/__fixtures__/changelogs/failure-docs/new-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: added
title: This is the changelog title
---

Body
6 changes: 6 additions & 0 deletions __tests__/__fixtures__/changelogs/new-docs/new-doc.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
type: added
title: This is the changelog title
---

Body
7 changes: 7 additions & 0 deletions __tests__/__fixtures__/changelogs/slug-docs/new-doc-slug.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
type: added
title: This is the changelog title
slug: marc-actually-wrote-a-test
---

Body
Loading

0 comments on commit 9d1bcec

Please sign in to comment.