Edgewall Software
Modify

Opened 2 years ago

Closed 2 years ago

Last modified 2 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:
Release Notes:

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

API Changes:

Description

[[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 Changed 2 years ago by Ryan J Ollos

Keywords: tracini added

Good idea. See also #9401.

comment:2 Changed 2 years ago by Jun Omae

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 Changed 2 years ago by Jun Omae

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

Proposed changes in [f69828124/jomae.git].

comment:4 Changed 2 years ago by Ryan J Ollos

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 2 years ago by Ryan J Ollos (previous) (diff)

comment:5 Changed 2 years ago by Jun Omae

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

comment:6 Changed 2 years ago by Ryan J Ollos

Changes look good to me.

comment:7 Changed 2 years ago by Jun Omae

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

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

comment:8 Changed 2 years ago by Jun Omae

Keywords: trac.ini added; tracini removed

Normalizing keywords.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Jun Omae.
The resolution will be deleted.
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.