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&pag…
WDYT?
Thanks
-Vincent
_______________________________________________
devs mailing list
devs(a)xwiki.org
http://lists.xwiki.org/mailman/listinfo/devs