Thread:Project:Support desk/Wrapper divs?

What do I need to do to put wrapper divs around certain elements? For example, I want to do the following:


 * Have a wrapper div for the lead text of articles.
 * Have a wrapper div that includes the Table of Contents and the lead text.

I am using the Vector skin and I'm rather surprised these divs don't already exist: if they did, the changes I want to make would be simple edits to Common.css, but as it stands now, there is no way to consistently select, say, only the lead text, or to position the ToC precisely without having to tediously invoke magic words on every page of the wiki (which is so implausible I'm completely unwilling to go that route). I have not found any extensions that assist in this or accomplish what I want them to do. (I'm also surprised each section of a page doesn't have its own containing div, but I've gotten around this by using SectionHide).

I haven't found anything at all about wrapping the lead text. All I have found about positioning the ToC precisely is either on a page-by-page basis (not what I want) or is a Common.css edit that does not accomplish what I need it to. I really, really need a wrapper div. It's not just for this sort of thing either: I know in the past I've wanted wrapper divs for other contexts as well, these are a just a few examples.

I have tried reading every skinning manual I could find to determine where the actual code for the divs for these elements are, to no avail. I tried digging in Vector.php, linker.php, skin.php, skintemplate.php, and a handful of other MediaWiki files just to try to make sense of where/how these things are handled and I still don't get it. I can't even figure out what the code labels things like the lead text, and it seems like the Table of Contents by default is always invoked with the entirety of the article content which makes it even more difficult to track down in the code. The best I could do was find where the ToC divs were generated in linker.php. I've searched through the documentation for hours and Googled everything I can and I can't figure this out on my own.

Is this something I can do with a skin? An extension? Some edit to Common.js? If one were to add a wrapper div to the lead text, or the lead text and table of contents, where would I add that code? Thanks, any help is appreciated.