diff --git a/src/properties/properties.go b/src/properties/properties.go index 89bcc522..3f9f601d 100644 --- a/src/properties/properties.go +++ b/src/properties/properties.go @@ -21,21 +21,21 @@ type Property string // general Properties used across Segments const ( - // Style indicates with style to use + // Style indicates the style to use Style Property = "style" - // IncludeFolders folders to be included for the segment logic + // IncludeFolders indicates folders to be included for the segment logic IncludeFolders Property = "include_folders" - // ExcludeFolders folders to be excluded for the segment logic + // ExcludeFolders indicates folders to be excluded for the segment logic ExcludeFolders Property = "exclude_folders" - // IgnoreFolders duplicate of ExcludeFolders + // IgnoreFolders is a duplicate of ExcludeFolders IgnoreFolders Property = "ignore_folders" - // FetchVersion fetch the version number or not + // FetchVersion decides whether to fetch the version number or not FetchVersion Property = "fetch_version" // AlwaysEnabled decides whether or not to always display the info AlwaysEnabled Property = "always_enabled" // VersionURLTemplate is the template to use when building language segment hyperlink VersionURLTemplate Property = "version_url_template" - // DisplayError to display when an error occurs or not + // DisplayError decides whether to display when an error occurs or not DisplayError Property = "display_error" // DisplayDefault hides or shows the default DisplayDefault Property = "display_default" diff --git a/src/segments/language_test.go b/src/segments/language_test.go index c77881c6..253b6fcf 100644 --- a/src/segments/language_test.go +++ b/src/segments/language_test.go @@ -318,10 +318,7 @@ func TestLanguageEnabledMissingCommandCustomText(t *testing.T) { } func TestLanguageEnabledMissingCommandCustomTextHideError(t *testing.T) { - props := properties.Map{ - MissingCommandText: "missing", - properties.DisplayError: false, - } + props := properties.Map{MissingCommandText: "missing"} args := &languageArgs{ commands: []*cmd{}, extensions: []string{uni, corn}, diff --git a/website/docs/segments/angular.md b/website/docs/segments/angular.md index e91aa92b..fec4b35f 100644 --- a/website/docs/segments/angular.md +++ b/website/docs/segments/angular.md @@ -23,10 +23,13 @@ Display the currently active [Angular CLI][angular-cli-docs] version. ## Properties +- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `ng` - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `angular.json` file is present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -47,5 +50,6 @@ Display the currently active [Angular CLI][angular-cli-docs] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [angular-cli-docs]: https://angular.io/cli diff --git a/website/docs/segments/azfunc.md b/website/docs/segments/azfunc.md index b37e8a1f..7dac1aa3 100644 --- a/website/docs/segments/azfunc.md +++ b/website/docs/segments/azfunc.md @@ -27,8 +27,8 @@ Display the currently active [Azure Functions CLI][az-func-core-tools] version. ## Properties +- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - fetch the Azure Functions CLI version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed diff --git a/website/docs/segments/cds.md b/website/docs/segments/cds.md index d00a419b..9ed49f85 100644 --- a/website/docs/segments/cds.md +++ b/website/docs/segments/cds.md @@ -24,7 +24,7 @@ Display the active [CDS CLI][sap-cap-cds] version. ## Properties - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` +- fetch_version: `boolean` - fetch the CDS version - defaults to `true` - missing_command_text: `string` - text to display when the cds command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed @@ -42,7 +42,7 @@ Display the active [CDS CLI][sap-cap-cds] version. ::: -## Template Properties +### Properties - `.Full`: `string` - the full version - `.Major`: `string` - major number diff --git a/website/docs/segments/cf.md b/website/docs/segments/cf.md index f8375230..6a893482 100644 --- a/website/docs/segments/cf.md +++ b/website/docs/segments/cf.md @@ -25,11 +25,12 @@ Display the active [Cloud Foundry CLI][cloud-foundry] version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the Cloud Foundry CLI version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the java command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is displayed when `manifest.yml` or `mta.yaml` file is present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -41,7 +42,7 @@ Display the active [Cloud Foundry CLI][cloud-foundry] version. ::: -## Template Properties +### Properties - `.Full`: `string` - the full version - `.Major`: `string` - major number @@ -50,5 +51,6 @@ Display the active [Cloud Foundry CLI][cloud-foundry] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [cloud-foundry]: https://github.com/cloudfoundry/cli diff --git a/website/docs/segments/cftarget.md b/website/docs/segments/cftarget.md index 4c1b7064..ea1aad20 100644 --- a/website/docs/segments/cftarget.md +++ b/website/docs/segments/cftarget.md @@ -31,7 +31,7 @@ Display the details of the logged [Cloud Foundry endpoint][cf-target] (`cf targe ::: -## Template Properties +### Properties - `.Org`: `string` - Cloud Foundry organization - `.Space`: `string` - Cloud Foundry space diff --git a/website/docs/segments/crystal.md b/website/docs/segments/crystal.md index d41d1829..cdf39914 100644 --- a/website/docs/segments/crystal.md +++ b/website/docs/segments/crystal.md @@ -25,11 +25,12 @@ Display the currently active crystal version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - fetch the julia version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.cr` or `shard.yml` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -50,4 +51,5 @@ Display the currently active crystal version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/dart.md b/website/docs/segments/dart.md index d4b900c0..7c36ae04 100644 --- a/website/docs/segments/dart.md +++ b/website/docs/segments/dart.md @@ -25,12 +25,13 @@ Display the currently active dart version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - fetch the dart version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is 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` folder are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -51,4 +52,5 @@ folder are present (default) - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/dotnet.md b/website/docs/segments/dotnet.md index 91642c28..d97a9d75 100644 --- a/website/docs/segments/dotnet.md +++ b/website/docs/segments/dotnet.md @@ -26,13 +26,13 @@ Display the currently active [.NET SDK][net-sdk-docs] version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - fetch the active version or not; useful if all you need is an icon indicating `dotnet` is present - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.cs`, `*.vb`, `*.fs`, `*.fsx`, `*.sln`, `*.slnf`, `*.csproj`, `*.vbproj`, or `*.fsproj` files are present (default) -- version_url_template: `string` - A go text/template [template][templates] that creates the changelog URL +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -55,5 +55,6 @@ Display the currently active [.NET SDK][net-sdk-docs] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [net-sdk-docs]: https://docs.microsoft.com/en-us/dotnet/core/tools diff --git a/website/docs/segments/golang.md b/website/docs/segments/golang.md index 511d2725..1841721c 100644 --- a/website/docs/segments/golang.md +++ b/website/docs/segments/golang.md @@ -25,11 +25,12 @@ Display the currently active golang version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the golang version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.go` or `go.mod` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes - parse_mod_file: `boolean`: parse the go.mod file instead of calling `go version` ## Template ([info][templates]) @@ -51,4 +52,5 @@ Display the currently active golang version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/haskell.md b/website/docs/segments/haskell.md index 8b626ad6..9599f54b 100644 --- a/website/docs/segments/haskell.md +++ b/website/docs/segments/haskell.md @@ -25,12 +25,13 @@ Display the currently active Glasgow Haskell Compiler (GHC) version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the GHC version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.hs`, `*.lhs`, `stack.yaml`, `package.yaml`, `*.cabal`, or `cabal.project` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes - stack_ghc_mode: `string` - determines when to use stack ghc to retrieve the version information. Using stack ghc will decrease performance. - `never`: never use stack ghc (default) @@ -57,4 +58,5 @@ Using stack ghc will decrease performance. - `.Error`: `string` - error encountered when fetching the version string - `.StackGhc`: `boolean` - `true` if stack ghc was used, otherwise `false` +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/java.md b/website/docs/segments/java.md index d4f9fdbe..9d00df6b 100644 --- a/website/docs/segments/java.md +++ b/website/docs/segments/java.md @@ -25,7 +25,6 @@ Display the currently active java version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the java version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the java command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed diff --git a/website/docs/segments/julia.md b/website/docs/segments/julia.md index d1ae6941..0cfe1b0a 100644 --- a/website/docs/segments/julia.md +++ b/website/docs/segments/julia.md @@ -25,11 +25,12 @@ Display the currently active julia version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the julia version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.jl` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -50,4 +51,5 @@ Display the currently active julia version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/kotlin.md b/website/docs/segments/kotlin.md index 860db63c..f3a10592 100644 --- a/website/docs/segments/kotlin.md +++ b/website/docs/segments/kotlin.md @@ -25,11 +25,12 @@ Display the currently active [Kotlin][kotlin] version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the kotlin version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.kt`, `*.kts` and `*.ktm` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -50,5 +51,6 @@ Display the currently active [Kotlin][kotlin] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [kotlin]: https://kotlinlang.org/ diff --git a/website/docs/segments/node.md b/website/docs/segments/node.md index e232b031..759deb80 100644 --- a/website/docs/segments/node.md +++ b/website/docs/segments/node.md @@ -24,11 +24,14 @@ Display the currently active [Node.js][node-js] version. ## Properties - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` +- fetch_version: `boolean` - display the Node.js version - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: The segment is always displayed - `files`: The segment is only displayed when `*.js`, `*.ts`, `package.json`, `.nvmrc`, `pnpm-workspace.yaml`, `.pnpmfile.cjs`, `.npmrc` or `.vue` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes - fetch_package_manager: `boolean` - define if the current project uses Yarn or NPM - defaults to `false` - 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` @@ -54,5 +57,6 @@ Display the currently active [Node.js][node-js] version. - `.PackageManagerIcon`: `string` - the Yarn on NPM icon when setting `fetch_package_manager` to `true` - `.Mismatch`: `boolean` - if the version in `.nvmrc` matches with `.Full` +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [node-js]: https://nodejs.org diff --git a/website/docs/segments/npm.md b/website/docs/segments/npm.md index a4a1fa49..22ed3170 100644 --- a/website/docs/segments/npm.md +++ b/website/docs/segments/npm.md @@ -1,6 +1,6 @@ --- id: npm -title: npm +title: NPM sidebar_label: NPM --- @@ -21,6 +21,17 @@ Display the currently active [npm][npm-docs] version. } ``` +## Properties + +- home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` +- missing_command_text: `string` - text to display when the command is missing - defaults to empty +- fetch_version: `boolean` - fetch the NPM version - defaults to `true` +- display_mode: `string` - determines when the segment is displayed + - `always`: the segment is always displayed + - `files`: the segment is only displayed when `package.json` or `package-lock.json` file are present +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes + ## Template ([info][templates]) :::note default template @@ -40,5 +51,6 @@ Display the currently active [npm][npm-docs] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [npm-docs]: https://docs.npmjs.com/about-npm diff --git a/website/docs/segments/os.md b/website/docs/segments/os.md index 3b75f37e..3fced0c8 100644 --- a/website/docs/segments/os.md +++ b/website/docs/segments/os.md @@ -1,6 +1,6 @@ --- id: os -title: os +title: OS sidebar_label: OS --- diff --git a/website/docs/segments/php.md b/website/docs/segments/php.md index 4b202e63..5d72036e 100644 --- a/website/docs/segments/php.md +++ b/website/docs/segments/php.md @@ -1,6 +1,6 @@ --- id: php -title: php +title: PHP sidebar_label: PHP --- @@ -25,12 +25,13 @@ Display the currently active php version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the php version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.php`, `composer.json`, `composer.lock`, `.php-version` or `blade.php` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -51,4 +52,5 @@ files are present (default) - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/python.md b/website/docs/segments/python.md index 6a3c8369..883f817e 100644 --- a/website/docs/segments/python.md +++ b/website/docs/segments/python.md @@ -29,7 +29,6 @@ Supports conda, virtualenv and pyenv (if python points to pyenv shim). - display_default: `boolean` - show the name of the virtualenv when it's default (`system`, `base`) or not - defaults to `true` - fetch_version: `boolean` - fetch the python version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed @@ -37,6 +36,8 @@ or not - defaults to `true` files are present - `environment`: the segment is only displayed when a virtual env is present (default) - `context`: the segment is only displayed when either `environment` or `files` is active +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -58,4 +59,5 @@ or not - defaults to `true` - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates diff --git a/website/docs/segments/r.md b/website/docs/segments/r.md index a736cfcb..0c370176 100644 --- a/website/docs/segments/r.md +++ b/website/docs/segments/r.md @@ -25,12 +25,13 @@ Display the currently active [R][r-homepage] version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the R version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.R`, `*.Rmd`, `*.Rsx`, `*.Rda`, `*.Rd`, `*.Rproj`, or `.Rproj.user` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -51,5 +52,6 @@ Display the currently active [R][r-homepage] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [r-homepage]: https://www.r-project.org/ diff --git a/website/docs/segments/ruby.md b/website/docs/segments/ruby.md index 929240b9..a21e10f1 100644 --- a/website/docs/segments/ruby.md +++ b/website/docs/segments/ruby.md @@ -25,7 +25,6 @@ Display the currently active ruby version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the ruby version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed diff --git a/website/docs/segments/rust.md b/website/docs/segments/rust.md index d1ad43b1..c8b29fe8 100644 --- a/website/docs/segments/rust.md +++ b/website/docs/segments/rust.md @@ -25,7 +25,6 @@ Display the currently active rust version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the rust version (`rustc --version`) - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed diff --git a/website/docs/segments/swift.md b/website/docs/segments/swift.md index 2fcf1311..4698d9ce 100644 --- a/website/docs/segments/swift.md +++ b/website/docs/segments/swift.md @@ -25,11 +25,12 @@ Display the currently active [Swift][swift] version. - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the swift version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*.swift` or `*.SWIFT` files are present (default) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -50,5 +51,6 @@ Display the currently active [Swift][swift] version. - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [swift]: https://www.swift.org/ diff --git a/website/docs/segments/ui5tooling.md b/website/docs/segments/ui5tooling.md index baaa75c5..55d8ba0c 100644 --- a/website/docs/segments/ui5tooling.md +++ b/website/docs/segments/ui5tooling.md @@ -26,13 +26,14 @@ see [the documentation][ui5-version-help]). - home_enabled: `boolean` - display the segment in the HOME folder or not - defaults to `false` - fetch_version: `boolean` - display the UI5 tooling version - defaults to `true` -- display_error: `boolean` - show the error context when failing to retrieve the version information - defaults to `true` - missing_command_text: `string` - text to display when the java command is missing - defaults to empty - display_mode: `string` - determines when the segment is displayed - `always`: the segment is always displayed - `files`: the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder - `context`: (default) the segment is only displayed when `*ui5*.y(a)ml` file is present in the current folder or it has been found in the parent folders (check up to 4 levels) +- version_url_template: `string` - a go [text/template][go-text-template] [template][templates] that creates +the URL of the version info / release notes ## Template ([info][templates]) @@ -44,7 +45,7 @@ see [the documentation][ui5-version-help]). ::: -## Template Properties +### Properties - `.Full`: `string` - the full version - `.Major`: `string` - major number @@ -53,6 +54,7 @@ see [the documentation][ui5-version-help]). - `.URL`: `string` - URL of the version info / release notes - `.Error`: `string` - error encountered when fetching the version string +[go-text-template]: https://golang.org/pkg/text/template/ [templates]: /docs/configuration/templates [ui5-homepage]: https://sap.github.io/ui5-tooling [ui5-version-help]: https://sap.github.io/ui5-tooling/pages/CLI/#ui5-versions