Hello all,
In the context of the support of multiple categories for the macros, I’d like to discuss the support for categories configuration.
Currently, overriding the category of a macro can be only done by updating xwiki.properties
. For instance to set the “Demo” category to the toc
macro:
rendering.transformation.macro.categories = toc:Demo
Note: While the services to read those properties exists, they are - to our knowledge - not used in the code based of XS.
From our initial discussion on #xwiki, we considered the following options
Option 1: Full override only
When overriding the categories of a macro, the admin must list exhaustively the new categories.
rendering.transformation.macro.categories = toc:Demo,Hidden
Option 2: Diff only
The admin starts from the list of default categories of the macro, and can either add or remove categories.
For instance, if the toc
macro has the default categories = ['Navigation']
, defining its categories to be ['Demo
, ‘Hidden’]` can be done with:
rendering.transformation.macro.categories = toc:-Navigation,+Demo,+Hidden
Option 3: Diff optional initial values
The admin can choose to start from the list of default categories. When ^
is added as the first character of the list, the default categories are added, otherwise they are not.
Therefore, the two configurations below are equivalent if default categories = ['Navigation']
rendering.transformation.macro.categories = toc:Demo,Hidden
rendering.transformation.macro.categories = toc:^-Navigation,+Demo,Hidden
Once we agree on this, I’ll update this proposal with the corresponding Administration UI.
WDYT?
PS: Of course feel free to also suggest variations of the syntax.