User:Lord Farin/Long-Term Projects/Extension

= Motivation =

On this page I will describe the ideas I have pertaining an extension of PW which will allow for more consistent style, easier transclusions and general ease of use. To this end, I seek to develop (together with Joe) a set of custom tags, maybe namespaces and templates to accommodate for this.

Of course, for this project to be viable, documentation needs to be extensive, and Help:Editing will need serious expansion/adaptation.

Feel free to comment and/or contribute ideas/prototypes.

= Progress/Overview of Ideas =

Rigour in Page Style
In order to achieve maximal consistency, it will be a good idea to add tags like:

Maybe more can be thought of. These will go with possible HTML attributes (and default values, of course); for example:

title="Section Title" foldable="folded/unfolded/false" headerlevel="2/3/4..." sectionname="For transclusion reference; eg. 'proof1'"

Furthermore, ideally users could set preferences (like 'by default, expand all folded sections').

This basically comes down to a DOM structure.

Transclusion
My currently most viable idea to achieve rigour in transclusions is the introduction of the tag or parser function Title of page whose section must be transcluded

It will be endowed with further attributes as deemed necessary/possible.

I strive for the possibility to adjust the heading level of all stuff inside the transcluded tag automatically, avoiding the struggle now often encountered.

A snippet of PHP that increments all headers in the input string $subject by the positive integer $increment: function adjust_headings($subject, $increment){ //Some input checking might be necessary, I skip it for now

if($increment <= 0){ return $subject; }

$eq = ""; $i = 0; while($i < $increment){ $eq .= "="; $i++; }

$result = preg_replace('#={2,}#', '$1'.$eq, $subject);

return $result; }