Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

#3910 closed enhancement (wontfix)

Add ad-hoc functionality to pages

Reported by: anonymous Owned by: Jonas Borgström
Priority: normal Milestone:
Component: wiki system Version: 0.10
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

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 (0)

Change History (5)

comment:1 by anonymous, 18 years ago

Type: defectenhancement

opened as bug by mistake

comment:2 by Christian Boos, 18 years ago

… one could write a plugin doing just that ;)

comment:3 by anonymous, 18 years ago

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

comment:4 by Christian Boos, 18 years ago

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.

comment:5 by Christian Boos, 17 years ago

Resolution: wontfix
Status: newclosed

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.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jonas Borgström.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Jonas Borgström 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.