Skip to content

Commit f4cb691

Browse files
committed
docs
1 parent 4e2bba4 commit f4cb691

File tree

3 files changed

+29
-21
lines changed

3 files changed

+29
-21
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
# xtraplatform-cli
22

3-
Command line tools for [xtraplatform](interactive-instruments/xtraplatform).
3+
Command line tools for [xtraplatform](https://github.com/interactive-instruments/xtraplatform).

xtractl/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ that would otherwise require a restart.
2020

2121
### SEE ALSO
2222

23-
* [xtractl entity](xtractl_entity.md) - Control entities
24-
* [xtractl log](xtractl_log.md) - Control logging
23+
* [xtractl entity](#xtractl-entity) - Control entities
24+
* [xtractl log](#xtractl-log) - Control logging
2525

2626
## xtractl entity
2727

@@ -44,9 +44,9 @@ Control entities
4444

4545
### SEE ALSO
4646

47-
* [xtractl](xtractl.md) -
48-
* [xtractl entity ls](xtractl_entity_ls.md) - List entities
49-
* [xtractl entity reload](xtractl_entity_reload.md) - Reload entity configuration
47+
* [xtractl](#xtractl)
48+
* [xtractl entity ls](#xtractl-entity-ls) - List entities
49+
* [xtractl entity reload](#xtractl-entity-reload) - Reload entity configuration
5050

5151
## xtractl entity ls
5252

@@ -75,7 +75,7 @@ xtractl entity ls [flags]
7575

7676
### SEE ALSO
7777

78-
* [xtractl entity](xtractl_entity.md) - Control entities
78+
* [xtractl entity](#xtractl-entity) - Control entities
7979

8080
## xtractl entity reload
8181

@@ -105,7 +105,7 @@ xtractl entity reload id1,id2
105105

106106
### SEE ALSO
107107

108-
* [xtractl entity](xtractl_entity.md) - Control entities
108+
* [xtractl entity](#xtractl-entity) - Control entities
109109

110110
## xtractl log
111111

@@ -122,10 +122,10 @@ Control logging
122122

123123
### SEE ALSO
124124

125-
* [xtractl](xtractl.md) -
126-
* [xtractl log filter](xtractl_log_filter.md) - Switch the log filters
127-
* [xtractl log level](xtractl_log_level.md) - Change the log level
128-
* [xtractl log status](xtractl_log_status.md) - Show log status
125+
* [xtractl](#xtractl)
126+
* [xtractl log filter](#xtractl-log-filter) - Switch the log filters
127+
* [xtractl log level](#xtractl-log-level) - Change the log level
128+
* [xtractl log status](#xtractl-log-status) - Show log status
129129

130130
## xtractl log filter
131131

@@ -160,7 +160,7 @@ xtractl log filter "*" --disable
160160

161161
### SEE ALSO
162162

163-
* [xtractl log](xtractl_log.md) - Control logging
163+
* [xtractl log](#xtractl-log) - Control logging
164164

165165
## xtractl log level
166166

@@ -188,7 +188,7 @@ xtractl log level DEBUG
188188

189189
### SEE ALSO
190190

191-
* [xtractl log](xtractl_log.md) - Control logging
191+
* [xtractl log](#xtractl-log) - Control logging
192192

193193
## xtractl log status
194194

@@ -216,5 +216,5 @@ xtractl log status [flags]
216216

217217
### SEE ALSO
218218

219-
* [xtractl log](xtractl_log.md) - Control logging
219+
* [xtractl log](#xtractl-log) - Control logging
220220

xtractl/cmd/docs.go

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,13 @@ func generateMarkdown(cmd *cobra.Command, w io.Writer) error {
105105
if cmd.HasParent() {
106106
parent := cmd.Parent()
107107
pname := parent.CommandPath()
108-
link := pname + ".md"
109-
link = strings.Replace(link, " ", "_", -1)
110-
buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", pname, link, parent.Short))
108+
link := "#" + pname
109+
link = strings.Replace(link, " ", "-", -1)
110+
short := ""
111+
if len(parent.Short) > 0 {
112+
short = fmt.Sprintf("\t - %s", parent.Short)
113+
}
114+
buf.WriteString(fmt.Sprintf("* [%s](%s)%s\n", pname, link, short))
111115
cmd.VisitParents(func(c *cobra.Command) {
112116
if c.DisableAutoGenTag {
113117
cmd.DisableAutoGenTag = c.DisableAutoGenTag
@@ -123,9 +127,13 @@ func generateMarkdown(cmd *cobra.Command, w io.Writer) error {
123127
continue
124128
}
125129
cname := name + " " + child.Name()
126-
link := cname + ".md"
127-
link = strings.Replace(link, " ", "_", -1)
128-
buf.WriteString(fmt.Sprintf("* [%s](%s)\t - %s\n", cname, link, child.Short))
130+
link := "#" + cname
131+
link = strings.Replace(link, " ", "-", -1)
132+
short := ""
133+
if len(child.Short) > 0 {
134+
short = fmt.Sprintf("\t - %s", child.Short)
135+
}
136+
buf.WriteString(fmt.Sprintf("* [%s](%s)%s\n", cname, link, short))
129137
}
130138
buf.WriteString("\n")
131139
}

0 commit comments

Comments
 (0)