ddoc should generate hyperlinks to source code

timotheecour timothee.cour2 at gmail.com
Wed Mar 13 00:14:37 PDT 2013


when I click on source next to abs, it goes to 
"http://www.haskell.org/ghc/docs/latest/html/libraries/base/src/GHC-Num.html#abs"
which is not a very precise location, and it's not clear the doc 
is in sync with code shown


> In order to link to the local file system, the distribution 
> needs to contain HTML-rendered source code.

how about this:
in the doc: (http://dlang.org/phobos/std_path.html)
pure @trusted inout(C)[] baseName(C)(inout(C)[] path);

baseName will be hyperlinked to:
https://github.com/D-Programming-Language/phobos/blob/2.062/std/path.d#L274

which points exactly to write place in source code (no need for 
custom '#abs'-like tag as in haskell docs above), AND guarantees 
docs in sync with source (since we have correct tag in github). 
The line info can be obtained in ddoc generation tool.

A command line flag to dmd would specify the base (github url or 
ddoc generated html files on user's file system). The makefile 
would in turn call that dmd flag.

> I think including .html versions of all Phobos source code is 
> not worth it for the links alone.

not necessary, thanks to github already giving us this for free, 
see above.

> such as the LXR project: See e.g. 
> http://lxr.linux.no/#linux+v3.8.2/kernel/acct.c

sure, but starting at least with all function names and defined 
types should be a first priority; those can be obtained from json.


More information about the Digitalmars-d mailing list