Skip to content

Commit 449ac4d

Browse files
committed
docs(config): split the configuration documentation into pages
1 parent cbbf615 commit 449ac4d

20 files changed

+1526
-1273
lines changed

docs/commands/bump.md

Lines changed: 61 additions & 243 deletions
Large diffs are not rendered by default.

docs/commands/changelog.md

Lines changed: 50 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,44 +2,37 @@
22

33
This command will generate a changelog following the committing rules established.
44

5-
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](./bump.md#update_changelog_on_bump)
5+
!!! tip
6+
To create the changelog automatically on bump, add the setting [update_changelog_on_bump](../config/bump.md#update_changelog_on_bump)
67

7-
```toml
8-
[tool.commitizen]
9-
update_changelog_on_bump = true
10-
```
8+
```toml
9+
[tool.commitizen]
10+
update_changelog_on_bump = true
11+
```
1112

1213
## Usage
1314

1415
![cz changelog --help](../images/cli_help/cz_changelog___help.svg)
1516

16-
### Examples
17-
18-
#### Generate full changelog
17+
## Examples
1918

2019
```bash
20+
# Generate full changelog
2121
cz changelog
22-
```
2322

24-
```bash
23+
# or use the alias
2524
cz ch
26-
```
2725

28-
#### Get the changelog for the given version
29-
30-
```bash
26+
# Get the changelog for the given version
3127
cz changelog 0.3.0 --dry-run
32-
```
33-
34-
#### Get the changelog for the given version range
3528

36-
```bash
29+
# Get the changelog for the given version range
3730
cz changelog 0.3.0..0.4.0 --dry-run
3831
```
3932

4033
## Constrains
4134

42-
changelog generation is constrained only to **markdown** files.
35+
Changelog generation is constrained only to **markdown** files.
4336

4437
## Description
4538

@@ -72,51 +65,29 @@ and the following variables are expected:
7265

7366
- **required**: is the only one required to be parsed by the regex
7467

75-
## Configuration
76-
77-
### `unreleased_version`
78-
79-
There is usually a chicken and egg situation when automatically
80-
bumping the version and creating the changelog.
81-
If you bump the version first, you have no changelog, you have to
82-
create it later, and it won't be included in
83-
the release of the created version.
84-
85-
If you create the changelog before bumping the version, then you
86-
usually don't have the latest tag, and the _Unreleased_ title appears.
87-
88-
By introducing `unreleased_version` you can prevent this situation.
89-
90-
Before bumping you can run:
91-
92-
```bash
93-
cz changelog --unreleased-version="v1.0.0"
94-
```
95-
96-
Remember to use the tag instead of the raw version number
68+
## Command line options
9769

98-
For example if the format of your tag includes a `v` (`v1.0.0`), then you should use that,
99-
if your tag is the same as the raw version, then ignore this.
70+
### `--extras`
10071

101-
Alternatively you can directly bump the version and create the changelog by doing
72+
Provides your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
10273

10374
```bash
104-
cz bump --changelog
75+
cz changelog --extra key=value -e short="quoted value"
10576
```
10677

107-
### `file-name`
78+
### `--file-name`
10879

109-
This value can be updated in the `toml` file with the key `changelog_file` under `tools.commitizen`
80+
This value can be updated in the configuration file with the key `changelog_file` under `tools.commitizen`
11081

11182
Specify the name of the output file, remember that changelog only works with Markdown.
11283

11384
```bash
11485
cz changelog --file-name="CHANGES.md"
11586
```
11687

117-
### `incremental`
88+
### `--incremental`
11889

119-
This flag can be set in the `toml` file with the key `changelog_incremental` under `tools.commitizen`
90+
This flag can be set in the configuration file with the key `changelog_incremental` under `tools.commitizen`
12091

12192
Benefits:
12293

@@ -134,9 +105,9 @@ cz changelog --incremental
134105
changelog_incremental = true
135106
```
136107

137-
### `start-rev`
108+
### `--start-rev`
138109

139-
This value can be set in the `toml` file with the key `changelog_start_rev` under `tools.commitizen`
110+
This value can be set in the configuration file with the key `changelog_start_rev` under `tools.commitizen`
140111

141112
Start from a given git rev to generate the changelog. Commits before that rev will not be considered. This is especially useful for long-running projects adopting conventional commits, where old commit messages might fail to be parsed for changelog generation.
142113

@@ -150,9 +121,9 @@ cz changelog --start-rev="v0.2.0"
150121
changelog_start_rev = "v0.2.0"
151122
```
152123

153-
### merge-prerelease
124+
### `--merge-prerelease`
154125

155-
This flag can be set in the `toml` file with the key `changelog_merge_prerelease` under `tools.commitizen`
126+
This flag can be set in the configuration file with the key `changelog_merge_prerelease` under `tools.commitizen`
156127

157128
Collects changes from prereleases into the next non-prerelease. This means that if you have a prerelease version, and then a normal release, the changelog will show the prerelease changes as part of the changes of the normal release. If not set, it will include prereleases in the changelog.
158129

@@ -166,20 +137,39 @@ cz changelog --merge-prerelease
166137
changelog_merge_prerelease = true
167138
```
168139

169-
### `template`
140+
### `--template`
170141

171142
Provides your own changelog jinja template by using the `template` settings or the `--template` parameter.
172-
See [the template customization section](../customization.md#customizing-the-changelog-template)
173143

174-
### `extras`
144+
### `--unreleased-version`
175145

176-
Provides your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
146+
There is usually a chicken and egg situation when automatically
147+
bumping the version and creating the changelog.
148+
If you bump the version first, you have no changelog, you have to
149+
create it later, and it won't be included in
150+
the release of the created version.
151+
152+
If you create the changelog before bumping the version, then you
153+
usually don't have the latest tag, and the _Unreleased_ title appears.
154+
155+
By introducing `--unreleased-version` you can prevent this situation.
156+
157+
Before bumping you can run:
177158

178159
```bash
179-
cz changelog --extra key=value -e short="quoted value"
160+
cz changelog --unreleased-version="v1.0.0"
180161
```
181162

182-
See [the template customization section](../customization.md#customizing-the-changelog-template)
163+
Remember to use the tag instead of the raw version number
164+
165+
For example if the format of your tag includes a `v` (`v1.0.0`), then you should use that,
166+
if your tag is the same as the raw version, then ignore this.
167+
168+
Alternatively you can directly bump the version and create the changelog by doing
169+
170+
```bash
171+
cz bump --changelog
172+
```
183173

184174
## Hooks
185175

@@ -192,4 +182,4 @@ Read more about hooks in the [customization page][customization]
192182

193183
[keepachangelog]: https://keepachangelog.com/
194184
[semver]: https://semver.org/
195-
[customization]: ../customization.md
185+
[customization]: ../customization/config_file.md

docs/commands/commit.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ The `commit` command provides an interactive way to create structured commits. U
1111
- `cz commit`
1212
- `cz c` (shortcut)
1313

14-
By default, Commitizen uses conventional commits, but you can customize the commit rules to match your project's needs. See the [customization guide](../customization.md) for details.
14+
By default, Commitizen uses conventional commits, but you can customize the commit rules to match your project's needs. See the [customization guide](../customization/config_file.md) for details.
1515

1616
## Basic Usage
1717

docs/commands/init.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ When you run `cz init`, Commitizen will guide you through an interactive setup p
2020

2121
The initialization process will create a configuration file in your project root.
2222

23-
Choose the configuration file format based on your project type:
24-
25-
- Use `pyproject.toml` for Python projects
26-
- Use `.cz.toml`, `.cz.yaml`, `.cz.json`, etc. for other projects.
23+
See [Configuration File][configuration_file] for more details.
2724

2825
## Configuration Options
2926

@@ -48,6 +45,8 @@ During the initialization process, you'll be prompted to configure the following
4845
7. **Alpha Versioning**: Option to keep major version at 0 for alpha/beta software
4946
8. **Pre-commit Hooks**: Set up Git pre-commit hooks for automated commit message validation
5047

48+
See [Configuration Options][configuration_options] for more details.
49+
5150
## Example
5251

5352
```sh
@@ -61,6 +60,9 @@ cz init
6160

6261
After initialization, you can:
6362

64-
1. Start using `cz commit` to create conventional commits
65-
2. Use `cz bump` to manage versioning
66-
3. Configure additional settings in your project's configuration file
63+
1. Start using [`cz commit`](./commit.md) to create conventional commits
64+
2. Use [`cz bump`](./bump.md) to manage versioning
65+
3. Configure additional settings in your project's [configuration_file][configuration_file]
66+
67+
[configuration_file]: ../config/configuration_file.md
68+
[configuration_options]: ../config/option.md

0 commit comments

Comments
 (0)