Improving http://dlang.org/library/index.html

Mathias LANG via Digitalmars-d digitalmars-d at puremagic.com
Sun Jan 11 16:01:57 PST 2015


On Sunday, 11 January 2015 at 20:22:02 UTC, Andrei Alexandrescu 
wrote:
> I'm looking into ways to improve 
> http://dlang.org/library/index.html. Specifically I want to 
> remove (some of) the std.c modules or at least move them below, 
> render the module names in code font, etc.
>
> Again, ddox is rather opaque. Is there a source for that page, 
> or is it hardcoded somewhere? Searching for the title 'API 
> documentation' yields no results.
>
>
> Thanks,
>
> Andrei

Surely what matters most should be at the top, not the C bindings 
:)

So, assuming you know the basics of diet templates (if not: 
http://vibed.org/templates/diet ), you should know that ddox is 
based on a views hierarchy.
You have `layout.dt` at the base of the hierarchy, then 
`ddox.layout.dt`, then, either `ddox.overview.dt` (which is the 
`index.html` we're talking about), `ddox.module.dt`, 
`ddox.docpage.dt`. `ddox.docpage.dt` includes various other 
templates to present a page that'll depend of the kind of symbol. 
Those are the ddox.inc.*.dt pages:
https://github.com/rejectedsoftware/ddox/tree/master/views

The inheritance can be overriden, and so should the includes 
(never tried it though).

TL;DR: Define a `ddox.overview.dt` in the `views` folder 
(original source: 
https://github.com/rejectedsoftware/ddox/blob/master/views/ddox.overview.dt 
). Then, as you see, you can just use D code to generate HTML.


More information about the Digitalmars-d mailing list