Closed Bug 782186 Opened 12 years ago Closed 10 years ago

activeWindow is not showing up in windows documentation's table of contents

Categories

(Add-on SDK Graveyard :: Documentation, enhancement, P2)

enhancement

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: evold, Unassigned)

References

Details

Attachments

(1 file)

      No description provided.
Attachment #651278 - Flags: review?(wbamberg)
Comment on attachment 651278 [details]
Pointer to Github pull request: https://github.com/mozilla/addon-sdk/pull/523

This patch closes the definition of the module-level "browserWindows" property before the definition of the "activeWindow" property, which will suggest that "activeWindow" is also a module-level property. That is, that it's accessed like this:

    console.log(require("windows").activeWindow.title);
 
But "activeWindow" is a property of "browserWindows", so it's accessed like this:

    console.log(require("windows").browserWindows.activeWindow.title);

That's the reason that the definition for "activeWindow" is nested inside that of "browserWindows" (the closing tag is actually at line 74). So the tagging here is correct.

The reason it doesn't show up in the ToC is that browserWindows is described as a property, not a class, and the code that generates HTML from these things will add header tags for subcomponents of "class" objects (https://github.com/mozilla/addon-sdk/blob/master/python-lib/cuddlefish/docs/apirenderer.py#L122) but not for subcomponents of "property" objects (https://github.com/mozilla/addon-sdk/blob/master/python-lib/cuddlefish/docs/apirenderer.py#L195). If you add those "h5" and "h6" arguments to Property's code, then the browserWindows's subcomponents will show up in the ToC (and I can't think of any reason not to do this).

There's another problem with this file, which is that "Examples" shows up in the ToC, when the ToC is really only intended to be an index of objects in this module. The code that builds the ToC (https://github.com/mozilla/addon-sdk/blob/master/doc/static-files/js/main.js#L57) should be clever enough to differentiate API-ref headings and plain headings.
Attachment #651278 - Flags: review?(wbamberg) → review-
(In reply to Will Bamberg [:wbamberg] from comment #2)
> But "activeWindow" is a property of "browserWindows"

ahh right, I forgot about that detail..

> The reason it doesn't show up in the ToC is that browserWindows is described
> as a property, not a class, and the code that generates HTML from these
> things will add header tags for subcomponents of "class" objects
> (https://github.com/mozilla/addon-sdk/blob/master/python-lib/cuddlefish/docs/
> apirenderer.py#L122) but not for subcomponents of "property" objects
> (https://github.com/mozilla/addon-sdk/blob/master/python-lib/cuddlefish/docs/
> apirenderer.py#L195). If you add those "h5" and "h6" arguments to Property's
> code, then the browserWindows's subcomponents will show up in the ToC (and I
> can't think of any reason not to do this).

I'll try to make this change then.

> There's another problem with this file, which is that "Examples" shows up in
> the ToC, when the ToC is really only intended to be an index of objects in
> this module. The code that builds the ToC
> (https://github.com/mozilla/addon-sdk/blob/master/doc/static-files/js/main.
> js#L57) should be clever enough to differentiate API-ref headings and plain
> headings.

Yeah I noticed that too, let's make it a separate bug tho.
Assignee: nobody → evold
Severity: normal → enhancement
Assignee: evold → nobody
I think this isn't applicable any more now we are on MDN.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: