Add the ability to use the page title as the page heading

It would be useful if the page name could be the document title. e.g. properly named pages get proper titles. This could be achieved with a title macro. Currently MoinMoin supports @SELF though I don't think this can be used to display the page name and update if it changes. option to specify what the title should look like needs to be possible. e.g. pageNameInCamelCase should be displayed as separate words if wanted. It should also be possible to select which words to make upper-case (e.g. all / just the first etc)

An implication of using this feature is that pages must be properly named. If one wants to change the title using this the page must be renamed. Currently renaming pages require some effort. This may be made easier in the future by FeatureRequests/RenamePageUpdatesLinkedPages.


You could implement this yourself and add it to the MacroMarket page as a contribution. A start is to copy the following to mywiki/data/plugin/macro/MyPageTitleMacro.py and then enhance it to your requirements:

def execute(macro, args):
    return '<h1>%s</h1>' % macro.request.url.split('/')[-1]

The above may work as is for a few pages. But then you may want insert spaces in front of CamelCasePageNames to make it look better. But then you may have to enhance that to not always insert spaces if you want a page title like "Why SciTE is My Favorite Editor". And then there are cases where you may want to include a character in a page title that is not a valid character within file names. Plus there are the options you suggested. In time, there will be more exceptions.

Or, maybe the easiest and most flexible way is to just choose the initial page name carefully and then carefully choose the page title. If they are the same or similar, there is always copy and paste.

-- RogerHaase 2012-02-26 19:26:08


CategoryFeatureRequest

MoinMoin: FeatureRequests/addTheAbilityToUseThePageNameAsThePageHeading (last edited 2012-02-26 19:26:09 by RogerHaase)