Edgewall Software
Modify

Opened 18 years ago

Closed 15 years ago

#4356 closed enhancement (fixed)

WikiCreole markup

Reported by: chuckssmith@… Owned by: Christian Boos
Priority: low Milestone: 0.12
Component: wiki system Version: 0.9.6
Severity: major Keywords: creole
Cc: ilias@…, dfraser Branch:
Release Notes:
API Changes:
Internal Changes:

Description

Hi, I just installed Trac and my development team would like to use the WikiCreole (www.wikicreole.org) markup in our project wiki. Are there any plans to make a parser for Creole? If not, would you please be able to develop it? Full specs can be found at http://www.wikicreole.org/wiki/Creole0.3 Thank you!

—Chuck Smith

Attachments (3)

trac_wiki_creole-r4428.patch (2.9 KB ) - added by Christian Boos 18 years ago.
Adapt Trac WikiFormatting to be more compatible with WikiCreole
trac_wiki_creole-r9337.patch (13.5 KB ) - added by Christian Boos 15 years ago.
Patch updated to current trunk, improved [[…]] link support.
trac_wiki_creole-r9337.2.patch (14.5 KB ) - added by Christian Boos 15 years ago.
new version, adds support for forced line breaks (\\)

Download all attachments as: .zip

Change History (21)

comment:1 by Emmanuel Blot, 18 years ago

Keywords: plugin added
Resolution: wontfix
Status: newclosed

There is no plan to change the Wiki syntax.

You may want to write a plugin to support an alternative syntax (see th:wiki:WikiStart#Request-a-Hack)

comment:2 by Matthew Good, 18 years ago

The Creole syntax seems pretty similar to what Trac already supports. The th:WikiGoodiesPlugin adds a bold and italics syntax similar to the one used in Creole, so you could use that as a basis for a plugin adding Creole-style bold and italics.

comment:3 by Christian Boos, 18 years ago

Milestone: 0.11
Resolution: wontfix
Status: closedreopened

Yes, but that plugin only adds *bold* and /italic/ for single words. That could be extended to multiple words, but not across lines, as that spec says.

I've just gone through WikiCreole again, and I definitely think there are some good things that we can lift up from there:

  • use "|" as another separator in labeled links (links)
  • … hm, well, that's about it ;)

For supporting **bold text** and //italic text//, the current workaround is simply to go and patch the Formatter, and edit those tokens appropriately, e.g.

  • formatter.py

     
    151151    # Some constants used for clarifying the Wiki regexps:
    152152
    153153    BOLDITALIC_TOKEN = "'''''"
    154     BOLD_TOKEN = "'''"
    155     ITALIC_TOKEN = "''"
     154    BOLD_TOKEN = "**"
     155    ITALIC_TOKEN = "//"
    156156    UNDERLINE_TOKEN = "__"
    157157    STRIKE_TOKEN = "~~"
    158158    SUBSCRIPT_TOKEN = ",,"

It might even be interesting to see if we could have this notation in addition to the existing one.

comment:4 by Christian Boos, 18 years ago

Keywords: plugin removed
Severity: minornormal

… and support for line breaks in ticket descriptions and comments, for the reasons given there.

The links using double brackets [[... link ...]] could probably be supported as well, as it should be easy to distinguish them from macro calls.

in reply to:  3 comment:5 by anonymous, 18 years ago

Replying to cboos:

For supporting **bold text** and //italic text//, the current workaround is

  • formatter.py

     
    151151    # Some constants used for clarifying the Wiki regexps:
    152152
    153153    BOLDITALIC_TOKEN = "'''''"
    154     BOLD_TOKEN = "'''"
    155     ITALIC_TOKEN = "''"
     154    BOLD_TOKEN = r"\*\*"
     155    ITALIC_TOKEN = "//"
    156156    UNDERLINE_TOKEN = "__"
    157157    STRIKE_TOKEN = "~~"
    158158    SUBSCRIPT_TOKEN = ",,"

of course :P)

by Christian Boos, 18 years ago

Adapt Trac WikiFormatting to be more compatible with WikiCreole

comment:6 by Christian Boos, 18 years ago

In attachment:trac_wiki_creole-r4428.patch:

  • Bold And Italics compatibility
    • // and ** can be used as italic and bold markup, in addition to the existing ones '' and '''
    • they mix by pairs, e.g. you can't end a '' by a //.
  • Links Internal And External compatibility
    • "|" can be used as a separator between the link and the label
    • simple square brackets or double square brackets can be used for links ([...] or [[...]])

All the existing wiki unit-tests still pass, so I think it's a good sign that this additions won't disturb existing Trac Wiki pages.

comment:7 by ilias@…, 18 years ago

Cc: ilias@… added

comment:8 by Christian Boos, 18 years ago

Owner: changed from Jonas Borgström to Christian Boos
Status: reopenednew

comment:9 by Christian Boos, 18 years ago

Milestone: 0.110.12

WikiEngine refactoring and related fixes postponed. At that point, the (full) WikiCreole support could be easily added as a plugin.

comment:10 by fcorreia@…, 16 years ago

just listening…

comment:11 by dfraser, 15 years ago

Cc: dfraser added

There's a request for a plugin at th:#2863

comment:12 by dfraser, 15 years ago

There is now such a plugin at th:wiki:WikiCreoleRendererPlugin

in reply to:  12 comment:13 by Christian Boos, 15 years ago

Milestone: next-major-0.1X0.12

Replying to dfraser:

There is now such a plugin at th:wiki:WikiCreoleRendererPlugin

Fine, but that only supports Creole itself, and there you can't use the more advanced Trac's WikiFormatting and most importantly, you can't use the TracLinks

So I see in the comment:6 approach more useful, to have the regular Trac Wiki markup be a superset of the WikiCreole markup, or at least, move in that direction.

by Christian Boos, 15 years ago

Patch updated to current trunk, improved [[...]] link support.

by Christian Boos, 15 years ago

new version, adds support for forced line breaks (\\)

comment:14 by Christian Boos, 15 years ago

Any comment on this one trac_wiki_creole-r9337.2.patch?

comment:15 by Remy Blank, 15 years ago

Oops, missed that one. I'll test it this evening.

comment:16 by Remy Blank, 15 years ago

The patch seems to work fine, but I have to admit that the wiki parser and formatter code is still somewhat… opaque to me, so I can't really claim to have done a good review of the code. Still, +1.

Using the pipe as a separator between a link and its label is nice, as it avoids having to quote the link if it has spaces.

One question: why use <strong> for Trac-style bold, and <b> for WikiCreole bold? Same question for italic and <i> / <em>. Why not use the same element for both styles?

in reply to:  16 comment:17 by Christian Boos, 15 years ago

Replying to rblank:

The patch seems to work fine, but I have to admit that the wiki parser and formatter code is still somewhat… opaque to me, so I can't really claim to have done a good review of the code. Still, +1.

Using the pipe as a separator between a link and its label is nice, as it avoids having to quote the link if it has spaces.

Yes, and it makes it easier to deal with non-CamelCase names, [[0.12/]] is more convenient to type than ["0.12/"].

One question: why use <strong> for Trac-style bold, and <b> for WikiCreole bold? Same question for italic and <i> / <em>. Why not use the same element for both styles?

This is an implementation quirk due to the way the simple_tag_handler works. I'll see what I can do.

comment:18 by Christian Boos, 15 years ago

Keywords: creole added
Resolution: fixed
Severity: normalmajor
Status: newclosed

Patch queue committed in [9428:9431], which brings basic support for WikiCreole in Trac 0.12.

I've some good hope that in 0.13 we can get even better support (single pipe table syntax #6630, embedding links {{image.png}}, …).

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Christian Boos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Christian Boos to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.