Jump to content

Topic on Project:Village Pump/Flow

abnormal skip in the numbering of TOC when transcluding

4
Summary by Wladek92

done; thanks Cencia.

Wladek92 (talkcontribs)

On page => https://www.mediawiki.org/wiki/API:Edit
when numbering of sections is activated in the user's Preferences, current TOC shows:

1 API documentation
2 Example
   2.1 POST request
   2.2 Response
   2.3 Sample code
       2.7.1 Edit conflicts
       2.7.2 Large edits
       2.7.3 CAPTCHAs
3 Possible errors...

Where you can observe abnormal numbering/indentation 2.3 => 2.7.1
Going to => https://www.mediawiki.org/wiki/API:Edit#Sample_code you see that numbering invades the tabs of the example as follows :

2.3 Sample code
2.4 Python  2.5 PHP  2.6 Javascript  2.7 MediaWiki JS
#!/usr/bin/python3....
2.7.1 Edit conflicts

The corresponding wikitext is : <!-- Transclude Sample code --> {{:{{translatable}}/Sample code 1}} For coherence we must select an option: [1]either TABs are taken into account and become sub items of 2.3 as 2.3.1 2.3.2 ... and appear in TOC [2]either they are not numbered at all and do not appear in the TOC but indentation and numbering should always be coherent.

Can someone investigate ? Thanks.

Christian FR (talk) 22:01, 25 September 2019 (UTC)

Ciencia Al Poder (talkcontribs)

This is caused by the tabbedWindow Gadget. See Topic:V4rxhebxgmoy4alp

A solution would be to move those sections outside of the examples section, either converting them to level-2 headings or creating a new level-2 heading for them

Wladek92 (talkcontribs)

Yes the inclusion is starting with === and disturb numbering of following ==== items. The new structure is the following one (may be 'user cases' is not accurate) :

   1 API documentation
   2 Example
       2.1 POST request
       2.2 Response
   3 Sample code
   4 User cases
       4.1 Edit conflicts
       4.2 Large edits
       4.3 CAPTCHAs
   5 Possible errors
   6 Parameter history
   7 Additional notes
   8 See also
   9 References
Wladek92 (talkcontribs)