Closed mewmew closed 7 years ago
Interesting, I know the docs for KyleBanks/depth render correctly, must be different formatting. I can take a look at this over the weekend.
Thanks. As visible from the screenshots, the example is taken from
So it turns out that in order to be considered a valid markdown code block it needs to be prefixed with either a tab or four spaces, but GoDoc seems to allow three spaces like you have. I'm going to relax the rules so it works the same way GoDoc does.
Before you relax it, could you clarify why the comments are interpreted as having 3 spaces? From what I can tell, they seem to have four spaces between //
and *
?
// *ir.InstAdd (https://godoc.org/github.com/llir/llvm/ir#InstAdd)
Sorry that wasn't very clear, when go tools parse source comments they strip the first space of all lines (not just examples), leaving only three indented spaces in this case, and zero spaces in a normal comment like so:
// comment
Perhaps this is why GoDoc still converts it to a code block in HTML, it's probably doing the same thing I plan to in treating three spaces as four.
I see, thanks for the explanation. I know a lot of the Go standard lib uses tabs rather than spaces to indicate code blocks.
I would too, only in my editor using tabs (with tab size 3) makes code blocks almost indistinguishable from regular comments, as both //<space>
and //<tab>
are rendered as //
. I.e. the tab is 1 character in length, since the tab size is set to 3.
Without this issue, I would have used tabs for code blocks long ago.
No worries, it's a good find - the fix is in now.
From godoc.org
From goggles:
Note the different representations for the list of instructions.
godoc:
goggles:
ir.InstAdd ir.InstFAdd