如何向TWiki添加自定义标记?

时间:2021-09-28 06:33:34

At a previous place where I worked a colleague figured out how to configure MediaWiki so that, for example, a string like #12345 in the wiki markup could be expanded into a hypertext link to ticket 12345 in the ticket system.

在我工作的前一个地方,一位同事想出了如何配置MediaWiki,以便例如,wiki标记中的#12345之类的字符串可以扩展为票证系统中票证12345的超文本链接。

I would like to do something similar in TWiki. I have not yet figured out how, though. So, if I do, I'll try and answer this question, then. :)

我想在TWiki中做类似的事情。但我还没弄明白怎么样。所以,如果我这样做,我会尝试回答这个问题。 :)

-danny

2 个解决方案

#1


2  

If the InterwikiPlugin is enabled one can easily add a "wiki link" via the InterWikis node in TWiki. This is not quite full-fledged custom markup, but implementing a link like RT:12345 is as easy as adding a table row like this:

如果启用InterwikiPlugin,可以通过TWiki中的InterWikis节点轻松添加“wiki链接”。这不是完全成熟的自定义标记,但实现像RT:12345这样的链接就像添加像这样的表行一样简单:

| RT | https://your-rt-server/Ticket/Display.html?id= | '$page' in RT system |

Then, wiki text that contains a string like RT:12345 would be expanded in to a hyperlink to https://your-rt-server/Ticket/Display.html?id=12345

然后,包含RT:12345等字符串的wiki文本将扩展为https://your-rt-server/Ticket/Display.html?id = 12345的超链接

#2


2  

InterWiki links are probably the best way to link to an external site. Otherwise, you can write a TWikiplugin to either register a TWiki TAG handler (ie the %TAG% syntax) or to process the topic text as it goes through the renderer (somewhat slower).

InterWiki链接可能是链接到外部站点的最佳方式。否则,您可以编写TWikiplugin来注册TWiki TAG处理程序(即%TAG%语法)或处理主题文本,因为它通过渲染器(稍慢)。

Its not complex Perl, but :)

它不复杂的Perl,但:)

SvenDowideit

#1


2  

If the InterwikiPlugin is enabled one can easily add a "wiki link" via the InterWikis node in TWiki. This is not quite full-fledged custom markup, but implementing a link like RT:12345 is as easy as adding a table row like this:

如果启用InterwikiPlugin,可以通过TWiki中的InterWikis节点轻松添加“wiki链接”。这不是完全成熟的自定义标记,但实现像RT:12345这样的链接就像添加像这样的表行一样简单:

| RT | https://your-rt-server/Ticket/Display.html?id= | '$page' in RT system |

Then, wiki text that contains a string like RT:12345 would be expanded in to a hyperlink to https://your-rt-server/Ticket/Display.html?id=12345

然后,包含RT:12345等字符串的wiki文本将扩展为https://your-rt-server/Ticket/Display.html?id = 12345的超链接

#2


2  

InterWiki links are probably the best way to link to an external site. Otherwise, you can write a TWikiplugin to either register a TWiki TAG handler (ie the %TAG% syntax) or to process the topic text as it goes through the renderer (somewhat slower).

InterWiki链接可能是链接到外部站点的最佳方式。否则,您可以编写TWikiplugin来注册TWiki TAG处理程序(即%TAG%语法)或处理主题文本,因为它通过渲染器(稍慢)。

Its not complex Perl, but :)

它不复杂的Perl,但:)

SvenDowideit