osimons | 9 Dec 2010 16:50
Picon

[Trac-dev] Re: Wiki syntax provider question

On Dec 9, 2:39 pm, Henrik <hjoens... <at> gmail.com> wrote:
> Hi,
>
> I have tried to write a new wiki syntax provider to create links to
> our NCR system (IBM Telelogic Synergy). These NCR's looks like this,
> cbxpt_se#1234. I have managed to create my own class (see below).
> However, it works at the moment for this syntax, cbxpt_se:1234. So my
> question, is it possible to adapt my wikisyntaxprovider to match #
> instead of :? Or is this reserved for trac ticket links, #1234?
>
> class cbxptWikiSyntax(Component):
>
>     implements(IWikiSyntaxProvider)
>
>     def get_link_resolvers(self):
>         return [ ('cbxpt_se', self._format_link) ]
>
>     def get_wiki_syntax(self):
>         return []
>
>     def _format_link(self, formatter, ns, target, label):
>                 url = "http://stoweb01.scan.bombardier.com/~ebiconfig/
> infopoint/index.php?
> option=com_rcs_ncr_reports&action=detailedReport&type=cr&name=cbxpt_se
> %C2%A7"
>                 if target.isdigit():
>                     return tag.a(
>                         "cbxpt_se#%d" % int(target),
>                         href = url + target,
>                         title = "View cbx_pt #%d on infopoint" %
(Continue reading)

Henrik | 9 Dec 2010 17:09
Picon

[Trac-dev] Re: Wiki syntax provider question

Thanks for the answer. Howerver, I use the ticket system so I can't
disable it. Is it possible to disable the internal trac link somehow?
I'm a python newbie, I don't understand how my custom syntax provider
gets hooked up with : and not #.

/Henrik

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
To unsubscribe from this group, send email to trac-dev+unsubscribe <at> googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.

Noah Kantrowitz | 9 Dec 2010 19:09
Gravatar

Re: [Trac-dev] Re: Wiki syntax provider question

You defined a link resolver, not a new bit of syntax. Standard links [foo:bar baz] are abstracted to make
them a bit easier to add. Look at the wiki syntax providers for the tickets or wiki system to see how to write a
syntax regex.

--Noah

"Henrik" <hjoensson <at> gmail.com> wrote:

>Thanks for the answer. Howerver, I use the ticket system so I can't
>disable it. Is it possible to disable the internal trac link somehow?
>I'm a python newbie, I don't understand how my custom syntax provider
>gets hooked up with : and not #.
>
>/Henrik
>
>-- 
>You received this message because you are subscribed to the Google
>Groups "Trac Development" group.
>To post to this group, send email to trac-dev <at> googlegroups.com.
>To unsubscribe from this group, send email to
>trac-dev+unsubscribe <at> googlegroups.com.
>For more options, visit this group at
>http://groups.google.com/group/trac-dev?hl=en.

-- 
Sent from my Android phone with K-9 Mail. Please excuse my brevity.

--

-- 
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac-dev <at> googlegroups.com.
(Continue reading)


Gmane