开发者

Trac, wiki pages inheritance

开发者 https://www.devze.com 2023-03-04 13:18 出处:网络
I\'m managing a project using trac. I have structured pages hierarchically and they look as this excerpt from TitleInd开发者_开发百科ex shows:

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:

  1. In a wiki page called Status/0.9 have just the text DEVELOPMENT
  2. In all pages below 0.9/ have a line Status: [[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.

0

精彩评论

暂无评论...
验证码 换一张
取 消