Edgewall Software
Modify

Opened 8 years ago

Closed 8 years ago

#12240 closed task (fixed)

Update Title, Include and PythonDoc macros

Reported by: Ryan J Ollos Owned by: Ryan J Ollos
Priority: normal Milestone: not applicable
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Ryan J Ollos)

The Genshi, [babel: Babel] and Bitten Trac sites use 3 macros:

  • Title.py
  • Include.py
  • PythonDoc.py

The sites have recently been upgraded to Trac 1.0 and the macros implement a no-longer-supported API and have stopped working. The issue has been reported in genshi:#604 and bitten:#847.

I've created the ticket in Trac so that we can consider adding these macros to the contrib directory.

Attachments (4)

Title.py (253 bytes ) - added by Ryan J Ollos 8 years ago.
Include.py (968 bytes ) - added by Ryan J Ollos 8 years ago.
PythonDoc.py (7.5 KB ) - added by Ryan J Ollos 8 years ago.
comment_title_macro.py (1.3 KB ) - added by Ryan J Ollos 8 years ago.

Download all attachments as: .zip

Change History (13)

comment:1 by Ryan J Ollos, 8 years ago

Description: modified (diff)

by Ryan J Ollos, 8 years ago

Attachment: Title.py added

by Ryan J Ollos, 8 years ago

Attachment: Include.py added

by Ryan J Ollos, 8 years ago

Attachment: PythonDoc.py added

comment:2 by Ryan J Ollos, 8 years ago

I haven't looked closely yet, but I imagine it's also possible that one or more of these macros is no longer needed, or could be replaced with a plugin from trac-hacks (e.g. th:IncludeMacro).

comment:3 by Ryan J Ollos, 8 years ago

Owner: set to Ryan J Ollos
Status: newassigned

comment:4 by Ryan J Ollos, 8 years ago

#2717, #3307 and #11163 have ideas for setting the page title. Unfortunately I don't see a way to do this with a macro, so I think we may want to just make the Title macro return an empty string for now, and address the issue as an enhancement to Trac through one of the aforementioned tickets.

comment:5 by Ryan J Ollos, 8 years ago

Proposed changes:

  • Remove Title macro from pages and keep page title in a #!comment so that we can restore after adding to Trac the ability to set the page title.
  • Install the IncludeMacro.
  • PythonDoc macro is still working, so nothing to do there (example: ApiDocs/0.6.x/genshi.template.astutil).

I'll make changes in a few days if nobody objects.

in reply to:  5 comment:6 by Ryan J Ollos, 8 years ago

  • Remove Title macro from pages and keep page title in a #!comment so that we can restore after adding to Trac the ability to set the page title.

I started the edits before realizing that the number of uses of the Title macro on the Edgewall pages was so large. I'm probably script the comment operation and do an export/modify/import on the wiki pages.

Version 0, edited 8 years ago by Ryan J Ollos (next)

by Ryan J Ollos, 8 years ago

Attachment: comment_title_macro.py added

comment:7 by Ryan J Ollos, 8 years ago

My grep/sed/awk/perl skills weren't up to par for accomplishing this on the command line, so I wrote a brute-force Python script. My plan is to:

  • Export: trac-admin $env wiki dump wiki-dump
  • Version control: git init wiki-dump; cd wiki-dump; git add *; git commit -am "Dumped pages."; cd ...
  • Mutate: python comment_title_macro.py wiki-dump
  • Review: cd wiki-dump; git diff .; cd ..
  • Import: trac-admin $env wiki load wiki-dump
Last edited 8 years ago by Ryan J Ollos (previous) (diff)

comment:8 by Ryan J Ollos, 8 years ago

The Title macro has been commented out on the Babel, Bitten and Genshi sites. The IncludeMacro has been installed. I also ran wiki upgrade to update the built-in documentation.

Including a file from the repository using IncludeMacro requires prefixing the path with source:, so I'll need to script additional edits for the Babel and Genshi sites. The number of edits required on the Bitten site was less than a dozen so I made the changes manually (e.g. wiki:Documentation/reports.html@3). There should be no issues now with the Bitten site, other than lacking the desired page title.

comment:9 by Ryan J Ollos, 8 years ago

Resolution: fixed
Status: assignedclosed

Edited Babel and Genshi wiki pages with:

find wiki-dump/ -type f -exec sed -i "s/\[\[Include(/\[\[Include(source:/g" {} \;

All issues should be resolved now.

Modify Ticket

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