Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-15 Thread Ari
Hi Sergiu and Jean-Vincent.


Sergiu Dumitriu wrote:
> Ari wrote:
>> I've tried to figure out why the XWiki renders xwiki-headings as it
>> does. E.g "1 Title One" is rendered as 'Title
>> One'. I would like to change this to be h1-element instead of
>> h2-element.
> 
> That was my decision, as in a document there is already a first-level 
> heading, the document title. 
> Having other elements as level 1 headings would mean that they have the same 
> significance as the 
> document title, which I think is wrong. Still, this should be configurable, 
> and since the heading 
> syntax is not yet finalized (http://jira.xwiki.org/jira/browse/XWIKI-1247) it 
> can be changed.

I see your point. I agree that in general it is a good approach to have
only one H1-element in a web page. However, as I see it, wiki provided
pages should be handled in this viewpoint as individual pages. What I
mean is that if xwiki-framework provides some dynamic title, it should
not hinder the user-provided content to contain H1-element (with xwiki
syntax). E.g when I print a page from XWiki, the optimal result is that
the page looks as if it was printed through OpenOffice.org - IMHO the
containment (of a page) should not be restricted on the basis of what
lies "under the hood".

I'd like to point out that previous statement holds true in the
environment I am using the XWiki. Of course, if the feature could be
configurable, it would be a win-win situation (of course, the debate
would then concentrate on issue of default setting? ;-) )

>> PART 2
>>
>> Another suggestion is that minor fix would be implemented in rendering.
>> An example text and the rendered result:
>>
>> --
>> this is text before list.
>> * this
>> * is
>> * list
>> this is text after list.
>> --
>> this is text before list.
>> 
>>this
>>is
>>list
>> this is text after list.
>> --

> Radeox makes this extremely hard to do. Since it works with independent 
> regular expressions, and not 
> with grammars or state machines or something else that could know what a 
> paragraph is, you can't 
> write a regular expression that matches only the right things. The new 
> rendering engine could solve 
> this issue.

Ok. I just wait and see. The reason I'm asking this is that this
behaviour breaks the page structure (which leads to poor printing
result). Fortunately there is the "good-old-add-"-workaround.

> 
> You are somehow wrong in your example, as the actual rendering is:
> 
> this is text before list.
>  ...
> 
> Not even the first line of text is actually a paragraph, but because the page 
> is not sent as valid 
> XML, but html, the browser takes the freedom to actually put that line inside 
> the paragraph, because 
> it knows that an empty paragraph element is wrong and absurd.

Ah. I think you are correct: I just copy&pasted the result from firefox
source-viewer. In some time ago, it was Internet Exploder which did this
"fixing" - now it seems that everybody's doing it. :)

Thank you for your replies.

With Regards,
ari
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Sergiu Dumitriu
Jean-Vincent Drean wrote:
> On Fri, Jun 13, 2008 at 2:44 PM, Sergiu Dumitriu <[EMAIL PROTECTED]> wrote:
>>> I've tried to figure out why the XWiki renders xwiki-headings as it
>>> does. E.g "1 Title One" is rendered as 'Title
>>> One'. I would like to change this to be h1-element instead of
>>> h2-element.
>> That was my decision, as in a document there is already a first-level 
>> heading, the document title.
> 
> Hum yes, I was mentally referring to an even older behavior when I
> replied, when the titles were all h3.
> Sorry for my misleading answer. BTW I'd be +1 to have 1 Title
> transformed to h1, may be it's only a personal habit but I tend to put
> only one first level title in my wiki pages.
> 

We should have a vote then. This is how democracy works, everybody has the 
right to vote, the one 
writing the code has the power to decide :p .

Anyway, I don't have a strong opinion on this matter now, as there is already 
the  element 
that has more significance than all the rest, so we could have more  
elements, especially since 
the document title is often the first heading in the document.
-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Jean-Vincent Drean
On Fri, Jun 13, 2008 at 2:44 PM, Sergiu Dumitriu <[EMAIL PROTECTED]> wrote:
>>
>> I've tried to figure out why the XWiki renders xwiki-headings as it
>> does. E.g "1 Title One" is rendered as 'Title
>> One'. I would like to change this to be h1-element instead of
>> h2-element.
>
> That was my decision, as in a document there is already a first-level 
> heading, the document title.

Hum yes, I was mentally referring to an even older behavior when I
replied, when the titles were all h3.
Sorry for my misleading answer. BTW I'd be +1 to have 1 Title
transformed to h1, may be it's only a personal habit but I tend to put
only one first level title in my wiki pages.

-- 
Jean-Vincent Drean
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Sergiu Dumitriu
Ari wrote:
> Hello. My question / suggestion goes with two part.
> 
> 
> PART 1
> 
> I've tried to figure out why the XWiki renders xwiki-headings as it
> does. E.g "1 Title One" is rendered as 'Title
> One'. I would like to change this to be h1-element instead of
> h2-element.

That was my decision, as in a document there is already a first-level heading, 
the document title. 
Having other elements as level 1 headings would mean that they have the same 
significance as the 
document title, which I think is wrong. Still, this should be configurable, and 
since the heading 
syntax is not yet finalized (http://jira.xwiki.org/jira/browse/XWIKI-1247) it 
can be changed.

> At first I suspected that this change would require only small
> modification in some velocity template. It seems that I was wrong. My
> current guess is that this rendering is done somewhere in java (from
> xwiki.hbm.xml I tracked the doc.XWikiDocument and with that my guess is
> DefaultXWikiRenderingEngine.java). However, I don't know how/where I
> should change the code.

Look at com.xpn.xwiki.render.filter.XWikiHeadingFilter

> Is there a flow-chart or something to describe the render-phase?
> 
> 
> As the description of this list goes: I would suggest that the xwiki
> rendering should be done in a straightforward way where syntax 1 would
> be h1, 1.1 h2, 1.1.1 h3 and so on.
> 
> 
> 
> PART 2
> 
> Another suggestion is that minor fix would be implemented in rendering.
> An example text and the rendered result:
> 
> --
> this is text before list.
> * this
> * is
> * list
> this is text after list.
> --
> this is text before list.
> 
>this
>is
>list
> this is text after list.
> --
> 
> Also "this is text after list" should be rendered as paragraph. A
> workaround is to write:
> 
> --
> this is text before list.
> * this
> * is
> * list
> 
> 
> this is text after list.
> --
> this is text before list.
> 
>   this
>   is
>   list
> 
> this is text after list.
> --
> 
> 
> Same goes with lists with - * and #.
> 

Radeox makes this extremely hard to do. Since it works with independent regular 
expressions, and not 
with grammars or state machines or something else that could know what a 
paragraph is, you can't 
write a regular expression that matches only the right things. The new 
rendering engine could solve 
this issue.

You are somehow wrong in your example, as the actual rendering is:

this is text before list.
 ...

Not even the first line of text is actually a paragraph, but because the page 
is not sent as valid 
XML, but html, the browser takes the freedom to actually put that line inside 
the paragraph, because 
it knows that an empty paragraph element is wrong and absurd.
-- 
Sergiu Dumitriu
http://purl.org/net/sergiu/
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Ari
Hello Vincent.

Vincent Massol wrote:
> On Jun 13, 2008, at 10:53 AM, Ari wrote:
> 
>> Vincent Massol wrote:
>>>
>>> Would be great if you could open a jira issue for this and send us a
>>> real patch. Don't forget that you'll need to modify all CSS files for
>>> the various skins too.
>> Done:
>>  http://jira.xwiki.org/jira/browse/XWIKI-2464
>>  http://jira.xwiki.org/jira/browse/XWIKI-2465
>>
>> I grepped recursively the installation I have (1.4) and even though  
>> few
>> files (see list below) contain some hard-coded values for headers,  
>> this
>> is IMHO irrelevant because they contain the similar (.heading-1)  
>> styles.
>>
> 
> ok that's cool then. All you need then is good and tested patch.
> See http://dev.xwiki.org/xwiki/bin/view/Community/Contributing

Thanks for the link (and for the help you've provided). I attached two
patches in http://jira.xwiki.org/jira/browse/XWIKI-2464

Regards,
Ari
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Vincent Massol

On Jun 13, 2008, at 10:53 AM, Ari wrote:

> Vincent Massol wrote:
>> Hi Ari,
>>
>> Would be great if you could open a jira issue for this and send us a
>> real patch. Don't forget that you'll need to modify all CSS files for
>> the various skins too.
>
> Done:
>  http://jira.xwiki.org/jira/browse/XWIKI-2464
>  http://jira.xwiki.org/jira/browse/XWIKI-2465
>
>>
>> I'm also worried this might break  several custom skins done by  
>> users.
>> WDYT?
>
> I think that this does not break anything. The CSS-files contain the
> header info in general way (i.e. instead of H1 and H2 there is styles
> for .heading-1, .heading-1-1, and so on.
>
> I grepped recursively the installation I have (1.4) and even though  
> few
> files (see list below) contain some hard-coded values for headers,  
> this
> is IMHO irrelevant because they contain the similar (.heading-1)  
> styles.
>
> - skins/albatross/scripts/table/tablefilterNsort.js
> - templates/viewattachrev.vm
> - templates/passwd.vm
> - templates/importinline.vm
> - templates/renameStep1.vm
> - templates/exportinline.vm
> - templates/changemyavatar.vm
> - wiki_editor/plugins/core.js

ok that's cool then. All you need then is good and tested patch.
See http://dev.xwiki.org/xwiki/bin/view/Community/Contributing

Thanks
-Vincent

>> On Jun 13, 2008, at 5:57 AM, Ari wrote:
>>
>>> Ari wrote:
 I've tried to figure out why the XWiki renders xwiki-headings as it
 does. E.g "1 Title One" is rendered as 'Title
 One'. I would like to change this to be h1-element instead of
 h2-element.
>>> I implemented the modifications for "heading liftup". Modifications
>>> include:
>>>
>>> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading
>>> --
>>>   public static void makeHeading(StringBuffer stringBuffer, String
>>> level, String text,  Util util) {
>>>
>>> // modified 12.06.2008  
>>> Integer parsedInt = Integer.parseInt(level);
>>> Integer levelInt = Math.max((parsedInt-1), 1);
>>> // end of modification
>>> 
>>>   String anchor = makeAnchor(text, util);
>>>   stringBuffer.append(">>   stringBuffer.append(levelInt); // was: level
>>>   stringBuffer.append(" id=\"");
>>>   stringBuffer.append(anchor);
>>>   stringBuffer.append("\" >");
>>>   stringBuffer.append(text);
>>>   stringBuffer.append(">>   stringBuffer.append(levelInt); // was: level
>>>   stringBuffer.append(">");
>>>
>>>   }
>>>
>>> --
>>>
>>>
>>>
>>> com 
>>> .xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
>>> result, FilterContext context)
>>>
>>> --
>>>   public String handleMatch(MatchResult result, FilterContext
>>> context)
>>>   {
>>>   String id = null;
>>>   String title = result.group(0);
>>>   String level = result.group(1);
>>>   // old way
>>>   //int level_i = (level.length() + 3) / 2;
>>>   // new way (12.06.2008)
>>>   int level_i =  level.replaceAll("\\.", "").length();
>>> --
>>>
>>> I'm not sure if the modification to
>>> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading is necessary,
>>> but
>>> the change for
>>> com 
>>> .xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
>>> is obvious.
>>>
>>>
>>> This change is compatible with xwiki-core-1.4. I think that the
>>> rendering is pretty completely rewritten in 1.5, but hopefully  
>>> someone
>>> finds this useful. Any corrections for possible misintepretations  
>>> are
>>> highly appreciated.
>>>
>>>
>>> Regards,
>>> ari
>>>
>>> PS. Has someone knowledge about the "bug" in the rendering text  
>>> after
>>> list (-, *, #) ? (See rest of the post, PART 2)
>>>
>>>
 As the description of this list goes: I would suggest that the  
 xwiki
 rendering should be done in a straightforward way where syntax 1
 would
 be h1, 1.1 h2, 1.1.1 h3 and so on.



 PART 2

 Another suggestion is that minor fix would be implemented in
 rendering.
 An example text and the rendered result:

 --
 this is text before list.
 * this
 * is
 * list
 this is text after list.
 --
 this is text before list.
 
  this
  is
  list
 this is text after list.
 --

 Also "this is text after list" should be rendered as paragraph. A
 workaround is to write:

 --
 this is text before list.
 * this
 * is
 * list
 

 this is text after list.
 --
 this is text before list.
 
 this
 is
 list
 
 this is text after list.
 --


 Same goes with lists with - * and #.


 With Best Regards,
 ari
>> ___
>> users mailing list
>> users@xwiki.org
>> http://lists.xwiki.org/mailman/listinfo/users
>
> 

Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Ari
Vincent Massol wrote:
> Hi Ari,
> 
> Would be great if you could open a jira issue for this and send us a  
> real patch. Don't forget that you'll need to modify all CSS files for  
> the various skins too.

Done:
  http://jira.xwiki.org/jira/browse/XWIKI-2464
  http://jira.xwiki.org/jira/browse/XWIKI-2465

> 
> I'm also worried this might break  several custom skins done by users.  
> WDYT?

I think that this does not break anything. The CSS-files contain the
header info in general way (i.e. instead of H1 and H2 there is styles
for .heading-1, .heading-1-1, and so on.

I grepped recursively the installation I have (1.4) and even though few
files (see list below) contain some hard-coded values for headers, this
is IMHO irrelevant because they contain the similar (.heading-1) styles.

- skins/albatross/scripts/table/tablefilterNsort.js
- templates/viewattachrev.vm
- templates/passwd.vm
- templates/importinline.vm
- templates/renameStep1.vm
- templates/exportinline.vm
- templates/changemyavatar.vm
- wiki_editor/plugins/core.js

Regards,
ari


> 
> Thanks
> -Vincent
> 
> On Jun 13, 2008, at 5:57 AM, Ari wrote:
> 
>> Ari wrote:
>>> I've tried to figure out why the XWiki renders xwiki-headings as it
>>> does. E.g "1 Title One" is rendered as 'Title
>>> One'. I would like to change this to be h1-element instead of
>>> h2-element.
>> I implemented the modifications for "heading liftup". Modifications  
>> include:
>>
>> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading
>> --
>>public static void makeHeading(StringBuffer stringBuffer, String
>> level, String text,  Util util) {
>>
>>  // modified 12.06.2008  
>>  Integer parsedInt = Integer.parseInt(level);
>>  Integer levelInt = Math.max((parsedInt-1), 1);
>>  // end of modification
>>  
>>String anchor = makeAnchor(text, util);
>>stringBuffer.append(">stringBuffer.append(levelInt); // was: level
>>stringBuffer.append(" id=\"");
>>stringBuffer.append(anchor);
>>stringBuffer.append("\" >");
>>stringBuffer.append(text);
>>stringBuffer.append(">stringBuffer.append(levelInt); // was: level
>>stringBuffer.append(">");
>>
>>}
>>
>> --
>>
>>
>>
>> com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
>> result, FilterContext context)
>>
>> --
>>public String handleMatch(MatchResult result, FilterContext  
>> context)
>>{
>>String id = null;
>>String title = result.group(0);
>>String level = result.group(1);
>>// old way
>>//int level_i = (level.length() + 3) / 2;
>>// new way (12.06.2008)
>>int level_i =  level.replaceAll("\\.", "").length();
>> --
>>
>> I'm not sure if the modification to
>> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading is necessary,  
>> but
>> the change for
>> com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
>> is obvious.
>>
>>
>> This change is compatible with xwiki-core-1.4. I think that the
>> rendering is pretty completely rewritten in 1.5, but hopefully someone
>> finds this useful. Any corrections for possible misintepretations are
>> highly appreciated.
>>
>>
>> Regards,
>> ari
>>
>> PS. Has someone knowledge about the "bug" in the rendering text after
>> list (-, *, #) ? (See rest of the post, PART 2)
>>
>>
>>> As the description of this list goes: I would suggest that the xwiki
>>> rendering should be done in a straightforward way where syntax 1  
>>> would
>>> be h1, 1.1 h2, 1.1.1 h3 and so on.
>>>
>>>
>>>
>>> PART 2
>>>
>>> Another suggestion is that minor fix would be implemented in  
>>> rendering.
>>> An example text and the rendered result:
>>>
>>> --
>>> this is text before list.
>>> * this
>>> * is
>>> * list
>>> this is text after list.
>>> --
>>> this is text before list.
>>> 
>>>   this
>>>   is
>>>   list
>>> this is text after list.
>>> --
>>>
>>> Also "this is text after list" should be rendered as paragraph. A
>>> workaround is to write:
>>>
>>> --
>>> this is text before list.
>>> * this
>>> * is
>>> * list
>>> 
>>>
>>> this is text after list.
>>> --
>>> this is text before list.
>>> 
>>>  this
>>>  is
>>>  list
>>> 
>>> this is text after list.
>>> --
>>>
>>>
>>> Same goes with lists with - * and #.
>>>
>>>
>>> With Best Regards,
>>> ari
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Vincent Massol
Hi Ari,

Would be great if you could open a jira issue for this and send us a  
real patch. Don't forget that you'll need to modify all CSS files for  
the various skins too.

I'm also worried this might break  several custom skins done by users.  
WDYT?

Thanks
-Vincent

On Jun 13, 2008, at 5:57 AM, Ari wrote:

> Ari wrote:
>> I've tried to figure out why the XWiki renders xwiki-headings as it
>> does. E.g "1 Title One" is rendered as 'Title
>> One'. I would like to change this to be h1-element instead of
>> h2-element.
>
> I implemented the modifications for "heading liftup". Modifications  
> include:
>
> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading
> --
>public static void makeHeading(StringBuffer stringBuffer, String
> level, String text,  Util util) {
>
>   // modified 12.06.2008  
>   Integer parsedInt = Integer.parseInt(level);
>   Integer levelInt = Math.max((parsedInt-1), 1);
>   // end of modification
>   
>String anchor = makeAnchor(text, util);
>stringBuffer.append("stringBuffer.append(levelInt); // was: level
>stringBuffer.append(" id=\"");
>stringBuffer.append(anchor);
>stringBuffer.append("\" >");
>stringBuffer.append(text);
>stringBuffer.append("stringBuffer.append(levelInt); // was: level
>stringBuffer.append(">");
>
>}
>
> --
>
>
>
> com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
> result, FilterContext context)
>
> --
>public String handleMatch(MatchResult result, FilterContext  
> context)
>{
>String id = null;
>String title = result.group(0);
>String level = result.group(1);
>// old way
>//int level_i = (level.length() + 3) / 2;
>// new way (12.06.2008)
>int level_i =  level.replaceAll("\\.", "").length();
> --
>
> I'm not sure if the modification to
> com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading is necessary,  
> but
> the change for
> com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
> is obvious.
>
>
> This change is compatible with xwiki-core-1.4. I think that the
> rendering is pretty completely rewritten in 1.5, but hopefully someone
> finds this useful. Any corrections for possible misintepretations are
> highly appreciated.
>
>
> Regards,
> ari
>
> PS. Has someone knowledge about the "bug" in the rendering text after
> list (-, *, #) ? (See rest of the post, PART 2)
>
>
>> As the description of this list goes: I would suggest that the xwiki
>> rendering should be done in a straightforward way where syntax 1  
>> would
>> be h1, 1.1 h2, 1.1.1 h3 and so on.
>>
>>
>>
>> PART 2
>>
>> Another suggestion is that minor fix would be implemented in  
>> rendering.
>> An example text and the rendered result:
>>
>> --
>> this is text before list.
>> * this
>> * is
>> * list
>> this is text after list.
>> --
>> this is text before list.
>> 
>>   this
>>   is
>>   list
>> this is text after list.
>> --
>>
>> Also "this is text after list" should be rendered as paragraph. A
>> workaround is to write:
>>
>> --
>> this is text before list.
>> * this
>> * is
>> * list
>> 
>>
>> this is text after list.
>> --
>> this is text before list.
>> 
>>  this
>>  is
>>  list
>> 
>> this is text after list.
>> --
>>
>>
>> Same goes with lists with - * and #.
>>
>>
>> With Best Regards,
>> ari
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-13 Thread Vincent Massol

On Jun 12, 2008, at 11:26 AM, Jean-Vincent Drean wrote:

> On Wed, Jun 11, 2008 at 1:37 PM, Ari <[EMAIL PROTECTED]> wrote:
>> Hello. My question / suggestion goes with two part.
>>
>> PART 1
>>
>> I've tried to figure out why the XWiki renders xwiki-headings as it
>> does. E.g "1 Title One" is rendered as 'Title
>> One'. I would like to change this to be h1-element instead of
>> h2-element.
>>
>> At first I suspected that this change would require only small
>> modification in some velocity template. It seems that I was wrong. My
>> current guess is that this rendering is done somewhere in java (from
>> xwiki.hbm.xml I tracked the doc.XWikiDocument and with that my  
>> guess is
>> DefaultXWikiRenderingEngine.java). However, I don't know how/where I
>> should change the code.
>>
>> Is there a flow-chart or something to describe the render-phase?

No, not yet. We'd like one. I'll do one for the new rendering. In the  
meantime it's described here:
http://dev.xwiki.org/xwiki/bin/view/Design/NewRenderingArchitecture

>> As the description of this list goes: I would suggest that the xwiki
>> rendering should be done in a straightforward way where syntax 1  
>> would
>> be h1, 1.1 h2, 1.1.1 h3 and so on.
>>
>
> Yes the semantics of our titles aren't correct, if I remember well
> those titles are the default titles coming from Radeox (the rendering
> components we use which is not part of the XWiki project itself).
> BTW we are currently rewriting the whole rendering component so I
> think this issue will disappear in a near future, Vincent can you
> confirm ?

Well it's our own decision to decide if 1 should generate h1 or h2. I  
agree it probably makes sense to generate h1.

The new code is here:
http://svn.xwiki.org/svnroot/xwiki/xwiki-platform/core/trunk/xwiki-rendering/xwiki-rendering-api/src/main/java/org/xwiki/rendering/renderer/XHTMLRenderer.java

You'll see that right now I've mimicked the old behavior of putting h2  
for title level 1.

The problem is that if we change it then we also need to change the  
old code since we need to modify our CSS files too.

Honestly I think this a nice to have but still a very low priority  
compared to other issues we have to fix in jira.

So if a contributor gives us a clean patch we'll apply it but  
otherwise I'd suggest we don't spend too much time on this.

Thanks
-Vincent
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-12 Thread Ari
Hello.

Jean-Vincent Drean wrote:
> On Wed, Jun 11, 2008 at 1:37 PM, Ari <[EMAIL PROTECTED]> wrote:
>> As the description of this list goes: I would suggest that the xwiki
>> rendering should be done in a straightforward way where syntax 1 would
>> be h1, 1.1 h2, 1.1.1 h3 and so on.
>>
> 
> Yes the semantics of our titles aren't correct, if I remember well
> those titles are the default titles coming from Radeox (the rendering
> components we use which is not part of the XWiki project itself).
> BTW we are currently rewriting the whole rendering component so I
> think this issue will disappear in a near future, Vincent can you
> confirm ?

I noticed just now that thunderbird had marked tons of users-list mail
as junk so I didn't notice this until now. Happy to hear that problems
may be solved as we upgrade our wiki to 1.5.

Hopefully the PART2 "bug" is also fixed.. I could have fixed it but have
no idea where to look for.

With Regards,
ari
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-12 Thread Ari
Ari wrote:
> I've tried to figure out why the XWiki renders xwiki-headings as it
> does. E.g "1 Title One" is rendered as 'Title
> One'. I would like to change this to be h1-element instead of
> h2-element.

I implemented the modifications for "heading liftup". Modifications include:

com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading
--
public static void makeHeading(StringBuffer stringBuffer, String
level, String text,  Util util) {

// modified 12.06.2008  
Integer parsedInt = Integer.parseInt(level);
Integer levelInt = Math.max((parsedInt-1), 1);
// end of modification

String anchor = makeAnchor(text, util);
stringBuffer.append("");
stringBuffer.append(text);
stringBuffer.append("");

}

--



com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
result, FilterContext context)

--
public String handleMatch(MatchResult result, FilterContext context)
{
String id = null;
String title = result.group(0);
String level = result.group(1);
// old way
//int level_i = (level.length() + 3) / 2;
// new way (12.06.2008)
int level_i =  level.replaceAll("\\.", "").length();
--

I'm not sure if the modification to
com.xpn.xwiki.render.XWikiWikiBaseRenderer#makeHeading is necessary, but
the change for
com.xpn.xwiki.render.filter.XWikiHeadingFilter#handleMatch(MatchResult
is obvious.


This change is compatible with xwiki-core-1.4. I think that the
rendering is pretty completely rewritten in 1.5, but hopefully someone
finds this useful. Any corrections for possible misintepretations are
highly appreciated.


Regards,
ari

PS. Has someone knowledge about the "bug" in the rendering text after
list (-, *, #) ? (See rest of the post, PART 2)


> As the description of this list goes: I would suggest that the xwiki
> rendering should be done in a straightforward way where syntax 1 would
> be h1, 1.1 h2, 1.1.1 h3 and so on.
> 
> 
> 
> PART 2
> 
> Another suggestion is that minor fix would be implemented in rendering.
> An example text and the rendered result:
> 
> --
> this is text before list.
> * this
> * is
> * list
> this is text after list.
> --
> this is text before list.
> 
>this
>is
>list
> this is text after list.
> --
> 
> Also "this is text after list" should be rendered as paragraph. A
> workaround is to write:
> 
> --
> this is text before list.
> * this
> * is
> * list
> 
> 
> this is text after list.
> --
> this is text before list.
> 
>   this
>   is
>   list
> 
> this is text after list.
> --
> 
> 
> Same goes with lists with - * and #.
> 
> 
> With Best Regards,
> ari
> ___
> users mailing list
> users@xwiki.org
> http://lists.xwiki.org/mailman/listinfo/users

___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


Re: [xwiki-users] xwiki rendering questions / suggestions

2008-06-12 Thread Jean-Vincent Drean
On Wed, Jun 11, 2008 at 1:37 PM, Ari <[EMAIL PROTECTED]> wrote:
> Hello. My question / suggestion goes with two part.
>
> PART 1
>
> I've tried to figure out why the XWiki renders xwiki-headings as it
> does. E.g "1 Title One" is rendered as 'Title
> One'. I would like to change this to be h1-element instead of
> h2-element.
>
> At first I suspected that this change would require only small
> modification in some velocity template. It seems that I was wrong. My
> current guess is that this rendering is done somewhere in java (from
> xwiki.hbm.xml I tracked the doc.XWikiDocument and with that my guess is
> DefaultXWikiRenderingEngine.java). However, I don't know how/where I
> should change the code.
>
> Is there a flow-chart or something to describe the render-phase?
>
> As the description of this list goes: I would suggest that the xwiki
> rendering should be done in a straightforward way where syntax 1 would
> be h1, 1.1 h2, 1.1.1 h3 and so on.
>

Yes the semantics of our titles aren't correct, if I remember well
those titles are the default titles coming from Radeox (the rendering
components we use which is not part of the XWiki project itself).
BTW we are currently rewriting the whole rendering component so I
think this issue will disappear in a near future, Vincent can you
confirm ?


-- 
Jean-Vincent Drean
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users


[xwiki-users] xwiki rendering questions / suggestions

2008-06-11 Thread Ari
Hello. My question / suggestion goes with two part.


PART 1

I've tried to figure out why the XWiki renders xwiki-headings as it
does. E.g "1 Title One" is rendered as 'Title
One'. I would like to change this to be h1-element instead of
h2-element.

At first I suspected that this change would require only small
modification in some velocity template. It seems that I was wrong. My
current guess is that this rendering is done somewhere in java (from
xwiki.hbm.xml I tracked the doc.XWikiDocument and with that my guess is
DefaultXWikiRenderingEngine.java). However, I don't know how/where I
should change the code.

Is there a flow-chart or something to describe the render-phase?


As the description of this list goes: I would suggest that the xwiki
rendering should be done in a straightforward way where syntax 1 would
be h1, 1.1 h2, 1.1.1 h3 and so on.



PART 2

Another suggestion is that minor fix would be implemented in rendering.
An example text and the rendered result:

--
this is text before list.
* this
* is
* list
this is text after list.
--
this is text before list.

   this
   is
   list
this is text after list.
--

Also "this is text after list" should be rendered as paragraph. A
workaround is to write:

--
this is text before list.
* this
* is
* list


this is text after list.
--
this is text before list.

  this
  is
  list

this is text after list.
--


Same goes with lists with - * and #.


With Best Regards,
ari
___
users mailing list
users@xwiki.org
http://lists.xwiki.org/mailman/listinfo/users