Skip to content

Commit

Permalink
Divide usage into reading & writing
Browse files Browse the repository at this point in the history
  • Loading branch information
NiclasvanEyk authored Jul 7, 2023
1 parent e01551d commit c600998
Showing 1 changed file with 27 additions and 23 deletions.
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,9 @@ go build -o changelog

## Usage

### `changelog init`
### Reading

Creates an empty `CHANGELOG.md` file in the current directory which looks something like this:

```markdown
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
```

### `changelog find`
#### `changelog find`

Finds the nearest `CHANGELOG.md` relative to the current working directory and prints it to the console.
If none is found, keepac will recursively walk upwards the directory tree until it either reaches the root or finds one.
Expand All @@ -63,13 +48,13 @@ If none is found, keepac will recursively walk upwards the directory tree until
While quite basic, this command can be used in conjunction with other tools to quickly build custom functionality.

### `changelog show`
#### `changelog show`

Renders the nearest changelog right inside your terminal using [charmbracelet/glamour](https://github.com/charmbracelet/glamour).

> Since keepac uses `glamour` to render markdown, you can theme its output by setting the `GLAMOUR_STYLE` environment variable to one of the [available styles](https://github.com/charmbracelet/glamour/tree/master/styles/gallery) or [create your own](https://github.com/charmbracelet/glamour/tree/master/styles).
### `changelog search`
#### `changelog search`

Searches for changes matching the given search query.

Expand All @@ -80,13 +65,32 @@ Searches for changes matching the given search query.

Matches are displayed with contextual information, such as the version the change was released in and its type of change.

### `changelog edit`
### Writing

#### `changelog init`

Creates an empty `CHANGELOG.md` file in the current directory which looks something like this:

```markdown
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### Added
```

#### `changelog edit`

Opens the nearest changelog inside your `$EDITOR`.

If you did not set the `$EDITOR` environment variable, commands like `xdg-open` or `open` are used as a fallback.

### `changelog insert`
#### `changelog insert`

Adds a new entry to one of your sections in the changelog.

Expand All @@ -108,15 +112,15 @@ changelog insert
will open up either your `$EDITOR` or an inline one if the `$EDITOR` environment variable is not set.
Describe your changes, close the editor and an entry .

### `changelog release`
#### `changelog release`

Turns the `[Unreleased]` section into a proper versioned release.

You may pass a version adhering to SemVer or use the `--major`, `--minor`, `--patch` flags.
Note that there must be prior releases in order to use these!
By default the current date is used as the realease date, but you may override this using the `--date` option.

### `changelog yank <version>`
#### `changelog yank <version>`

Marks the specified released as yanked`. To cite [Keep a Changelog](https://keepachangelog.com/en/1.1.0/#yanked):

Expand Down

0 comments on commit c600998

Please sign in to comment.