Skip to content

Commit 117ae6a

Browse files
committed
docs: update doc comments to follow godoc style
1 parent bfc3fcc commit 117ae6a

File tree

1 file changed

+21
-14
lines changed

1 file changed

+21
-14
lines changed

termlink.go

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
// Package termlink implements a set of functions to create customizable, clickable hyperlinks in the terminal.
12
package termlink
23

34
import (
@@ -136,12 +137,14 @@ func supportsColor() bool {
136137
return supportscolor.Stdout().SupportsColor
137138
}
138139

139-
/**
140-
* @info Create a clickable link in the terminal's stdout.
141-
* @param {string} [text] The text to be displayed.
142-
* @param {string} [url] The URL to be opened when the link is clicked.
143-
* @returns {string} The clickable link.
144-
*/
140+
// Function Link creates a clickable link in the terminal's stdout.
141+
//
142+
// The function takes two parameters: text and url.
143+
//
144+
// The text parameter is the text to be displayed.
145+
// The url parameter is the URL to be opened when the link is clicked.
146+
//
147+
// The function returns the clickable link.
145148
func Link(text string, url string) string {
146149
if supportsHyperlinks() {
147150
return "\x1b]8;;" + url + "\x07" + text + "\x1b]8;;\x07" + parseColor("reset")
@@ -150,13 +153,15 @@ func Link(text string, url string) string {
150153
}
151154
}
152155

153-
/**
154-
* @info Create a clickable link in the terminal's stdout.
155-
* @param {string} [text] The text to be displayed.
156-
* @param {string} [url] The URL to be opened when the link is clicked.
157-
* @param {string} [color] The color of the link.
158-
* @returns {string} The clickable link.
159-
*/
156+
// Function LinkColor creates a colored clickable link in the terminal's stdout.
157+
//
158+
// The function takes three parameters: text, url and color.
159+
//
160+
// The text parameter is the text to be displayed.
161+
// The url parameter is the URL to be opened when the link is clicked.
162+
// The color parameter is the color of the link.
163+
//
164+
// The function returns the clickable link.
160165
func ColorLink(text string, url string, color string) string {
161166
var textColor string
162167

@@ -172,7 +177,9 @@ func ColorLink(text string, url string, color string) string {
172177
}
173178
}
174179

175-
// export supportsHyperlinks to be used in testing
180+
// Function SupportsHyperlinks returns true if the terminal supports hyperlinks.
181+
//
182+
// The function returns true if the terminal supports hyperlinks, false otherwise.
176183
func SupportsHyperlinks() bool {
177184
return supportsHyperlinks()
178185
}

0 commit comments

Comments
 (0)