mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-03-05 20:49:04 -08:00
docs(language): template properties
This commit is contained in:
parent
a24786b97d
commit
3a4e21c36d
|
@ -29,3 +29,17 @@ Display the currently active Angular CLI version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `angular.json` file is present (default)
|
- `files`: the segment is only displayed when `angular.json` file is present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -33,3 +33,17 @@ Display the currently active Azure functions CLI version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when a `host.json` or `local.settings.json` files is present (default)
|
- `files`: the segment is only displayed when a `host.json` or `local.settings.json` files is present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -32,3 +32,17 @@ Display the currently active crystal version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (default)
|
- `files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -33,3 +33,17 @@ Display the currently active dart version.
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool`
|
- `files`: the segment is only displayed when `*.dart`, `pubspec.yaml`, `pubspec.yml`, `pubspec.lock` files or the `.dart_tool`
|
||||||
folder are present (default)
|
folder are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -37,12 +37,13 @@ Display the currently active .NET SDK version.
|
||||||
- unsupported_version_icon: `string` - text/icon that is displayed when the active .NET SDK version (e.g., one specified
|
- unsupported_version_icon: `string` - text/icon that is displayed when the active .NET SDK version (e.g., one specified
|
||||||
by `global.json`) is not installed/supported - defaults to `\uf071` (X in a rectangle box)
|
by `global.json`) is not installed/supported - defaults to `\uf071` (X in a rectangle box)
|
||||||
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
properties below. Defaults does nothing(backward compatibility).
|
properties below. Defaults to `{{ .Full }}`
|
||||||
- version_url_template: `string` - A go [text/template][go-text-template] template extended
|
- version_url_template: `string` - A go [text/template][go-text-template] template extended
|
||||||
with [sprig][sprig] utilizing the properties below. Defaults does nothing(backward compatibility).
|
with [sprig][sprig] utilizing the properties below. Defaults does nothing(backward compatibility).
|
||||||
|
|
||||||
## Template Properties
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
- `.Major`: `string` - is the major version
|
- `.Major`: `string` - is the major version
|
||||||
- `.Minor`: `string` - is the minor version
|
- `.Minor`: `string` - is the minor version
|
||||||
- `.Patch`: `string` - is the patch version
|
- `.Patch`: `string` - is the patch version
|
||||||
|
|
|
@ -32,3 +32,14 @@ Display the currently active golang version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.go` or `go.mod` files are present (default)
|
- `files`: the segment is only displayed when `*.go` or `go.mod` files are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
|
@ -45,3 +45,14 @@ Display the currently active java version.
|
||||||
- `*.jar`
|
- `*.jar`
|
||||||
- `*.clj`
|
- `*.clj`
|
||||||
- `*.cljc`
|
- `*.cljc`
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
|
@ -32,3 +32,17 @@ Display the currently active julia version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.jl` files are present (default)
|
- `files`: the segment is only displayed when `*.jl` files are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -40,3 +40,17 @@ segment's background or foreground color
|
||||||
- display_package_manager: `boolean` - show whether the current project uses Yarn or NPM - defaults to `false`
|
- display_package_manager: `boolean` - show whether the current project uses Yarn or NPM - defaults to `false`
|
||||||
- yarn_icon: `string` - the icon/text to display when using Yarn - defaults to ` \uF61A`
|
- yarn_icon: `string` - the icon/text to display when using Yarn - defaults to ` \uF61A`
|
||||||
- npm_icon: `string` - the icon/text to display when using NPM - defaults to ` \uE71E`
|
- npm_icon: `string` - the icon/text to display when using NPM - defaults to ` \uE71E`
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -34,3 +34,17 @@ Display the currently active php version.
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.php, composer.json, composer.lock, .php-version` files are present (default)
|
- `files`: the segment is only displayed when `*.php, composer.json, composer.lock, .php-version` files are present (default)
|
||||||
- enable_hyperlink: `bool` - display an hyperlink to the php release notes - defaults to `false`
|
- enable_hyperlink: `bool` - display an hyperlink to the php release notes - defaults to `false`
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -39,3 +39,17 @@ or not - defaults to `true`
|
||||||
files are present (default)
|
files are present (default)
|
||||||
- `environment`: the segment is only displayed when a virtual env is present
|
- `environment`: the segment is only displayed when a virtual env is present
|
||||||
- `context`: the segment is only displayed when either `environment` or `files` is active
|
- `context`: the segment is only displayed when either `environment` or `files` is active
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -32,3 +32,17 @@ Display the currently active ruby version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.rb`, `Gemfile` or `Rakefile` files are present (default)
|
- `files`: the segment is only displayed when `*.rb`, `Gemfile` or `Rakefile` files are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -32,3 +32,17 @@ Display the currently active rust version.
|
||||||
- display_mode: `string` - determines when the segment is displayed
|
- display_mode: `string` - determines when the segment is displayed
|
||||||
- `always`: the segment is always displayed
|
- `always`: the segment is always displayed
|
||||||
- `files`: the segment is only displayed when `*.rs`, `Cargo.toml` or `Cargo.lock` files are present (default)
|
- `files`: the segment is only displayed when `*.rs`, `Cargo.toml` or `Cargo.lock` files are present (default)
|
||||||
|
- template: `string` - A go [text/template][go-text-template] template extended with [sprig][sprig] utilizing the
|
||||||
|
properties below. Defaults to `{{ .Full }}`
|
||||||
|
|
||||||
|
## Template Properties
|
||||||
|
|
||||||
|
- `.Full`: `string` - the full version
|
||||||
|
- `.Major`: `string` - is the major version
|
||||||
|
- `.Minor`: `string` - is the minor version
|
||||||
|
- `.Patch`: `string` - is the patch version
|
||||||
|
- `.Prerelease`: `string` - is the prerelease version
|
||||||
|
- `.BuildMetadata`: `string` - is the build metadata
|
||||||
|
|
||||||
|
[go-text-template]: https://golang.org/pkg/text/template/
|
||||||
|
[sprig]: https://masterminds.github.io/sprig/
|
||||||
|
|
|
@ -97,7 +97,7 @@ func (l *language) string() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
segmentTemplate := l.props.getString(SegmentTemplate, "{{.Full}}")
|
segmentTemplate := l.props.getString(SegmentTemplate, "{{ .Full }}")
|
||||||
template := &textTemplate{
|
template := &textTemplate{
|
||||||
Template: segmentTemplate,
|
Template: segmentTemplate,
|
||||||
Context: l.version,
|
Context: l.version,
|
||||||
|
|
Loading…
Reference in a new issue