Skip to content

Commit 01c0409

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

File tree

16 files changed

+999
-735
lines changed

16 files changed

+999
-735
lines changed

docs/commands/bump.md

Lines changed: 59 additions & 237 deletions
Large diffs are not rendered by default.

docs/commands/changelog.md

Lines changed: 50 additions & 57 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,31 @@ and the following variables are expected:
7265

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

75-
## Configuration
68+
## Command line options
7669

77-
### `unreleased_version`
70+
### `--extras`
7871

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:
72+
Provides your own changelog extra variables by using the `extras` settings or the `--extra/-e` parameter.
9173

9274
```bash
93-
cz changelog --unreleased-version="v1.0.0"
75+
cz changelog --extra key=value -e short="quoted value"
9476
```
9577

96-
Remember to use the tag instead of the raw version number
97-
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.
100-
101-
Alternatively you can directly bump the version and create the changelog by doing
102-
103-
```bash
104-
cz bump --changelog
105-
```
78+
See [the template customization section](../customization.md#customizing-the-changelog-template)
10679

107-
### `file-name`
80+
### `--file-name`
10881

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

11184
Specify the name of the output file, remember that changelog only works with Markdown.
11285

11386
```bash
11487
cz changelog --file-name="CHANGES.md"
11588
```
11689

117-
### `incremental`
90+
### `--incremental`
11891

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

12194
Benefits:
12295

@@ -134,9 +107,9 @@ cz changelog --incremental
134107
changelog_incremental = true
135108
```
136109

137-
### `start-rev`
110+
### `--start-rev`
138111

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

141114
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.
142115

@@ -150,9 +123,9 @@ cz changelog --start-rev="v0.2.0"
150123
changelog_start_rev = "v0.2.0"
151124
```
152125

153-
### merge-prerelease
126+
### `--merge-prerelease`
154127

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

157130
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.
158131

@@ -166,20 +139,40 @@ cz changelog --merge-prerelease
166139
changelog_merge_prerelease = true
167140
```
168141

169-
### `template`
142+
### `--template`
170143

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

174-
### `extras`
147+
### `--unreleased-version`
175148

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

178162
```bash
179-
cz changelog --extra key=value -e short="quoted value"
163+
cz changelog --unreleased-version="v1.0.0"
180164
```
181165

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

184177
## Hooks
185178

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)