mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-27 20:09: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.
|
||||
|
||||
```go
|
||||
package main
|
||||
package segments
|
||||
|
||||
import (
|
||||
"oh-my-posh/environment"
|
||||
|
@ -32,7 +32,7 @@ const (
|
|||
)
|
||||
|
||||
func (n *new) Enabled() bool {
|
||||
true
|
||||
return true
|
||||
}
|
||||
|
||||
func (n *new) Template() string {
|
||||
|
@ -42,6 +42,8 @@ func (n *new) Template() string {
|
|||
func (n *new) Init(props properties.Properties, env environment.Environment) {
|
||||
n.props = props
|
||||
n.env = env
|
||||
|
||||
n.Text = props.GetString(NewProp, "Hello")
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -146,7 +148,7 @@ At `$.definitions.segment.allOf`, add your segment details:
|
|||
"properties": {
|
||||
"properties": {
|
||||
"properties": {
|
||||
"nwprop": {
|
||||
"newprop": {
|
||||
"type": "boolean",
|
||||
"title": "New Property",
|
||||
"description": "the default text to display",
|
||||
|
|
Loading…
Reference in a new issue