Add "Go To Source" for Docs?

Jacob via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 10 03:10:48 PDT 2016


On Sunday, 9 October 2016 at 06:50:00 UTC, Sönke Ludwig wrote:
> Am 08.10.2016 um 23:49 schrieb Jacob:
>> Well a lot of the times I'm browsing the phobos library 
>> documentation I
>> want to go to the source code, but there's no easy way to go 
>> there
>> directly from the docs. Some modules have a link to the source 
>> file but
>> I think that's done manually as many of them don't. I think 
>> it'd be
>> beneficial to have a way to tell the doc generator to include 
>> a "go to
>> source" button at each doc entry of function/type. With the 
>> option to
>> set a github repo or other link as the destination of the 
>> link, it
>> should also include the line number when outputting the docs. 
>> Might be a
>> bit specific for github there though, as setting the line 
>> number just
>> involves adding a number to the end of the link. Whereas being 
>> able to
>> set a local file as a link might be desired as well. But I 
>> don't think
>> you can tell the OS to open the file at a certain line with 
>> just a file
>> uri.
>
> The documentation under http://dlang.org/library/ has such a 
> link at the top of each page. See for example 
> http://dlang.org/library/std/algorithm/comparison/either.html

Is that generated using something else? Adding a similar feature 
to the other docs would do it then. Right now they lack any sort 
of link to source.

http://dlang.org/phobos/std_range.html#zip

For example, has no links anywhere to the source code except for 
the one link at the top, and that's just to the module. It 
doesn't specify the line that the function is defined at.


More information about the Digitalmars-d mailing list