Sub-sections

5 views
Skip to first unread message

Mike Rumble

unread,
Aug 24, 2009, 6:01:08 PM8/24/09
to PDoc
Hello.

I'm in the thick of commenting my code PDoc-style and wondered if it's
possible to create sub-sections, or have namespaces display their
classes?

Currently I have a structure in my code which looks something like
this...

var myObj = {};
myObj.mySection = {}; // This is what I'm using as my 'section'

myObj.mySection.myNameSpace = {}; // This is what I'm using as my
namespace

myObj.mySection.myNameSpace.myClass = Class.create... // This is one
of my classes.

This creates a documentation page for 'myObj.mySection', which lists
'myObj.mySection.myNameSpaces' in the namespaces section at the top of
the page, followed by 'myObj.mySection.myNamespace.myClass' in the
classes section of the page.

Is there any way to shift the class documentation to appear on the
namespaces page, or just generally improve the structure?

Tobie Langel

unread,
Aug 25, 2009, 4:29:23 AM8/25/09
to pd...@googlegroups.com
Hi, Mike.

Great to know you're giving PDoc a spin.

I thought that was the default behaviour.

The overall structure permits that easily, so it's only a matter of
modifying the templates to account for that.

I'd like to update the templates to what we're currently using in Prototype.

Ideally, I'd like to make those easily brandable in the future (via a
YAML config file). If you're so inclined...

Hope this helps,

Best,

Tobie

Mike Rumble

unread,
Sep 2, 2009, 4:30:10 PM9/2/09
to PDoc
Hi Tobie,

I'd be up for having at coming up with some alternative/configurable
templates.

I've started having a play with this and have two questions...

1. Is there any way to preview the templates dynamically for testing
purposes without having to parse the code and generate the static HTML
templates everytime?
2. Is there anyway to 'explore' the objects PDoc generates in IRB?

Thanks,
Mike

Tobie Langel

unread,
Sep 6, 2009, 6:18:21 PM9/6/09
to pd...@googlegroups.com
Hi, Mike.

> I'd be up for having at coming up with some alternative/configurable
> templates.

I'm in the process of rewriting some myself. Maybe we should join forces.

> 1. Is there any way to preview the templates dynamically for testing
> purposes without having to parse the code and generate the static HTML
> templates everytime?

That's probably doable as the system is fairly decoupled, but there's
nothing set up at the moment.

> 2. Is there anyway to 'explore' the objects PDoc generates in IRB?

No. But you can look at the source code here:
http://github.com/tobie/pdoc/blob/master/lib/pdoc/parser/documentation_nodes.rb

The inheritance scheme is pretty basic so you should find your way
around pretty easily.

Best,

Tobie

Reply all
Reply to author
Forward
0 new messages