Archive

Last modified by Vincent Massol on 2008/12/20 13:47

Blog - XWiki - posts for April 2009

Apr 29 2009

New XWiki 2.0 wiki syntax

Starting with XWiki Enterprise 1.7 we've released a new wiki syntax for XWiki (Since XWiki is now Polyglot you can continue to use the old XWiki syntax or use other wiki syntaxes). We're calling this new syntax by the delicious and original name of "XWiki 2.0 Syntax".

Here are some salient points of this new syntax:

  • More consistent syntax and less error prone. All special syntax characters such as bold symbols, italics symbols, link symbols, etc all use 2 characters to prevent ambiguity in case you wish to use that character in your text. For example for bold you can write: 
**bold** but this is a star *
  • Very close to Creole 1.0 (see the Creole 1.0 syntax). The goal of Creole is "a common wiki markup language to be used across different wikis. It's not replacing existing markup but instead enabling wiki users to transfer content seamlessly across wikis, and for novice users to contribute more easily".
  • Meaningful new lines and spaces. This mean new lines are honored unlike traditional wiki-style new lines which are ignored. This was the number one feature asked by our users.
  • Ability to enter wiki syntax in link labels. For example to add an image link you'd write: 
[[image:Space.Page@my.png>>reference]]
  • Ability to pass parameters to any syntax elements including the ability to easily style them. For example to style a portion of text or a section header you can use: 
Some (% class="myclass" style="background-color:#E4E4E5" %)styled text
(% style="color:blue" %)
== header
  • HTML must now be entered using the HTML macro. This allows to enter non-interpreted HTML in the main text. It also provides security control to wiki admins if they want to prevent users from entering HTML (and thus potentially harmful javascript). In addition the HTML macro automatically converts invalid HTML into valid XHTML.
  • Easy linking to attachments using the link syntax. For example: 
[[label>>attach:Space.Page@img.png]]
  • Strong table syntax including ability to have table headers as columns or as rows.
  • Added scripting macros to enter XWiki scripts (We support JSR 223). For now we have official support for Velocity, Groovy and Jython, meaning that the full XWiki API is available directly to you using any of these scripting languages.
  • Email-style quotations. For example: 
> john said this
>> marie answered that
  • Ability to group syntax elements together and thus support very complex use cases such as a table inside a list item inside a table. For example: 
| (((
* item1
* item2
)))
  • The syntax is powerful enough to represent most HTML elements thus allowing us to have a 100% bidirectional WYSIWYG editor with no information loss.
  • Syntax for monospace, verbatim, definition lists, and more.

See the XWiki 2.0 Syntax Guide for more details. Note that we have an automatic converter that converts XWiki 1.0 syntax into 2.0 syntax.

We hope you'll enjoy this new syntax which we've tried to make the most powerful wiki syntax out there. Feedbacks welcome! emoticon_smile

Apr 05 2009

How to improve XWiki comments experience

XWiki Enterprise allows users to leave comments on pages. However in order to prevent spam on your public wiki instance you usually only want to allow registered users the right to add comments. Thus we need a solution that still allows guest users to leave comments while preventing spam.

I'm proposing 2 solutions that I've both tried on this blog and that have worked well: Solution 1: create a special guest account that can be used transparently to leave comments. This can be achieved by creating a custom skin and tweaking the comments form Solution 2: integrate with an external comment web service such as IntenseDebate. This also requires a custom skin in order to override some templates.

Solution 1: Special Guest account

  • Create a "Guest" user by going to the Administration page.
  • Modify the Skins class so that the comments property points to the commentsinline.vm file (instead of the comments.vm one). Go to the XWiki.XWikiSkins page and change the Name field for the Comments property to "commentsinline.vm". Save.
  • In the Administration page, click on the Presentation icon and then click on the "Customize" button in the Skin section. Click "Edit this Skin" to edit the skin.
  • Modify the "Style" property field for better avatar display with the following content.
  • Modify the "Comments" property field with the following content. This change adds several fields to the comments form that guest users can fill and provide a direct link to log in guest users.

When done you should get the following comment feature:

solution1.png

Solution 2: Integration with IntenseDebate

  • Register on IntenseDebate to get a key to interact with their system.
  • Modify the Skins class to add 2 new fields so that we can override them. Go to the XWiki.XWikiSkins page and use the right panel to add 2 text area fields named "htmlfooter.vm" and "docextra.vm". Save.
  • In the Administration page, click on the Presentation icon and then click on the "Customize" button in the Skin section. Click "Edit this Skin" to edit the skin.
  • Modify the newly added "htmlfooter.vm" property field by adding the following content.
  • Modify the newly added "docextra.vm" property field by adding the following content. Make sure you modify the replace-with-your-intense-debateid-here value in the pasted content with your IntenseDebate id.

Here's what you'd get:

solution2.png

IntenseDebate is really nice and it offers the following features:

  • Comment threading
  • Reply by email
  • Importing / exporting comments
  • Commenter profiles
  • Reputation points and comment voting
  • Moderation / blacklisting, Profanity filter and Akismet spam filtering
  • Widgets
  • RSS feeds and reader tracking
  • Twitter / friendfeed integration
  • OpenID authentication
  • Commenter gravatar
  • HTML formatting
Tags:
Tags:
Created by Vincent Massol on 2008/12/20 13:47
This wiki is licensed under a Creative Commons 2.0 license