Skip to content

Commit

Permalink
style: increase text width of markdown files to 120
Browse files Browse the repository at this point in the history
  • Loading branch information
loichyan committed Nov 22, 2024
1 parent 6a718c6 commit 8663c33
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 52 deletions.
2 changes: 1 addition & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"proseWrap": "always",
"printWidth": 100
"printWidth": 120
}
32 changes: 15 additions & 17 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

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.1.0/), and this project
adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

<!--
Here's a template for each release section. This file should only include changes that are
noticeable to end-users since the last release. For developers, this project follows
Here's a template for each release section. This file should only include changes that
are noticeable to end-users since the last release. For developers, this project follows
[Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) to track changes.
## [1.0.0] - YYYY-MM-DD
Expand Down Expand Up @@ -38,8 +38,8 @@ noticeable to end-users since the last release. For developers, this project fol
- Support comments in JSON files ([#33]).
- Add a new `nerdfix query` subcommand, useful for querying icon infos from the database ([#33]).
- Add a new `codepoint:from/to` substitution type ([#33]).
- Support checking dropped icons of Nerd Fonts v3.3.0 through the newly added
`nerdfix --nf-version=3.3.0` option ([#33], thanks [@Finii] and [@hasecilu]).
- Support checking dropped icons of Nerd Fonts v3.3.0 through the newly added `nerdfix --nf-version=3.3.0` option
([#33], thanks [@Finii] and [@hasecilu]).

[#30]: https://github.com/loichyan/nerdfix/pull/30
[#33]: https://github.com/loichyan/nerdfix/pull/33
Expand All @@ -48,8 +48,8 @@ noticeable to end-users since the last release. For developers, this project fol

## [0.4.1] - 2024-07-14

This release mainly addresses the high memory usage issue reported in [#18]: fixed a potential
memory leak in [#21], and implemented stream processing in [#22].
This release mainly addresses the high memory usage issue reported in [#18]: fixed a potential memory leak in [#21], and
implemented stream processing in [#22].

Also, some UI changes were introduced in [#21], as we switched the diagnostic reporter from
[codespan_reporting](https://docs.rs/codespan-reporting/latest/codespan_reporting) to
Expand Down Expand Up @@ -81,13 +81,13 @@ Also, some UI changes were introduced in [#21], as we switched the diagnostic re

## [0.4.0] - 2023-10-20

This release introduces the predefined substitutions support suggested in [#9] (thanks [@Finii]),
and also brings some UX breaking changes. Here are some guides for migrating from `v0.3`:
This release introduces the predefined substitutions support suggested in [#9] (thanks [@Finii]), and also brings some
UX breaking changes. Here are some guides for migrating from `v0.3`:

1. Use `dump` instead of `cache` to show all icons and substitutions in the runtime database.
2. The Previous release supports use `--replace FROM:TO` to perform a prefix substitution, now it
uses the newly add `--sub TYPE:FROM/TO` argument to support both `exact` and `prefix`
substitutions. This means that you should use `--sub prefix:FROM/TO` in place of the old one.
2. The Previous release supports use `--replace FROM:TO` to perform a prefix substitution, now it uses the newly add
`--sub TYPE:FROM/TO` argument to support both `exact` and `prefix` substitutions. This means that you should use
`--sub prefix:FROM/TO` in place of the old one.

### Added

Expand Down Expand Up @@ -143,8 +143,7 @@ and also brings some UX breaking changes. Here are some guides for migrating fro

### Changed

- [**breaking**] Deprecated `--yes`, use `--write` and `--select-first` to force non-interactive
fixes ([#4]).
- [**breaking**] Deprecated `--yes`, use `--write` and `--select-first` to force non-interactive fixes ([#4]).
- Streamline Nix package derivation ([a9a3630]).

### Fixed
Expand Down Expand Up @@ -226,8 +225,7 @@ and also brings some UX breaking changes. Here are some guides for migrating fro

## [0.1.0] - 2023-03-25

🎉 Initial release. See [README](https://github.com/loichyan/nerdfix/blob/v0.1.0/README.md) for more
details.
🎉 Initial release. See [README](https://github.com/loichyan/nerdfix/blob/v0.1.0/README.md) for more details.

[Unreleased]: https://github.com/loichyan/nerdfix/compare/v0.4.1..HEAD
[0.4.1]: https://github.com/loichyan/nerdfix/compare/v0.4.0..v0.4.1
Expand Down
63 changes: 29 additions & 34 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,28 @@
![GitHub Release](https://img.shields.io/github/v/release/loichyan/nerdfix)
![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/loichyan/nerdfix/cicd.yml)

`nerdfix` helps you to find/fix obsolete [Nerd Font](https://github.com/ryanoasis/nerd-fonts) icons
in your project.
`nerdfix` helps you to find/fix obsolete [Nerd Font](https://github.com/ryanoasis/nerd-fonts) icons in your project.

## 💭 Why

Nerd Fonts is used in many projects for a beautiful UI. It provides more than 10,000 icons, but some
codepoints conflict with other fonts (especially CJK fonts). To ensure that the icons remain in the
private use area, Nerd Fonts has changed the codepoints of some icons in recent releases, for
example, `mdi-*` icons (including over 2,000 icons) are deprecated since
[v2.3.3](https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.3.3) and will be removed in v3.
Nerd Fonts is used in many projects for a beautiful UI. It provides more than 10,000 icons, but some codepoints conflict
with other fonts (especially CJK fonts). To ensure that the icons remain in the private use area, Nerd Fonts has changed
the codepoints of some icons in recent releases, for example, `mdi-*` icons (including over 2,000 icons) are deprecated
since [v2.3.3](https://github.com/ryanoasis/nerd-fonts/releases/tag/v2.3.3) and will be removed in v3.

These icons are marked as obsolete in
[the official cheat sheet](https://www.nerdfonts.com/cheat-sheet) and it's recommended to replace
them with the new ones. However, you may find it boring to check all the used icons one by one, so
`nerdfix` was written to index the cheat sheet and find obsolete icons in your project.
These icons are marked as obsolete in [the official cheat sheet](https://www.nerdfonts.com/cheat-sheet) and it's
recommended to replace them with the new ones. However, you may find it boring to check all the used icons one by one,
so `nerdfix` was written to index the cheat sheet and find obsolete icons in your project.

## ⚙️ Installation

You can download the pre-built binaries from
[the release page](https://github.com/loichyan/nerdfix/releases/latest) or manually build this
project manually from source.
You can download the pre-built binaries from [the release page](https://github.com/loichyan/nerdfix/releases/latest) or
manually build this project manually from source.

In addition, the binaries come with a recently updated cheat sheet and you can overwrite it with the
latest one using `nerdfix -i /path/to/your/file` (follow
[this link](https://github.com/ryanoasis/nerd-fonts/blob/gh-pages/_posts/2017-01-04-icon-cheat-sheet.md)
to get the latest file).
In addition, the binaries come with a recently updated cheat sheet and you can overwrite it with the latest one using
`nerdfix -i /path/to/your/file` (follow
[this link](https://github.com/ryanoasis/nerd-fonts/blob/gh-pages/_posts/2017-01-04-icon-cheat-sheet.md) to get the
latest file).

### Install from source

Expand All @@ -46,13 +42,13 @@ nix run github:loichyan/nerdfix

## 📋 Note

Please make sure you're using Nerd Fonts after v2.3.3, otherwise the replaced new icons may not be
displayed correctly. If you are a plugin author, it's also recommended to notify this in updates.
Please make sure you're using Nerd Fonts after v2.3.3, otherwise the replaced new icons may not be displayed correctly.
If you are a plugin author, it's also recommended to notify this in updates.

## 🔍 Usage

The `check` command checks input files and reports obsolete icons with some suggestions (sorted by
similarity) that you could replace them with.
The `check` command checks input files and reports obsolete icons with some suggestions (sorted by similarity) that you
could replace them with.

```sh
nerdfix check test/test-data.txt
Expand All @@ -75,8 +71,8 @@ warning: Found obsolete icon U+F752

### Interactive patching

The `fix` command reports the same information as `check` and displays a prompt asking the user to
input a new icon to replace the obsolete one.
The `fix` command reports the same information as `check` and displays a prompt asking the user to input a new icon to
replace the obsolete one.

```text
warning: Found obsolete icon U+F719
Expand Down Expand Up @@ -121,10 +117,10 @@ You can also use the `search` command to call the prompt directly for a fuzzy se
`nerdfix` provides some features to automatically patch obsolete icons:

- The last user input is picked if an icon appears twice.
- Use `--sub FROM/TO` (or `--sub exact:FROM/TO` for full syntax) to replace one icon with another,
e.g. `mdi-tab` is replaced with `md-tab` when `--sub mdi-tab/md-tab` is specified.
- Use `--sub prefix:FROM/TO` to replace the prefix of an icon name with another, e.g. `mdi-tab` is
replaced with `md-tab` when `--sub prefix:mdi-/md-` is specified.
- Use `--sub FROM/TO` (or `--sub exact:FROM/TO` for full syntax) to replace one icon with another, e.g. `mdi-tab` is
replaced with `md-tab` when `--sub mdi-tab/md-tab` is specified.
- Use `--sub prefix:FROM/TO` to replace the prefix of an icon name with another, e.g. `mdi-tab` is replaced with
`md-tab` when `--sub prefix:mdi-/md-` is specified.

### Database

Expand All @@ -140,13 +136,13 @@ You can also use the `search` command to call the prompt directly for a fuzzy se
}
```

As mentioned above, the precompiled `nerdfix` binary comes bundled with an indexed database that
includes all available icons and some common substitutions.
As mentioned above, the precompiled `nerdfix` binary comes bundled with an indexed database that includes all available
icons and some common substitutions.

### Structured output

You can use `check --format json` to get structured output for further use. `nerdfix` prints
diagnostics with the following fields line by line:
You can use `check --format json` to get structured output for further use. `nerdfix` prints diagnostics with the
following fields line by line:

| Field | Description |
| ----------- | ------------------------------------------------------- |
Expand Down Expand Up @@ -190,8 +186,7 @@ nerdfix fix --write --select-first /path/to/file

Licensed under either of

- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or
<http://www.apache.org/licenses/LICENSE-2.0>)
- Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT license ([LICENSE-MIT](LICENSE-MIT) or <http://opensource.org/licenses/MIT>)

at your option.

0 comments on commit 8663c33

Please sign in to comment.