Description

While unifying of parser and macros is discussed I like to request to have the possibility to use a macro as pragma statement.

At the moment we can't add macros which change the behaviour of elements of the whole page. We can only do this for parts of the page by a parser.

#pragma section-numbers off will change the behaviour of the actual page, no numbers for sections.

This is implemented somewhere deep in the codebase. But it could be also a macro section-numbers.py with one argument. And then this macro is used to format the page by it's additional rules.

The request is about changing this behaviour of pragma to call macros.

Then users could add some additional rules for pages, e.g. alphabetical sort of items.

If each parser could be used then probably one could write a whole page in latex. -- ReimarBauer 2005-03-13 08:43:07

Discussion

Its very easy to write a very simple macro which will change pragmas like #pragma section-numbers off, without changing moin code. Maybe something like [[SetPragma(pragma, value)]].

About "alphabetical sort of items", there is no pragma to do that. This is a new feature that need to be implemented deep in the code, or by a custom parser, that will sort list items before rendering:

For example, this markup:

{ { {
#!sort
 * Zee should be last
 * Ah, the first line
 * Middle line
} } }

Will render as:

I don't see why moin core should support sorting of page text, this could be done by the author, and is supported by many editors. -- NirSoffer 2005-03-13 13:38:24

So you want to replace pragma with a macro call? This can be done, but require changing the way pragmas are parsed and cached. Using a macro/parser can be easier way to add custom key-values to a page, so maybe its a good idea. -- NirSoffer 2005-03-13 20:50:05

The name PPM does describe the techniques are used to write the code but normally I use the words extension or plugin or module to describe someone who does like to use the wiki and it's PPMs. If the code is unified we should use in my eyes a common name like firefox and others are doing. Just tell it extension -- ReimarBauer 2005-11-19 07:25:54


CategoryFeatureRequest

MoinMoin: FeatureRequests/PPMCalledFromPragma (last edited 2007-10-29 19:09:47 by localhost)