10000 docs(readme): add code snippet for the optional `shouldForce` argument · savioxavier/termlink@c7cb4a2 · GitHub
[go: up one dir, main page]

Skip to content

Commit c7cb4a2

Browse files
committed
docs(readme): add code snippet for the optional shouldForce argument
1 parent 4d4fc6e commit c7cb4a2

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,15 @@ go run examples/start.go
125125
- With formatting: `green bold`, `red bgGreen italic`, `italic blue bgGreen`, etc.
126126
- The `shouldForce` is an optional boolean parameter which allows you to force the above unsupported terminal hyperlinks format `text (url)` to be printed, even in supported terminals
127127

128+
> `shouldForce` can be used in the following manner:
129+
>
130+
> ```go
131+
> termlink.Link(text, url, true)
132+
> termlink.ColorLink(text, url, color, true)
133+
> ```
134+
>
135+
> You don't always need to specify this argument. By default, this parameter is `false`
136+
128137
- **`termlink.SupportsHyperlinks()`**:
129138
130139
- Returns `true` if the terminal supports hyperlinks, `false` otherwise.

0 commit comments

Comments
 (0)
0