Edgewall Software

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#12633 closed enhancement (fixed)

TracIni macro should have a way to specify exact section and option names to render

Reported by: Jun Omae Owned by: Jun Omae
Priority: normal Milestone: 1.2.1
Component: wiki system Version:
Severity: normal Keywords: trac.ini
Cc: Branch:
Release Notes:

Add section and option named arguments which do glob matching to [[TracIni]] macro.

API Changes:
Internal Changes:


[[TracIni(notification)]] and [[TracIni(notification-subscriber)]] are used in TracNotification page. However, [notification-subscriber] section is rendered twice.

It is caused by [[TracIni(notification)]] rendering both notification and notification-subscriber sections. I think it is intend to render only notification section.

Then, the macro should have a way to specify exact section and option names to render, e.g.:

  • [[TracIni(section=notification)]]: render notification section
  • [[TracIni(section=notification-*)]]: render sections matched notification-* pattern
  • [[TracIni(option=smtp_enabled)]]: render smtp_enabled options in any sections
  • [[TracIni(option=smtp_*)]]: render options matched smtp_* pattern in any sections
  • [[TracIni(section=notification,option=mime_encoding)]]: render [notification] mime_encoding

Attachments (0)

Change History (8)

comment:1 by Ryan J Ollos, 6 years ago

Keywords: tracini added

Good idea. See also #9401.

comment:2 by Jun Omae, 6 years ago

I noticed an issue that document of all sections and matched options are rendered. I think it is intended to render sections which include matched options and the options.

E.g. [[TracIni(,smtp_enabled)]] should render only [notification] section and smtp_enabled option. However, all sections are rendered.

comment:3 by Jun Omae, 6 years ago

Milestone: next-stable-1.2.x1.2.1
Owner: set to Jun Omae
Status: newassigned

Proposed changes in [f69828124/jomae.git].

comment:4 by Ryan J Ollos, 6 years ago

I noticed that glob matching is done for the ordered argument. Both produce the same output:

  • [[TracIni(,option=max_*_size)]]
  • [[TracIni(,max_*_size)]]

Is that the desired behavior, or should [[TracIni(,max_*_size)]] only match an option named max_*_size?

It's unfortunate that the macro was originally implemented to match names starting with the specified section and option. The macro would have been better if it was originally implemented to do glob matching. Given the existing behavior, I think the choices you made are the best we can do while preserving backward compatibility.

Last edited 6 years ago by Ryan J Ollos (previous) (diff)

comment:5 by Jun Omae, 6 years ago

Thanks for the reviewing. Revised changes in [63798ea90/jomae.git]. The ordered arguments don't glob matching.

comment:6 by Ryan J Ollos, 6 years ago

Changes look good to me.

comment:7 by Jun Omae, 6 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Thanks, again. Committed in [15296] and merged in [15297].

comment:8 by Jun Omae, 6 years ago

Keywords: trac.ini added; tracini removed

Normalizing keywords.

Modify Ticket

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