Skip to content

Commit c222eb3

Browse files
chore(taplo): add .taplo.toml, standardize the terminology in the documentation, and optimize the paths in the CI (#346)
Signed-off-by: Shigure Kurosaki <[email protected]>
1 parent 3dfacb3 commit c222eb3

File tree

13 files changed

+42
-40
lines changed

13 files changed

+42
-40
lines changed

.github/CODE-OF-CONDUCT.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Examples of unacceptable behavior include:
2323
- The use of sexualized language or imagery, and sexual attention or advances of any kind.
2424
- Trolling, insulting or derogatory comments, and personal or political attacks.
2525
- Public or private harassment.
26-
- Publishing others private information, such as a physical or email address, without their explicit permission.
26+
- Publishing others' private information, such as a physical or email address, without their explicit permission.
2727
- Other conduct which could reasonably be considered inappropriate in a professional setting.
2828

2929
## Enforcement Responsibilities

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ on:
77
- 'src/**'
88
- 'tests/**'
99
- 'examples/nextjs/.next/server/app/articles/*.html'
10+
- '.config/ast-grep/**/*.yml'
1011
- 'Cargo.toml'
1112
- 'Cargo.lock'
1213
- '.rustfmt.toml'
13-
- '.config/ast-grep/**/*.yml'
1414
- 'sgconfig.yml'
1515
- '.editorconfig'
1616
jobs:

.github/workflows/md-analyzer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ on:
55
- '.github/**/*.md'
66
- 'examples/**/README.md'
77
- 'README.md'
8+
- '.config/vale/styles/**/*.yml'
9+
- '.config/vale/styles/config/vocabularies/**/*.txt'
810
- '.prettierrc.toml'
911
- '.markdownlint.yml'
1012
- '.markdownlint-cli2.yaml'
1113
- '.vale.ini'
12-
- '.config/vale/styles/**/*.yml'
13-
- '.config/vale/styles/config/vocabularies/**/*.txt'
1414
- '.editorconfig'
1515
jobs:
1616
alex:

.github/workflows/toml-analyzer.yml

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,10 @@ name: TOML Analyzer
22
on:
33
pull_request:
44
paths:
5+
- '*.toml'
56
- 'examples/**/katharsis.config.toml'
67
- 'src/cmd/katharsis.config.toml'
78
- 'tests/katharsis.config.toml'
8-
- '.prettierrc.toml'
9-
- 'Cargo.toml'
10-
- 'deny.toml'
11-
- 'rust-toolchain.toml'
12-
- '.rustfmt.toml'
13-
- '.editorconfig'
14-
- '.typos.toml'
159
jobs:
1610
taplo:
1711
name: taplo
@@ -28,8 +22,8 @@ jobs:
2822
- name: Run taplo fmt
2923
run: |
3024
shopt -s globstar
31-
taplo fmt examples/**/katharsis.config.toml src/cmd/katharsis.config.toml tests/katharsis.config.toml .prettierrc.toml Cargo.toml deny.toml rust-toolchain.toml .rustfmt.toml --check
25+
taplo fmt --check
3226
- name: Run taplo check
3327
run: |
3428
shopt -s globstar
35-
taplo check examples/**/katharsis.config.toml src/cmd/katharsis.config.toml tests/katharsis.config.toml .prettierrc.toml Cargo.toml deny.toml rust-toolchain.toml .rustfmt.toml
29+
taplo check

.github/workflows/typos.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ name: Typos
22
on:
33
pull_request:
44
paths:
5-
- '.typos.toml'
65
- 'etc/**'
76
- 'src/**'
87
- 'tests/**'
8+
- '.typos.toml'
99
jobs:
1010
typos:
1111
runs-on: ubuntu-latest

.github/workflows/yaml-analyzer.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,9 @@ name: YAML Analyzer
22
on:
33
pull_request:
44
paths:
5+
- '*.yml'
56
- '.github/**/*.yml'
67
- '.config/**/*.yml'
7-
- 'sgconfig.yml'
8-
- '.yamllint.yml'
9-
- '.markdownlint.yml'
108
- '.prettierrc.toml'
119
- '.markdownlint-cli2.yaml'
1210
- '.editorconfig'

.taplo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
include = [
2+
"*.toml",
3+
"examples/**/katharsis.config.toml",
4+
"src/cmd/katharsis.config.toml",
5+
"tests/katharsis.config.toml",
6+
]
7+
8+
[formatting]
9+
align_comments = false
10+
allowed_blank_lines = 1

README.md

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ Run the following command to create a default `rss.xml`:
109109
katharsis
110110
```
111111

112-
## Overview
112+
## General
113113

114114
### Commands
115115

@@ -118,22 +118,22 @@ katharsis
118118
| init | Generates a `katharsis.config.toml` file in the current directory. |
119119
| help | Displays help information. |
120120

121-
### Parameters
121+
### Arguments
122122

123-
| Parameter | Description |
124-
| --------- | ------------------------------------------------------- |
125-
| -c | Specifies a `katharsis.config.toml` file as the config. |
126-
| -h | Displays help information. |
127-
| -V | Displays the current version of Katharsis. |
123+
| Argument | Description |
124+
| -------- | ------------------------------------------------------- |
125+
| -c | Specifies a `katharsis.config.toml` file as the config. |
126+
| -h | Displays help information. |
127+
| -V | Displays the current version of Katharsis. |
128128

129129
> [!NOTE]
130-
> If you do not specify the `-c` parameter, the `katharsis.config.toml` file in the current directory will be used by default.
130+
> If you do not specify the `-c` argument, the `katharsis.config.toml` file in the current directory will be used by default.
131131
132-
### Fields
132+
### Properties
133133

134134
You can refer to the [RSS 2.0 at Harvard Law](https://cyber.harvard.edu/rss/rss.html) for more detailed documentation.
135135

136-
| Field | Description |
136+
| Property | Description |
137137
| --------------- | ---------------------------------- |
138138
| rss.title | The title of the website. |
139139
| rss.description | A description of the website. |
@@ -145,11 +145,11 @@ You can refer to the [RSS 2.0 at Harvard Law](https://cyber.harvard.edu/rss/rss.
145145

146146
> [!NOTE]
147147
>
148-
> - The `rss.site_url` field should not include a trailing slash (for example, `https://example.com` rather than `https://example.com/`).
149-
> - The `rss.image` field is relative to the `rss.site_url`, for example, `favicon.png` corresponds to `https://example.com/favicon.png`.
150-
> - The `rss.output` field specifies the path relative to the working directory (for example, `rss.xml` corresponds to `./rss.xml`).
148+
> - The `rss.site_url` property should not include a trailing slash (for example, `https://example.com` rather than `https://example.com/`).
149+
> - The `rss.image` property is relative to the `rss.site_url`, for example, `favicon.png` corresponds to `https://example.com/favicon.png`.
150+
> - The `rss.output` property specifies the path relative to the working directory (for example, `rss.xml` corresponds to `./rss.xml`).
151151
152-
| Field | Description |
152+
| Property | Description |
153153
| ------------------- | ---------------------------------------------------------- |
154154
| article.title | The tag containing the article's title. |
155155
| article.description | The tag or attribute containing the article's description. |
@@ -163,9 +163,9 @@ You can refer to the [RSS 2.0 at Harvard Law](https://cyber.harvard.edu/rss/rss.
163163

164164
> [!NOTE]
165165
>
166-
> - The `article.input` field corresponds to the file stem (`*`), which is the same as the article's URL slug.
167-
> - The `article.date` field's tag must include a [datetime](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time) attribute, and the attribute value must follow the `%Y-%m-%d` format.
168-
> - The `article.image` field’s folder name (`**`) must match the article's URL slug.
166+
> - The `article.input` property corresponds to the file stem (`*`), which is the same as the article's URL slug.
167+
> - The `article.date` property's tag must include a [datetime](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/time) attribute, and the attribute value must follow the `%Y-%m-%d` format.
168+
> - The `article.image` property's folder name (`**`) must match the article's URL slug.
169169
170170
## API Docs
171171

examples/nextjs/katharsis.config.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Fields Overview: https://github.com/arghena/katharsis/blob/canary/README.md#fields
1+
# Documentation: https://github.com/arghena/katharsis/blob/canary/README.md#properties
22

33
[rss]
44
title = "The React Framework for the Web"

src/arg/handle.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ fn channel_builder(rss: Rss, items: Vec<Item>) -> Channel {
160160
.build()
161161
}
162162

163-
/// Build the RSS feed based on the fields in the config file, and return the parsed [`Channel`].
163+
/// Build the RSS feed based on the properties in the config file, and return the parsed [`Channel`].
164164
///
165165
/// # Examples
166166
///
@@ -181,7 +181,7 @@ fn channel_builder(rss: Rss, items: Vec<Item>) -> Channel {
181181
///
182182
/// # Errors
183183
///
184-
/// - When the files existence cannot be verified.
184+
/// - When the file's existence cannot be verified.
185185
/// - When the file does not exist.
186186
/// - When the file cannot be read.
187187
/// - When the TOML file cannot be deserialized.

0 commit comments

Comments
 (0)