|
| 1 | +--- |
| 2 | +id: clojure |
| 3 | +title: Clojure |
| 4 | +sidebar_label: Clojure |
| 5 | +--- |
| 6 | + |
| 7 | +## What |
| 8 | + |
| 9 | +Display the currently active [Clojure](https://clojure.org/) version. |
| 10 | + |
| 11 | +## Sample Configuration |
| 12 | + |
| 13 | +import Config from "@site/src/components/Config.js"; |
| 14 | + |
| 15 | +<Config |
| 16 | + data={{ |
| 17 | + type: "clojure", |
| 18 | + style: "powerline", |
| 19 | + powerline_symbol: "\uE0B0", |
| 20 | + foreground: "#ffffff", |
| 21 | + background: "#9068B0", |
| 22 | + template: " \uE768 {{ .Full }}", |
| 23 | + }} |
| 24 | +/> |
| 25 | + |
| 26 | +## Options |
| 27 | + |
| 28 | +| Name | Type | Default | Description | |
| 29 | +| ---------------------- | :--------: | :-------------------------------------------------------------------------------------------------------------------: | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | |
| 30 | +| `home_enabled` | `boolean` | `false` | display the segment in the HOME folder or not | |
| 31 | +| `fetch_version` | `boolean` | `true` | fetch the clojure version | |
| 32 | +| `cache_duration` | `string` | `none` | the duration for which the version will be cached. The duration is a string in the format `1h2m3s` and is parsed using the [time.ParseDuration] function from the Go standard library. To disable the cache, use `none` | |
| 33 | +| `missing_command_text` | `string` | | text to display when the command is missing | |
| 34 | +| `display_mode` | `string` | `context` | <ul><li>`always`: the segment is always displayed</li><li>`files`: the segment is only displayed when file `extensions` listed are present</li><li>`context`: displays the segment when the environment or files is active</li></ul> | |
| 35 | +| `version_url_template` | `string` | | a go [text/template][go-text-template] [template][templates] that creates the URL of the version info / release notes | |
| 36 | +| `extensions` | `[]string` | `project.clj, deps.edn, build.boot, bb.edn, *.clj, *.cljc, *.cljs` | allows to override the default list of file extensions to validate | |
| 37 | +| `folders` | `[]string` | | allows to override the list of folder names to validate | |
| 38 | +| `tooling` | `[]string` | `clojure`, `lein` | the tooling to use for fetching the version | |
| 39 | + |
| 40 | +## Template ([info][templates]) |
| 41 | + |
| 42 | +:::note default template |
| 43 | + |
| 44 | +```template |
| 45 | +{{ if .Error }}{{ .Error }}{{ else }}{{ .Full }}{{ end }} |
| 46 | +``` |
| 47 | + |
| 48 | +::: |
| 49 | + |
| 50 | +### Properties |
| 51 | + |
| 52 | +| Name | Type | Description | |
| 53 | +| -------- | -------- | -------------------------------------------------- | |
| 54 | +| `.Full` | `string` | the full version | |
| 55 | +| `.Major` | `string` | major number | |
| 56 | +| `.Minor` | `string` | minor number | |
| 57 | +| `.Patch` | `string` | patch number | |
| 58 | +| `.Error` | `string` | error encountered when fetching the version string | |
| 59 | + |
| 60 | +[go-text-template]: https://golang.org/pkg/text/template/ |
| 61 | +[templates]: configuration/templates.mdx |
| 62 | +[time.ParseDuration]: https://golang.org/pkg/time/#ParseDuration |
0 commit comments