Simplifying page heading display

Splitted from FeatureRequests/CustomPageTitle. Some stuff moved to FeatureRequests/AliasingForPageNames.

/!\ This page is ONLY about a rather simple theme change, not about the stuff described on those other pages.

Theme "postmodern" (work in progress) tries to re-think how moin renders the html title, h1, h2+ etc. - postmodern isn't intended to be added to the themes, but maybe to replace modern theme if we go for it (and will be named "modern" then).

I noticed that some wikis like Trac, simply use first level heading for the page title. If you start your page with:

= Title =

It is displayed as the page title. If you don't provide a title, you will not have any title :-). This is the wiki way to do titles.

To implement, we make sure that new page have

= Page Name =

When they are created, maybe by a template @NAME@ trick, and make all pages created from some template. Then the user can do what ever he likes to do - either use the title as is, or change it.

Today, = this = actually rendered as <h2>this</h2>. It will make more sense if it is rendered as <h1>this</h>.

Many times people use this structure on the page anyway, just because they like to create a nice structure, starting with one level 1 heading, then few level 2 headings, and so on.

Today we use custom code to print the page title in the theme. We need custom code to display the page title in print mode, when the theme is not printed. We need custom code to split the page title. We can trash all this code and simply show the page content which includes the title. Also, the editor preview is broken - you don't see the page title in the preview, we can save another hack to show the title there.

Display changes

Item

Now

Proposal

url

http://example.com/Foo/Bar/Baz_Page

http://example.com/Foo/Bar/Baz_Page

window title

Foo/Bar/Baz Page - Sitename

Baz Page - Sitename

page title

Foo / Bar / Baz Page

= First level heading = (Foo Bar by default)

page links in navigation bar

Foo/Bar/Baz Page (optionally shortened)

Baz Page (optionally shortened)

page links in other pages

Foo/Bar/Baz Page

Foo/Bar/Baz Page

location bar

NA

Foo / Bar /

= heading level 1 =

<h2>

<h1>

== heading level 2 ==

<h3>

<h2>

=== heading level n ===

<h(n+1)>

<hn>

changing heading numbers

The only point really affecting other themes is about a possible change of rendering headlines.

There are 2 possibilities:

don't change heading rendering

This means that = xxx = will continue to render as <h2>.

Pro:

Contra:

change heading rendering

This means that = xxx = will render as <h1>.

Pro:

Contra:

Optional: Migration of existing pages

/!\ This CAN, but does not NEED to be done. See this wiki, you can use classic and postmodern with the same old page content. You only want to do this if you want to have a headline1 in the page content area. In that case you would have already done this as classic never did this (and run into trouble as modern does artificially add a headline1 there) - so you will have a problem when using classic/modern, but not with classic/postmodern.

New pages are easy to fix, the problem is exiting pages. We have to transform page structure from:

= heading =
= another =

To:

= Page Name =
== heading ==
== another ==

Just adding = Page Name = to existing pages is NOT correct, it create bad structure. One expect that his page structure will not change by a theme change or software upgrade.

New heading level 6 <h6>

We will have to introduce a new heading level 6 - which will replace heading level 5. Usually it's not needed, but if someone used all headings before, we can't change the page structure.

Optional: Include

/!\ This is also optional. E.g. if you write a book, every chapter on one page and then include all pages on one page to render the whole book, you want to include the chapter headlines, too.

Will probably have to ignore the page title.

Include calls that assumed certain heading levels will break if we migrate the pages structure. Fixing include calls is tricky, it may contain regular expressions.

Table of contents

/!\ This is also optional. E.g. if you write a book, every chapter on one page and then include all pages on one page to render the whole book, you want to include the chapter headlines in TOC, too.

Will have to ignore the first level heading if there is only one. Both:

= page name =
== 1 ==
=== 1.1 ===
== 2 ==

And:

= 1 =
== 1.1 ==
= 2 =

Will render this:

Optional: Section numbering

/!\ You don't NEED to use a single heading1 if you don't want to. So just omitting it, or using multiple heading1 solves that "all under a single number" problem, too. Be aware that, in case of a chapter of a book, this might also be a wanted effect.

Must ignore the first heading.

= Page Name ==
== 1 ==
=== 1.1 ===
== 2 ==

#pragma section-numbers 2

May be the default value or the lowest value you can use.

What we should do with (bad) structure like this?

= Page Name ==
== ? ==
=== ? ===
= ? =

Again, section-numbers 2 handles this in a sane way:

= Page Name ==
== 1 ==
=== 1.1 ===
= Unnumbered =

Discussion

I don't like this idea very much. It simply requires too much work for upgrading existing wikis. Coding themes is the widest spread customization and people should not have to rewrite their themes on every upgrade.

The next thing is that displaying the page name as title keeps the unity of page url, page html title and first heading title. This unity is important to establish the page names as term within the wiki and for the user.

-- FlorianFesti 2005-10-29 08:24:54

If this is intended as a mandatory thing, it's a definitive no-no for many users and use-cases. Just as an example, I do NOT want to follow a rigid set of formatting rules for just a quick note temp page. It might be a consideration for 2.0 to follow this or a similar route. -- JürgenHermann 2005-10-29 08:38:46

MoinMoin: FeatureRequests/ThemeChange (last edited 2007-10-29 19:20:46 by localhost)