Edgewall Software
Modify

Opened 2 years ago

Closed 2 years ago

#12522 closed defect (fixed)

Multiline option documentation is rendered as a oneliner

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: 1.0.12
Component: general Version:
Severity: normal Keywords:
Cc:
Release Notes:

TracIni macro displays option documentation as multi-line rather than one-liner.

API Changes:

Description (last modified by Ryan J Ollos)

Option documentation such as [logging] log_format contains markup that should be rendered as multiple lines: tags/trac-1.0.11/trac/env.py#L241.

With a minor change, the text could be rendered as multi-line.

  • trac/htdocs/css/wiki.css

    diff --git a/trac/htdocs/css/wiki.css b/trac/htdocs/css/wiki.css
    index 722d7c4..5434503 100644
    a b div.tracini td.nodefault {  
    119119 font-style: italic;
    120120 white-space: nowrap;
    121121}
     122div.tracini td p { margin: 0 }
  • trac/wiki/macros.py

    diff --git a/trac/wiki/macros.py b/trac/wiki/macros.py
    index 450393d..8c4ff8a 100644
    a b class TracIniMacro(WikiMacroBase):  
    807807             format_to_html(self.env, formatter.context, section_doc),
    808808             tag.table(class_='wiki')(tag.tbody(
    809809                 tag.tr(tag.td(tag.code(option.name)),
    810                         tag.td(format_to_oneliner(self.env, formatter.context,
    811                                                   option.doc)),
     810                        tag.td(format_to_html(self.env, formatter.context,
     811                                              option.doc)),
    812812                        default_cell(option),
    813813                        class_='odd' if idx % 2 else 'even')
    814814                 for idx, option in

Attachments (2)

Screen Shot 2016-06-29 at 17.44.31.png (159.9 KB ) - added by Ryan J Ollos 2 years ago.
Screen Shot 2016-06-29 at 17.44.13.png (152.5 KB ) - added by Ryan J Ollos 2 years ago.

Download all attachments as: .zip

Change History (6)

Changed 2 years ago by Ryan J Ollos

Changed 2 years ago by Ryan J Ollos

comment:1 Changed 2 years ago by Ryan J Ollos

Description: modified (diff)

comment:2 Changed 2 years ago by Ryan J Ollos

If the change is made, we may want to consider a small margin between paragraphs, and reformatting some of the option documentation. The latter point may make the change more suitable for 1.2 since changes to option documentation would require updates to l10n catalogs, and should be minimized to prevent extra work for translators.

comment:3 in reply to:  description Changed 2 years ago by Jun Omae

That looks good to me. IniAdminPlugin renders the documents using wiki_to_html at source:iniadminplugin/0.11/iniadmin/templates/iniadmin.html@13607:50#L21.

  • trac/htdocs/css/wiki.css

    diff --git a/trac/htdocs/css/wiki.css b/trac/htdocs/css/wiki.css
    index 722d7c4..5434503 100644
    a b div.tracini td.nodefault {  
    119119 font-style: italic;
    120120 white-space: nowrap;
    121121}
     122div.tracini td p { margin: 0 }

I think it might be good to use 0-margin for first and last paragraphs.

div.tracini td > p:first-child { margin-top: 0 }
div.tracini td > p:last-child { margin-bottom: 0 }

In my environment, I use 0-margin for first and last children in table cell like this.

table.wiki th > :first-child, table.wiki td > :first-child { margin-top: 0 }
table.wiki th > :last-child, table.wiki td > :last-child { margin-bottom: 0 }

comment:4 Changed 2 years ago by Ryan J Ollos

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

0-margin for first and last looks good. Committed to 1.0-stable in r14897, merged to 1.2-stable in r14898, merged to trunk in r14899.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted.
to The owner will be changed from Ryan J Ollos 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.