How to link to a function when documenting the code.

308 views
Skip to first unread message

Nguyên Nguyễn Văn Cao

unread,
May 4, 2013, 6:43:00 AM5/4/13
to golan...@googlegroups.com
I mean a click able link on the comment. For example, the comment for Foo function:
Foo do something that similar with Bar.

How can I make "Bar" click able? I don't think we can use HTML in the comment, so an change to make it auto-link just like what we does with the agrs list?

Christoph Hack

unread,
May 4, 2013, 7:26:12 AM5/4/13
to golan...@googlegroups.com
The godoc tool currently does not support any kind of markup. Writing good documentation is already difficult enough without custom markup languages.

Hotei

unread,
May 4, 2013, 9:45:55 AM5/4/13
to golan...@googlegroups.com
You can create an example for any function.  Don't know if that's sufficient for your issue but it's relatively easy and ends up in the godoc output without cluttering your main code.

Andrew Gerrand

unread,
May 5, 2013, 3:58:43 PM5/5/13
to Nguyên Nguyễn Văn Cao, golang-nuts
Here's a feature request (by me) for turning names like "package foo" in documentation to links to "/pkg/foo/", should it exist.


The same could be done for "function Bar", "method Bar.Quux", "type Boing", etc.

Andrew

Nguyên Nguyễn Văn Cao

unread,
May 8, 2013, 10:20:49 PM5/8/13
to golan...@googlegroups.com, Nguyên Nguyễn Văn Cao
How do you think about link them to godoc.org?

Vào 02:58:43 UTC+7 Thứ hai, ngày 06 tháng năm năm 2013, Andrew Gerrand đã viết:
Reply all
Reply to author
Forward
0 new messages