#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 |
||
API Changes: | |||
Internal 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)]]
: rendernotification
section[[TracIni(section=notification-*)]]
: render sections matchednotification-*
pattern[[TracIni(option=smtp_enabled)]]
: rendersmtp_enabled
options in any sections[[TracIni(option=smtp_*)]]
: render options matchedsmtp_*
pattern in any sections[[TracIni(section=notification,option=mime_encoding)]]
: render[notification] mime_encoding
Attachments (0)
Change History (8)
comment:1 by , 8 years ago
Keywords: | tracini added |
---|
comment:2 by , 8 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 , 8 years ago
Milestone: | next-stable-1.2.x → 1.2.1 |
---|---|
Owner: | set to |
Status: | new → assigned |
Proposed changes in [f69828124/jomae.git].
comment:4 by , 8 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.
comment:5 by , 8 years ago
Thanks for the reviewing. Revised changes in [63798ea90/jomae.git]. The ordered arguments don't glob matching.
comment:7 by , 8 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Good idea. See also #9401.