2022-03-11 06:28:25 -08:00
|
|
|
---
|
|
|
|
id: project
|
|
|
|
title: Project
|
|
|
|
sidebar_label: Project
|
|
|
|
---
|
|
|
|
|
|
|
|
## What
|
|
|
|
|
|
|
|
Display the current version of your project defined in the package file.
|
|
|
|
|
|
|
|
Supports:
|
|
|
|
|
|
|
|
- Node.js project (`package.json`)
|
2022-04-01 02:54:33 -07:00
|
|
|
- Cargo project (`Cargo.toml`)
|
|
|
|
- Poetry project (`pyproject.toml`)
|
2022-04-04 10:01:55 -07:00
|
|
|
- PHP project (`composer.json`)
|
2022-04-16 10:56:03 -07:00
|
|
|
- Any nuspec based project (`*.nuspec`, first file match info is displayed)
|
2022-10-26 05:15:03 -07:00
|
|
|
- .NET project (`*.csproj`, `*.vbproj` or `*.fsproj`, first file match info is displayed)
|
2022-12-18 05:55:57 -08:00
|
|
|
- Julia project (`JuliaProject.toml`, `Project.toml`)
|
2022-03-11 06:28:25 -08:00
|
|
|
|
|
|
|
## Sample Configuration
|
|
|
|
|
2023-03-31 11:55:36 -07:00
|
|
|
import Config from '@site/src/components/Config.js';
|
|
|
|
|
|
|
|
<Config data={{
|
2022-03-11 06:28:25 -08:00
|
|
|
"type": "project",
|
|
|
|
"style": "powerline",
|
|
|
|
"powerline_symbol": "\uE0B0",
|
|
|
|
"foreground": "#193549",
|
|
|
|
"background": "#ffeb3b",
|
2022-04-01 02:54:33 -07:00
|
|
|
"template": " {{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }} "
|
2023-03-31 11:55:36 -07:00
|
|
|
}}/>
|
|
|
|
|
|
|
|
## Properties
|
|
|
|
|
|
|
|
| Name | Type | Description |
|
|
|
|
| ---------------- | --------- | --------------------------------------------- |
|
|
|
|
| `always_enabled` | `boolean` | always show the segment - defaults to `false` |
|
2022-03-11 06:28:25 -08:00
|
|
|
|
|
|
|
## Template ([info][templates])
|
|
|
|
|
|
|
|
:::note default template
|
|
|
|
|
2022-09-16 07:32:48 -07:00
|
|
|
```template
|
2022-04-04 10:01:55 -07:00
|
|
|
{{ if .Error }}{{ .Error }}{{ else }}{{ if .Version }}\uf487 {{.Version}}{{ end }} {{ if .Name }}{{ .Name }}{{ end }}{{ end }}
|
2022-03-11 06:28:25 -08:00
|
|
|
```
|
|
|
|
|
|
|
|
:::
|
|
|
|
|
|
|
|
### Properties
|
|
|
|
|
2022-12-27 05:49:46 -08:00
|
|
|
| Name | Type | Description |
|
|
|
|
| ---------- | -------- | ------------------------------------------------------------------------------------- |
|
|
|
|
| `.Type` | `string` | The type of project (`node`, `cargo`, `poetry`, `php`, `nuspec`, `dotnet` or `julia`) |
|
|
|
|
| `.Version` | `string` | The version of your project |
|
|
|
|
| `.Target` | `string` | The target framwork/language version of your project |
|
|
|
|
| `.Name` | `string` | The name of your project |
|
|
|
|
| `.Error` | `string` | The error context when we can't fetch the project info |
|
2022-03-11 06:28:25 -08:00
|
|
|
|
2022-04-20 09:43:59 -07:00
|
|
|
[templates]: /docs/configuration/templates
|