Trac, wiki pages inheritance
I'm managing a project using trac. I have structured pages hierarchically and they look as this excerpt from TitleInd开发者_开发百科ex shows:
0.9
0.9 (this is a page)
Xyz
0.9/XyzFaq (this is a page)
0.9/XyzReleaseNotes (this is a page)
0.9/XyzRoadmap (this is a page)
The page called 0.9
contains this markup:
= Xyz version 0.9 main page =
Status: DEVELOPMENT
[[TitleIndex(0.9)]]
I'd like that subpages would inherit project development status from their parent. Is there a way to do this?
Thanks
This is quite easy to do with the macro system. If you want a ready-made macro, look at IncludeMacro, which would work like:
- In a wiki page called
Status/0.9
have just the textDEVELOPMENT
- In all pages below
0.9/
have a lineStatus: [[Include(Status/0.9)]]
If this is cumbersome, writing your own macro is quite simple. Basically just get the parent wiki page name from current page name with simple string processing, then open the wiki page and search for the Status:
line with a regex.
精彩评论