[xwiki-devs] [Proposal] Adding a setting in the skins to select the rendering syntax
Hi. Problem: in XWiki, we have currently 2 main skins, Colibri (to be deprecated) and Flamingo, that did not share the same doctype. Colibri templates are using the XHTML 1.0 syntax, meanwhile Flamingo uses the HTML 5 syntax. Currently, we have hard-coded in a lot of places the fact that we use XHTML 1.0 syntax, but I would like to replace this by a new setting, skin-dependant, to select the rendering syntax we want. It would enable us to generate valid code (with the HTML cleaner, among other things) for each skin we support. This setting will be located in the XWiki.XWikiSkins objects, and in the skin.properties file for file system skins. Of course we also need to add a new API to get the current rendering syntax. The alternative is to create a global setting or constant to set the rendering syntax for the whole XWiki instance. Some discussions about this there: http://jira.xwiki.org/browse/XWIKI-11602 Here is my +1, Thanks, -- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project
+0 if it's really needed.
From an user perspective it's a shame that we are polluting the Skin class with a setting that will be rarely used and that we cannot auto-determine the doctype from the skin's htmlheader.vm
Thanks, Caty On Mon, Jan 5, 2015 at 2:18 PM, Guillaume "Louis-Marie" Delhumeau < [email protected]> wrote:
Hi.
Problem: in XWiki, we have currently 2 main skins, Colibri (to be deprecated) and Flamingo, that did not share the same doctype. Colibri templates are using the XHTML 1.0 syntax, meanwhile Flamingo uses the HTML 5 syntax.
Currently, we have hard-coded in a lot of places the fact that we use XHTML 1.0 syntax, but I would like to replace this by a new setting, skin-dependant, to select the rendering syntax we want. It would enable us to generate valid code (with the HTML cleaner, among other things) for each skin we support.
This setting will be located in the XWiki.XWikiSkins objects, and in the skin.properties file for file system skins. Of course we also need to add a new API to get the current rendering syntax.
The alternative is to create a global setting or constant to set the rendering syntax for the whole XWiki instance.
Some discussions about this there: http://jira.xwiki.org/browse/XWIKI-11602
Here is my +1,
Thanks, -- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
htmlheader.vm is not really a standard place but I agree that this information is kind of provided there already which means there is a risk of having two informations not in sync. Maybe we should do what Guillaume suggest but also make what is in htmlheader.vm dynamic (i.e. generate it based on the skin property). On Mon, Jan 5, 2015 at 1:35 PM, Ecaterina Moraru (Valica) <[email protected]> wrote:
+0 if it's really needed.
From an user perspective it's a shame that we are polluting the Skin class with a setting that will be rarely used and that we cannot auto-determine the doctype from the skin's htmlheader.vm
Thanks, Caty
On Mon, Jan 5, 2015 at 2:18 PM, Guillaume "Louis-Marie" Delhumeau < [email protected]> wrote:
Hi.
Problem: in XWiki, we have currently 2 main skins, Colibri (to be deprecated) and Flamingo, that did not share the same doctype. Colibri templates are using the XHTML 1.0 syntax, meanwhile Flamingo uses the HTML 5 syntax.
Currently, we have hard-coded in a lot of places the fact that we use XHTML 1.0 syntax, but I would like to replace this by a new setting, skin-dependant, to select the rendering syntax we want. It would enable us to generate valid code (with the HTML cleaner, among other things) for each skin we support.
This setting will be located in the XWiki.XWikiSkins objects, and in the skin.properties file for file system skins. Of course we also need to add a new API to get the current rendering syntax.
The alternative is to create a global setting or constant to set the rendering syntax for the whole XWiki instance.
Some discussions about this there: http://jira.xwiki.org/browse/XWIKI-11602
Here is my +1,
Thanks, -- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
2015-01-05 13:35 GMT+01:00 Ecaterina Moraru (Valica) <[email protected]>:
+0 if it's really needed.
Well, it is not really needed. We can also decide that we support only one syntax and set it in xwiki.properties. But it is not the way we usually do in XWiki.
From an user perspective it's a shame that we are polluting the Skin class with a setting that will be rarely used and that we cannot auto-determine the doctype from the skin's htmlheader.vm
We can actually render htmlheaders.vm, detect the doctype (string detection on "<!DOCTYPE") and put it in memory to not do this detection at every request. But what if htmlheaders.vm is not correctly rendered (because of an #if() somewhere)? I think this solution is relatively complicated for very few benefit. An other idea is to put this setting in skin.properties only. The reasoning is that if you create a skin on the wiki, unless you overrides all the templates, you will need to use the same syntax than the parent skin, in the FS. This way, we don't add a field in the Skin Class, and things looks easier. This is the solution I will put in place internally in order to have valid HTML5 in XWiki 6.4, but this discussion still remains for 7.x. WDYT? Thanks, Guillaume
On 12 Jan 2015 at 17:01:36, Guillaume Louis-Marie Delhumeau ([email protected](mailto:[email protected])) wrote:
2015-01-05 13:35 GMT+01:00 Ecaterina Moraru (Valica) :
+0 if it's really needed.
Well, it is not really needed. We can also decide that we support only one syntax and set it in xwiki.properties. But it is not the way we usually do in XWiki.
From an user perspective it's a shame that we are polluting the Skin class with a setting that will be rarely used and that we cannot auto-determine the doctype from the skin's htmlheader.vm
We can actually render htmlheaders.vm, detect the doctype (string detection on "> request.
But what if htmlheaders.vm is not correctly rendered (because of an #if() somewhere)?
I think this solution is relatively complicated for very few benefit.
An other idea is to put this setting in skin.properties only. The reasoning is that if you create a skin on the wiki, unless you overrides all the templates, you will need to use the same syntax than the parent skin, in the FS. This way, we don't add a field in the Skin Class, and things looks easier. This is the solution I will put in place internally in order to have valid HTML5 in XWiki 6.4, but this discussion still remains for 7.x.
Has this been done already for 6.4? I don’t remember seeing it. Note that AFAIK skins don’t need to have a parent nowadays (and by default new skins don’t have parents). Thanks -Vincent [snip]
2015-02-18 14:56 GMT+01:00 [email protected] <[email protected]>:
On 12 Jan 2015 at 17:01:36, Guillaume Louis-Marie Delhumeau ( [email protected](mailto:[email protected])) wrote:
2015-01-05 13:35 GMT+01:00 Ecaterina Moraru (Valica) :
+0 if it's really needed.
Well, it is not really needed. We can also decide that we support only one syntax and set it in xwiki.properties. But it is not the way we usually do in XWiki.
From an user perspective it's a shame that we are polluting the Skin
class
with a setting that will be rarely used and that we cannot auto-determine the doctype from the skin's htmlheader.vm
We can actually render htmlheaders.vm, detect the doctype (string detection on "> request.
But what if htmlheaders.vm is not correctly rendered (because of an #if() somewhere)?
I think this solution is relatively complicated for very few benefit.
An other idea is to put this setting in skin.properties only. The reasoning is that if you create a skin on the wiki, unless you overrides all the templates, you will need to use the same syntax than the parent skin, in the FS. This way, we don't add a field in the Skin Class, and things looks easier. This is the solution I will put in place internally in order to have valid HTML5 in XWiki 6.4, but this discussion still remains for 7.x.
Has this been done already for 6.4? I don’t remember seeing it.
Hello. No, I did not have time to do it earlier and it seems we do not have a clear agreement on this. Thanks,
Note that AFAIK skins don’t need to have a parent nowadays (and by default new skins don’t have parents).
Thanks -Vincent
[snip]
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project
On 18 Feb 2015 at 15:08:21, Guillaume Louis-Marie Delhumeau ([email protected](mailto:[email protected])) wrote: [snip]
This is the solution I will put in place internally in order to have valid HTML5 in XWiki 6.4, but this discussion still remains for 7.x.
Has this been done already for 6.4? I don’t remember seeing it.
Hello.
No, I did not have time to do it earlier and it seems we do not have a clear agreement on this.
Thanks,
Don’t know if it’s related to this email thread, but it would be great if we/you could fix the broken HTML validation tests (http://ci.xwiki.org/job/xwiki-enterprise-test-webstandards/ - they’ve been failing on our CI for months now). Including WCAG tests. So it’s very likely that we have regressed in WCAG and in conformity in our HTML code… :( I don’t think it’s important if in the meantime we/you hardcode the syntax id to use based on the skin name in those validation tests. Actually this is probably not even needed since we support only 1 skin (Flamingo). [BTW we need to remove support for Colibri in 7.x, possibly sooner than later to ensure we can stabilize before the end of 7.x]. What’s important is that the validity tests get fixed ASAP and we can go back to normal. Thanks -Vincent
Note that AFAIK skins don’t need to have a parent nowadays (and by default new skins don’t have parents).
Thanks -Vincent
[snip]
2015-02-18 15:25 GMT+01:00 [email protected] <[email protected]>:
On 18 Feb 2015 at 15:08:21, Guillaume Louis-Marie Delhumeau ( [email protected](mailto:[email protected])) wrote:
[snip]
This is the solution I will put in place internally in order to have valid HTML5 in XWiki 6.4, but this discussion still remains for 7.x.
Has this been done already for 6.4? I don’t remember seeing it.
Hello.
No, I did not have time to do it earlier and it seems we do not have a clear agreement on this.
Thanks,
Don’t know if it’s related to this email thread, but it would be great if we/you could fix the broken HTML validation tests ( http://ci.xwiki.org/job/xwiki-enterprise-test-webstandards/ - they’ve been failing on our CI for months now). Including WCAG tests. So it’s very likely that we have regressed in WCAG and in conformity in our HTML code… :(
I don’t think it’s important if in the meantime we/you hardcode the syntax id to use based on the skin name in those validation tests. Actually this is probably not even needed since we support only 1 skin (Flamingo). [BTW we need to remove support for Colibri in 7.x, possibly sooner than later to ensure we can stabilize before the end of 7.x].
The problem is not to hardcode the syntax in the validation tests. The problem is to set, in XWiki, the rendering syntax that we want to use. Currently, it's XHTML 1.0 hard-coded in a lot of places. That is why I have done this proposal.
What’s important is that the validity tests get fixed ASAP and we can go back to normal.
Thanks -Vincent
Note that AFAIK skins don’t need to have a parent nowadays (and by default new skins don’t have parents).
Thanks -Vincent
[snip]
What I plan to do: - add a property in the Skin Class about the rendering syntax to use - add the same property for the skin located in the filesystem (skin.properties) - add an API that returns the current rendering syntax (depending on the skin) - add a Script Service that generates the doctype string to display in htmlheaders.vm so that we cannot have a sync problem. Thanks, -- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project
participants (4)
-
Ecaterina Moraru (Valica) -
Guillaume "Louis-Marie" Delhumeau -
Thomas Mortagne -
vincent@massol.net