22
33A library for parsing and incrementing arbitrarily-formatted versions.
44
5- Instead of conforming to a specific versioning scheme, this library allows you to define your
6- own version format, parse version strings against it, and increment versions according to
7- semantic and/or calendar rules.
5+ Instead of conforming to a specific versioning scheme, this library allows you
6+ to define your own version format, parse version strings against it, and
7+ increment versions according to semantic and/or calendar rules.
88
99Also comes with a [ CLI] ( #cli ) .
1010
@@ -13,7 +13,8 @@ This an abridged version of the documentation. For the full documentation, see
1313
1414## Example
1515
16- * Below, the text in ` < ` and ` > ` brackets is a specifier. See what they mean [ here] ( #table ) .*
16+ * Below, the text in ` < ` and ` > ` brackets is a specifier. See what they mean
17+ [ here] ( #table ) .*
1718
1819Quickly get a next version:
1920
@@ -32,34 +33,39 @@ assert_eq!(next, "1.3.0");
3233
3334nextver is built around three main concepts: Schemes, formats, and versions.
3435
35- - ** Schemes** dictate the kinds of values allowed in versions and the rules for incrementing
36- them. (See the [ table] ( #table ) below.) They are modeled by the [ ` Scheme ` ] trait and
37- implemented by the the following structs:
36+ - ** Schemes** dictate the kinds of values allowed in versions and the rules for
37+ incrementing them. (See the [ table] ( #table ) below.) They are modeled by the
38+ [ ` Scheme ` ] trait and implemented by the the following structs:
3839
39- - [ ` Sem ` ] : A semantic versioning scheme. It is similar to [ SemVer] ( https://semver.org/ ) .
40+ - [ ` Sem ` ] : A semantic versioning scheme. It is similar to
41+ [ SemVer] ( https://semver.org/ ) .
4042 - [ ` CalSem ` ] : A calendar-semantic versioning scheme. It is similar to
41- [ CalVer] ( https://calver.org/ ) , but with an explicitly-required semantic part(s).
42- - [ ` Cal ` ] : A calendar versioning scheme. Its like [ ` CalSem ` ] but without semantic specifiers.
43- (This scheme is less useful in practice because there is no way to increment a version twice
44- within the same period of its least significant specifier.)
45-
46- - ** Formats** define the structure of a version string. They are modeled by the [ ` Format ` ]
47- struct. They contains a sequence of * specifier* and * literal text* tokens. For example,
48- ` <MAJOR>.<MINOR>.<PATCH> ` is a format string that can be turned into a [ ` Format ` ] object.
49-
50- - ** Versions** are like Formats, but with actual values instead of specifiers. They represent a
51- a point in a project's development. These are modeled by the [ ` Version ` ] struct. They can be
52- incremented to new versions and compared amongst each other.
43+ [ CalVer] ( https://calver.org/ ) , but with an explicitly-required semantic
44+ part(s).
45+ - [ ` Cal ` ] : A calendar versioning scheme. Its like [ ` CalSem ` ] but without
46+ semantic specifiers. (This scheme is less useful in practice because there
47+ is no way to increment a version twice within the same period of its least
48+ significant specifier.)
49+
50+ - ** Formats** define the structure of a version string. They are modeled by the
51+ [ ` Format ` ] struct. They contains a sequence of * specifier* and * literal text*
52+ tokens. For example, ` <MAJOR>.<MINOR>.<PATCH> ` is a format string that can be
53+ turned into a [ ` Format ` ] object.
54+
55+ - ** Versions** are like Formats, but with actual values instead of specifiers.
56+ They represent a a point in a project's development. These are modeled by the
57+ [ ` Version ` ] struct. They can be incremented to new versions and compared
58+ amongst each other.
5359
5460## Format String Syntax
5561
56- Use any sequence of * specifiers* (listed below) and * literal text* in a format string. Specifiers
57- are bracketed with ` < ` and ` > ` .
62+ Use any sequence of * specifiers* (listed below) and * literal text* in a format
63+ string. Specifiers are bracketed with ` < ` and ` > ` .
5864
5965### Table
6066
61- In the "Example" column below, we reference a major of ` 1 ` , minor of ` 2 ` , patch of ` 3 ` and a
62- date of ` 2001-02-03 ` (which is in the 4th week).
67+ In the "Example" column below, we reference a major of ` 1 ` , minor of ` 2 ` , patch
68+ of ` 3 ` and a date of ` 2001-02-03 ` (which is in the 4th week).
6369
6470| Specifier | Example | Sem | CalSem | Cal | Parse Width | Format Width | Description |
6571| ---| ---| ---| ---| ---| ---| ---| ---|
@@ -80,8 +86,8 @@ Specifiers are case-sensitive. For example, `<major>` is not a valid specifier.
8086
8187## CLI
8288
83- This crate provides a CLI that can be used to do some API functions straight from the command
84- line.
89+ This crate provides a CLI that can be used to do some API functions straight
90+ from the command line.
8591
8692### Installation
8793
@@ -99,9 +105,11 @@ nextver --help
99105
100106To:
101107
102- - create a new git tag,
108+ - create and push a new git tag,
103109- create a new GitHub release with binaries attached, and
104- - publish a new version to < https://crates.io > (and update docs on < https://docs.rs > )
110+ - publish a new version to < https://crates.io > (and update docs on
111+ < https://docs.rs > )
105112
106- simply push a commit to the ` master ` branch with an updated version number in ` Cargo.toml ` . The workflow
107- file at ` .github/workflows/release.yml ` will take care of the rest.
113+ simply push a commit to the ` master ` branch with an updated version number in
114+ ` Cargo.toml ` . The workflow file at ` .github/workflows/release+build+publish.yml `
115+ will take care of the rest. Make sure to pull afterwards.
0 commit comments