Page MenuHomePhabricator

Add magic word to open article with TOC hidden
Closed, DeclinedPublic

Description

Add a magic word to have the Table of contents hidden by default when opening an article if the user has javascript enabled.

The table of contents should probably move from magic words to a template syntax.


Version: unspecified
Severity: enhancement

Details

Reference
bz10658

Event Timeline

bzimport raised the priority of this task from to Lowest.Nov 21 2014, 9:49 PM
bzimport added a project: MediaWiki-Parser.
bzimport set Reference to bz10658.
bzimport added a subscriber: Unknown Object (MLST).

robchur wrote:

Seems superfluous.

ayg wrote:

Agree. If you want this, you could always use JavaScript to do it. (Moving TOC and friends to standard magic word syntax would be a decent idea, but it's unrelated.)

I opened this bug after i was asked for this today. I could make some <span id="hidden-toc"></span> and use javascript to toggletoc if such id exists, but felt it was better done upstream. I also looked for a way to perform it by CSS but didn't find one.

(In reply to comment #0)

Add a magic word to have the Table of contents hidden by default when opening
an article if the user has javascript enabled.

If "hidden" means "not displayed", then NOTOC might fit your needs.

If "hidden" means "collapsed", then it's not good idea. Collapsing of TOC should not depend on editor (= should not be forced by any magic word or whatever) but on reader (could be done via preferences such as "Show TOC collapsed" - which I would actually appreciate).

ayg wrote:

Agree, TOCs should not be collapsed on a per-article basis and this should not be added in the core software. Having a preference is an idea, however.

robchur wrote:

An idea, but not a great one; preferences are evil. This is something that the user can do with a little bit of custom JavaScript, if desired.

Yes, it means collapsed.
It wasn't as a reader option, but an editor one, for -i presume- big TOCs. Some kid of preference of 'Autocollapse TOCs with more than X elements may do it too'.

ayg wrote:

(In reply to comment #7)

It wasn't as a reader option, but an editor one, for -i presume- big TOCs.

Bug 4127 is better suited to fix that.