mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-29 04:49:39 -08:00
docs: adjust contributing-segment.md
This commit is contained in:
parent
1b27ad7a5f
commit
b512b1d487
|
@ -12,7 +12,7 @@ Ensure `New` is a single verb indicating the context the segment renders.
|
||||||
You can use the following template as a guide.
|
You can use the following template as a guide.
|
||||||
|
|
||||||
```go
|
```go
|
||||||
package main
|
package segments
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"oh-my-posh/environment"
|
"oh-my-posh/environment"
|
||||||
|
@ -32,7 +32,7 @@ const (
|
||||||
)
|
)
|
||||||
|
|
||||||
func (n *new) Enabled() bool {
|
func (n *new) Enabled() bool {
|
||||||
true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
func (n *new) Template() string {
|
func (n *new) Template() string {
|
||||||
|
@ -42,6 +42,8 @@ func (n *new) Template() string {
|
||||||
func (n *new) Init(props properties.Properties, env environment.Environment) {
|
func (n *new) Init(props properties.Properties, env environment.Environment) {
|
||||||
n.props = props
|
n.props = props
|
||||||
n.env = env
|
n.env = env
|
||||||
|
|
||||||
|
n.Text = props.GetString(NewProp, "Hello")
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -146,7 +148,7 @@ At `$.definitions.segment.allOf`, add your segment details:
|
||||||
"properties": {
|
"properties": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"nwprop": {
|
"newprop": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"title": "New Property",
|
"title": "New Property",
|
||||||
"description": "the default text to display",
|
"description": "the default text to display",
|
||||||
|
|
Loading…
Reference in a new issue