How to define parent and subpages in Trac?

北战南征 提交于 2019-12-11 09:37:46

问题


I know the Confluence wiki pretty well, and I like much the natural hierarchy of pages you get there. I have to use now a Trac wiki (which is not that bad, same root as MoinMoin), and am searching the feature here. What I want to reach:

  1. Edit the page "MyPage" and enter there the link to a page you want to be a subpage, eg. MySubPage.
  2. The link should be similar to /MySubPage or [/MySubPage]. The character "/" denotes that the resulting page should be a subpage of the current one.
  3. Follow the link, create the new page with some content.

You should now see, that "MySubPage" is a subpage of "MyPage". You could reach the subpage from anywhere by the link MyPage/MySubPage.

The MoinMoin wiki has that feature at least from version 1.5.x, and I have used that regularily. Is there something similar in Trac? Do I have to install then a plugin?

Thank you a lot

Markus


回答1:


The only way I have found to do something like this is to specify the full path to the page. For your example this would be [[MyPage/MySubPage]]. You then get a hierarchy in TitleIndex, but it leaves much to be desired in terms of presenting a Parent/Child relationship.

I think, as retracile mentioned, that MyPage/MySubPage does not create a true hierarchy, but rather just a page containing a forward slash in the name, and in TitleIndex the pages are presented such that they appear to be in a hierarchy (but often do not display the way you would like; as I mentioned it leaves much to be desired).




回答2:


Well, not the best thing to answer the own question, but just something I found out.

 * SubpageFirst
 * SubpageSecond
 * SubpageThird
 * SubpageFourth

leads to (of course) four pages, but when you have a look at them in Title Index, you will see:

 * Subpage
   * First
   * Second
   * Third
   * Fourth

Not what I have searched for, but comes near.




回答3:


Parent-child wiki pages aren't directly modeled in Trac. Essentially, "/" is allowed as part of a wiki page name.

You should be able to create a macro that does something like what you want; essentially:

[[sub(MySubPage)]]


来源:https://stackoverflow.com/questions/1287806/how-to-define-parent-and-subpages-in-trac

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!