Hi Guillaume,

On 25 Nov 2015 at 09:05:31, Guillaume Lerouge 
([email protected](mailto:[email protected])) wrote:

> Hi Devs,
>  
> as you probably noticed it, Markdown has recently become somewhat of a
> reference syntax for many developer tools, most notably GitHub. I have
> recently discussed with teams using XWiki who are also using GitHub and
> Slack and who are interested in being able to use Markdown syntax inside
> XWiki.
>  
> Although it is already possible to use Markdown syntax in XWiki in a
> limited way , I
> don't think that a wiki could really work with only Markdown, due to the
> following limitations:
>  
> 1. We have invested a lot in the XWiki rendering and the XWiki 2.1
> syntax in order to make them address a lot of use cases and work seamlessly
> with the WYSIWYG editor
> 2. Conversely, Markdown syntax is very limited by design
> and does not
> support many of the important features of XWiki syntax, forcing users to
> rely on HTML for a lot of use cases
>  
> What's interesting however is that Markdown syntax is very close to XWiki
> syntax in a number of regards, notably line breaks, bold and lists. Some
> notable differences include the syntax for links, images and code blocks.
>  
> My line of thinking is the following: what if we made it possible as an
> option for users of XWiki 2.1 syntax to have XWiki interpret the main
> elements of Markdown syntax? In practice, this would mean adding a set of
> 5-10 additional rules to the rendering engine.
>  
> The obvious benefit would be to improve adoption of XWiki by dev teams who
> are already familiar with Markdown. I don't see any obvious drawbacks
> (besides the need to code and maintain the feature of course), but I
> clearly don't master all the subtleties of the XWiki rendering engine.

There are lots of differences between Markdown and XWiki Syntax, they’re 
completely different actually (if I had to give a ratio I’d say 90% different). 
Also note that white spaces have meanings in Markdown.

You should know that each syntax has a parser. We’re using the pegdown parser 
to parse Markdown (we don’t do any work on our side on the parsing, we just 
adapt their events to the XWiki Rendering Events). And for the XWiki Syntax 
parser they are javacc-based parsers.

So theoretically it would be possible to implement a new XWiki Syntax 
altogether, although very difficult (XWiki Markdown Syntax 1.0 for example), 
but there are many drawbacks. Just to give 2:

1) It would be very very costly to develop and maintain (including having to 
develop a renderer for it! Something we haven’t even done for markdown because 
of lack of time/resource, so imagine having to code a new parser also).
2) It would confuse everyone: users knowing markdown and users knowing the 
xwiki syntax since nobody would recognize their syntax.

Last I want to mention that markdown is no longer the hip syntax. It’s been 
asciidoc for a while now. I’ve tried to integrate it several times but it’s 
missing a good java parser right now (they’re working on it, albeit slowly), 
see: http://jira.xwiki.org/browse/XRENDERING-323

Thanks for the idea though!

If we had some time to spend on this topic, I would spend it by implementing a 
Renderer for the Markdown syntax so that users could use Markdown in the 
WYSIWYG editor. Just note that this is quite complex to do and we would need to 
verify that we can express all HTML constructions in markdown.

Thanks
-Vincent

> Thanks,
>  
> Guillaume
> _______________________________________________
> devs mailing list
> [email protected]
> http://lists.xwiki.org/mailman/listinfo/devs

_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to