[xwiki-devs] How to handle XHTML output for semantic properties?
Hi, I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320 I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle). Here's an example input: %%property1 ((( %%property2 **value2** %%property3 value3 ))) Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer: <!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty--> (note: we could have <!--property--> instead of start/stopproperty, that's a detail) Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events. Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like: <div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div> Note: we would use span for inline semantic properties instead of divs. And then have a CSS with display:none for ".xwiki-semantic" The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com... WDYT? Thanks -Vincent
Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
Very in favor of the hidden div version. It will make it much more easier to write a "semantic properties viewer" in javascript than if it's in HTML comments. Why not use the "rel" attribute to hold the relation ? <div class="'xwiki-semantic" rel="property1"> // ... etc </div> (I don't like having it has "the classname that is not 'xwiki-semantic'"). Or maybe double it with "rel" if the class is needed by hcard. Jerome.
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
On Apr 20, 2009, at 10:44 AM, Jerome Velociter wrote:
Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
Very in favor of the hidden div version. It will make it much more easier to write a "semantic properties viewer" in javascript than if it's in HTML comments. Why not use the "rel" attribute to hold the relation ?
<div class="'xwiki-semantic" rel="property1"> // ... etc </div>
(I don't like having it has "the classname that is not 'xwiki-semantic'"). Or maybe double it with "rel" if the class is needed by hcard.
rel is not a valid attribute for div or span (it's only valid for A and LINK elements). It doesn't validate against XHTML validators. Thanks -Vincent
Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
It's hard to do proper semantics like this, since microformats imply other elements than divs (for example links with rel, or abbr with title). Another aspect I don't like is that there are so many HTML elements. Why is there a p and a strong? Anyway, +1 for HTML. -- Sergiu Dumitriu http://purl.org/net/sergiu/
I have to look closely documentation for the details but IMO Jerome's argument about javascript manipulation is already enough to be +1 for XHTML elements instead of XHTML comments. On Mon, Apr 20, 2009 at 11:45, Sergiu Dumitriu <[email protected]> wrote:
Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
It's hard to do proper semantics like this, since microformats imply other elements than divs (for example links with rel, or abbr with title).
Another aspect I don't like is that there are so many HTML elements. Why is there a p and a strong?
Anyway, +1 for HTML. -- Sergiu Dumitriu http://purl.org/net/sergiu/ _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Thomas Mortagne
Hi Vincent, Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Questions: * Who is the subject of the property? Is it the host document? Is it a document fragment? * Is the position of the property inside the host document important? If it's not important then why should we merge the content of the document with its semantic properties. If the position is important then the subject it's not the document but the context (document fragment) in which the semantic property appears. * Are the semantic properties visible? Below you imply they are hidden, but what about the in-line properties? I am living in %liveIn(Paris). IMO the best way to add meta data inside the content of an HTML document is to use attributes (custom if necessary). Using anything else, like comments or elements, raises the complexity of the WYSIWYG editing because the meta data are part of the content flow and can be corrupted or deleted unintentionally. To prevent this they need to be protected using read-only *visible* areas which makes the on-the-fly editing hard (the user has to double click on "Paris" to edit).
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Both ways would require, I think, the same amount of work to make the semantic properties visible and read-only in WYSIWYG mode, using the same technique used for macros. Thanks, Marius
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
Thanks -Vincent
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
Ok after thinking more about this with Thomas (and thanks to Marius' email) here's our vision (Thomas and I). There are 2 separate needs: * semantic markup (a la microformat). * document metadata Semantic markup ============== This was the need solved by semantic properties in wikimodel (see http://code.google.com/p/wikimodel/wiki/AdvancedStructuralElements) However we've realized that with the group feature we want to introduce we already support semantic properties. Here's an example: I am (% class="person" %)(((Vincent Massol)) As a consequence there's no need to introduce a new syntax and I propose to revert all the changes I've done locally on my machine and not commit them and thus close http://jira.xwiki.org/jira/browse/XWIKI-3320 as won't fix. <implementation> * introduce group events to replace beginDocument/endDocument when it's not the initial doc * introduce begin/endProperty events to replace current begin/ endFormat() which is used for parameters (we'll keep begin/endFormat for wiki syntax elements such as **bold**, //italic//, etc.) </implementation> Document metadata ================ This is a separate discussion and we need to decide if we want to have the ability to specify document metadata inside document content or not. I'm not sure yet that we need that. If not then we'll need to continue having a separate way to specify document metadata be it with some special metadata object(s) or with a specific UI for setting metadata. In any case we'll need to add some new metadata like: * whether we want headers to be numbered or not for the full document for ex * whether we want left/right panels to be displayed * whether we want attachments/comments/information tabs to be displayed * etc. So we need to find how we want to support generic document metadata. Note that if we want only some headers to be numbered we can use: --------- cut here ------------------- = not numbered header (% xwiki:numberedHeaders="true" %)((( == numbered header1 blah blah ==numbered header2 blah blah ))) --------- cut here ------------------- Thanks -Vincent On Apr 20, 2009, at 10:31 AM, Vincent Massol wrote:
Hi,
I'm implementing semantic properties in XWiki Syntax 2.0 http://jira.xwiki.org/jira/browse/XWIKI-3320
I've done the wikimodel part and I'm now wondering how what XHTML we should generate in the XHTML renderer (and thus what XHTML should the wysiwyg handle).
Here's an example input:
%%property1 ((( %%property2 **value2** %%property3 value3 )))
Right now one solution I've found is to serialize the property content in xwiki syntax 2.0 and output it as a comment in the XHTML renderer:
<!--startproperty %%property1 ((( %%property2 **value2** %%property3 value3 )))--><!--stopproperty-->
(note: we could have <!--property--> instead of start/stopproperty, that's a detail)
Then the XHTML parser would use the xwiki syntax 2.0 parser on the content of the comment to generate events.
Since it's not very trivial to serialize to xwiki syntax in the XHTML renderer I'd like to know what you think or if you have a better idea. I guess we could also do something like:
<div class="'xwiki-semantic property1"> <div class="xwiki-semantic property2> <p> <strong>value2</strong> </p> </div> <div class="xwiki-semantic property3"> <p> value3 </p> </div> </div>
Note: we would use span for inline semantic properties instead of divs.
And then have a CSS with display:none for ".xwiki-semantic"
The advantage of this latter solution are: * Easier to implement for the XHTML renderer and XHTML parser * Is in line with HCARD if we want to support it (and we probably do), see http://jira.xwiki.org/jira/browse/XWIKI-3320?focusedCommentId=39554&page=com...
WDYT?
Thanks -Vincent
participants (5)
-
Jerome Velociter -
Marius Dumitru Florea -
Sergiu Dumitriu -
Thomas Mortagne -
Vincent Massol