Edgewall Software

Ticket #3910 (closed enhancement: wontfix)

Opened 22 months ago

Last modified 21 months ago

Add ad-hoc functionality to pages

Reported by: anonymous Owned by: jonas
Priority: normal Milestone:
Component: wiki system Version: 0.10
Severity: normal Keywords:
Cc:

Description

(Disclaimer: I'm new to trac).

As far as I understand, if I want a page that is dynamic - gathering data from other pages and displaying it, then I need to create a plugin, and use a macro defined by this plugin.

This is cumbersome when I want this functionality for just one page.

It would be nice to be able to write the code in the page itself. For example, a syntax to embed python code in the page - accessing the trac API, or querying the DB.

Attachments

Change History

Changed 22 months ago by anonymous

  • type changed from defect to enhancement

opened as bug by mistake

Changed 22 months ago by cboos

... one could write a plugin doing just that ;)

Changed 22 months ago by anonymous

then i suggest it'll be a core plugin (comes with the system)

Changed 22 months ago by cboos

No, I don't think so... my suggestion was meant to be humorous, sorry ;)

It's way too easy to shoot yourself in the foot with such a thing. Moreover, the security implication of this imply that you would have to restrict writing such embedded code to TRAC_ADMIN only... and TRAC_ADMIN has by definition access to the Trac server and therefore he can already easily upload plugins using the WebAdmin. Single file plugins are quite easy to write anyway, see TracDev/PluginDevelopment#Writingtheplugincode for example, so you don't gain much by being able to write this inside a wiki page.

You already have many other "generic" ways to produce dynamic content: the TicketQuery macro is one example, the TracWikiTemplates plugin is another, etc.

Of course, ideas for enhancing the TicketQuery macro are welcomed. For example, the idea to generalize that to some kind of query langage for the whole Trac system has some appeal to me. But enabling Python code embedded in Wiki pages to be executed will probably never be part of Trac core.

Changed 21 months ago by cboos

  • status changed from new to closed
  • resolution set to wontfix

So back to the original topic:

It would be nice to be able to write the (Python) code in the page itself.

I'll close that as wontfix.

For the idea of generalizing the TicketQuery language, see #2465.

Add/Change #3910 (Add ad-hoc functionality to pages)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.