Closed Bug 773304 Opened 12 years ago Closed 12 years ago

KumaScript: Add page.subpages() to get a list of sub pages of a page

Categories

(developer.mozilla.org Graveyard :: Editing, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 810019

People

(Reporter: fs, Unassigned)

References

Details

(Whiteboard: u=user c=Editing)

In some docs we want to be able to get a list of all sub pages of a page. (e.g. to build our own TOC for a set of docs). In Deki there is an API (page.subpages) for that, I think we don't have it in KumaScript yet.

Template:
https://developer-new.mozilla.org/en-US/docs/Template:ListSubpages

For example, we want to list all project sub pages here: 
https://developer-new.mozilla.org/en-US/docs/Project:en

Not a launch priority at all, imo.
Marking this as DUPE of bug 775527 since we got more thoughts over there already.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → DUPLICATE
This is actually not quite a dupe; this gets a tree of subpages as JSON or other data structure you can manipulate in code; wiki.tree() just dumps a <ul> block of text of the pages as links.
Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Priority: -- → P2
Blocks: 777490
Hmm, I think we're confused... if this isn't a dupe of bug 775527, it is at least dependent upon it.
Depends on: 775527
These are not the same things. One returns a data structure you can parse that contains a list of the subpages; on MindTouch, this was a tree implemented using a Map, IIRC. That's what the page.subpages() method does on MindTouch.

Wiki.tree(), on the other hand, simply returns an HTML <ol> block containing a nested list of all the subpages as links, for embedding into pages. This lets us very easily create quick and dirty temporary landing pages, for example, by simply saying {{wiki.tree()}} to get a list of all subpages of the current page, or {{wiki.tree("some/page/path", depth)}} or whatever.

You should compare these two in the MindTouch docs.
Blocks: 784780
Version: Kuma → unspecified
Component: Docs Platform → Editing
Whiteboard: s=2012-10-30
Whiteboard: s=2012-10-30 → s=2012-10-30 p=
Whiteboard: s=2012-10-30 p= → s=2012-10-30 u=user
Removing the s= tag to work around Scrumbugs issue 99:

https://github.com/mozilla/scrumbugz/issues/99
Whiteboard: s=2012-10-30 u=user → u=user
Whiteboard: u=user → u=user c=Editing
Priority: P2 → P1
Doing a little bug reorganization here. This bug is superseded by bug 810019, which we are working on now.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → DUPLICATE
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.