Closed Bug 665715 Opened 13 years ago Closed 12 years ago

Kuma: Show a table of contents on each page, showing H1-H3 headers

Categories

(developer.mozilla.org Graveyard :: Wiki pages, defect, P1)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: openjck, Assigned: groovecoder)

References

Details

(Whiteboard: u=administrator c=wiki p=3 s=2012-04-10 t=2012-04-10)

      No description provided.
Version: unspecified → Kuma
Whiteboard: [u: user] [c: wiki] → [u: administrator] [c: wiki]
Assignee: lcrouch → nobody
Target Milestone: 1.0 alpha → ---
Target Milestone: --- → 0.9.9
Whiteboard: [u: administrator] [c: wiki] → u=administrator c=wiki p=
Automatically-generated Table of Contents.

This needs the template system.
Target Milestone: 0.9.9 → ---
Blocks: 665212
Priority: -- → P1
Depends on: 710713
Target Milestone: --- → 2.6
11:40:53 - sheppy: groovecoder: It's automatic. There's a preference to say how many levels deep to make the TOC, and we have it set to only go two deep.
11:41:09 - groovecoder: sheppy: okay
11:41:09 - sheppy: And it pulls them from the Hx blocks.
I'd suggest we try the HTML5 Outline algorithm to construct a ToC:

https://developer.mozilla.org/en/Sections_and_Outlines_of_an_HTML5_document#The_HTML5_Outline_Algorithm

http://dev.w3.org/html5/spec/headings-and-sections.html#outlines

We already use something like it, to identify the sections for section editing.
And, this doesn't necessarily need the templating system. But, it should build the ToC from the source resulting *after* macro evaluation so that any sections or headers introduced by templates are included
Ideally, there would be some way to tell the wiki not to generate a TOC on a particular page; for example, landing pages don't usually need one, since they're small, and the TOC clutters them up.
Checkbox for No TOC, generate TOC markup server-side w/ HTML5 outline algorithm.

Highest-level header might actually be H2 or something.
Whiteboard: u=administrator c=wiki p= → u=administrator c=wiki p=3
Whiteboard: u=administrator c=wiki p=3 → u=administrator c=wiki p=3 s=2012-04-10 t=2012-04-03
Target Milestone: 2.6 → ---
Whiteboard: u=administrator c=wiki p=3 s=2012-04-10 t=2012-04-03 → u=administrator c=wiki p=3 s=2012-04-10 t=2012-04-10
Assignee: nobody → lcrouch
Blocks: 742516
Commit pushed to master at https://github.com/mozilla/kuma

https://github.com/mozilla/kuma/commit/96d1c26e977f1b2bc3d196f23081ef90f49b7e07
Merge pull request #154 from groovecoder/665715-toc

Bug 665715 generate TOC for document view
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Blocks: 756263
Version: Kuma → unspecified
Component: Website → Landing pages
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.