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 )
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)
Change History (13)
comment:1 by , 8 years ago
Description: | modified (diff) |
---|
by , 8 years ago
by , 8 years ago
Attachment: | Include.py added |
---|
by , 8 years ago
Attachment: | PythonDoc.py added |
---|
comment:2 by , 8 years ago
comment:3 by , 8 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
comment:4 by , 8 years ago
follow-up: 6 comment:5 by , 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.
comment:6 by , 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.
by , 8 years ago
Attachment: | comment_title_macro.py added |
---|
comment:7 by , 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
comment:8 by , 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 , 8 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
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.
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).