Skip to content

Commit a9295d7

Browse files
committed
Adjust indent depth by StartDepth
1 parent 976cfb3 commit a9295d7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ghdoc.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,8 @@ func (doc *GHDoc) GrabToc() *GHToc {
167167
}
168168

169169
func (doc *GHDoc) tocEntry(indent string, hdr Header) string {
170-
// TODO(chuck): Calculate the repeat count with the doc.StartDepth
171-
return strings.Repeat(indent, int(hdr.Depth)) + "* " +
170+
indentDepth := int(hdr.Depth) - doc.StartDepth
171+
return strings.Repeat(indent, indentDepth) + "* " +
172172
"[" + doc.tocName(hdr.Name) + "]" +
173173
"(" + doc.tocLink(hdr.Href) + ")"
174174
}

0 commit comments

Comments
 (0)