DelDOT Project Development Manual:Auto-number headings
This will be a goal for the 2023 Edition. In order to make future edits simpler when renumbering sections, it would be preferable to have sections autonumbered. When hyperlinking to specific sections it should no longer be necessary to refer to the section number since the sections are linkable. The same applies to figures and tables.
Section Headers
In the page content
Simple:
- Remove the numbers from all the section headings in the wiki markup of Section 100 pages.
Example:===102.1.3Bridge Sheet Preparation === - Remove the numbers from the page anchor portion of anchor links.
Example:[[102 - Bridge Design Submission Requirements#102.1.3Bridge Sheet Preparation|102.1.3Bridge Sheet Preparation]]
In the backend interface
Use this snippet in MediaWiki:Common.js. We only want to apply it to specific pages (Section 100) so put within something like this
if ( mw.config.get( 'wgPageName' ) === 'Pagename' ) {
[snippet]
}
for each page OR modify the snippet like this to select the page-specific css classes:
var toc = document.querySelector('#toc');
if (toc) {
document.querySelectorAll(':is(.page-XXX,...) .mw-parser-output :is(h1,h2,h3,h4,h5,h6) .mw-headline').forEach(function (headline) {
var num = toc.querySelector('a[href="#' + CSS.escape(headline.id) + '"] .tocnumber');
if (num) headline.prepend(num.textContent + ' ');
});
} else {
document.body.classList.add('tpl-autonum');
}
Use the page-specific css classes with ::before in MediaWiki:Common.css to add the section number in front:
.page-101_-_Introduction :is(.tocnumber::before, .mw-headline::before) {
101
}
.page-102_-_Bridge_Design_Submission_Requirements :is(.tocnumber::before, .mw-headline::before) {
102
}
...
And remove the .tocnumber {display: none;}
Figures and Tables
There are multiple "figures" that should be tables and accomplishing this first would make that conversion easier. It would be feasible to accomplish this with redirects (wouldn't work for tables though) but it would still be preferable to auto-number the Section 100 figure captions and not refer to them by number but by the caption, just like with #Section Headers.
In the page content
Basically the similar to #Section Headers.
In the backend interface
All File:FIGURE XXX.XX pages would have to be renamed to something descriptive.