如何在 Trac 中定义父页面和子页面?
我非常了解 Confluence wiki,而且我非常喜欢那里页面的自然层次结构。我现在必须使用 Trac wiki(这还不错,与 MoinMoin 相同),并且正在此处搜索该功能。我想要达到的目标:
- 编辑页面“MyPage”并在其中输入您想要成为子页面的页面的链接,例如。
我的子页面
。 - 该链接应类似于
/MySubPage
或[/MySubPage]
。字符“/”表示结果页面应该是当前页面的子页面。 - 点击链接,创建包含一些内容的新页面。
您现在应该看到,“MySubPage”是“MyPage”的子页面。您可以通过链接 MyPage/MySubPage 从任何地方访问子页面。
MoinMoin wiki 至少从 1.5.x 版本开始就有这个功能,而且我经常使用它。 Trac中有类似的东西吗?我必须安装插件吗?
非常感谢
马库斯
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:
- Edit the page "MyPage" and enter there the link to a page you want to be a subpage, eg.
MySubPage
. - The link should be similar to
/MySubPage
or[/MySubPage]
. The character "/" denotes that the resulting page should be a subpage of the current one. - 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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
好吧,这不是回答自己的问题的最佳答案,但这只是我发现的一些东西。
(当然)有四页,但是当您在标题索引中查看它们时,您会看到:
不是我搜索的内容,但很接近。
Well, not the best thing to answer the own question, but just something I found out.
leads to (of course) four pages, but when you have a look at them in Title Index, you will see:
Not what I have searched for, but comes near.
我发现做这样的事情的唯一方法是指定页面的完整路径。对于您的示例,这将是 [[MyPage/MySubPage]]。然后,您可以在 TitleIndex 中获得层次结构,但在呈现父/子关系方面,它还有很多不足之处。
我认为,正如 retracile 所提到的,MyPage/MySubPage 并没有创建真正的层次结构,而只是一个名称中包含正斜杠的页面,并且在 TitleIndex 中,页面的呈现方式使得它们看起来像处于层次结构中(但通常不会按照您想要的方式显示;正如我提到的,它还有很多不足之处)。
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).
父子 wiki 页面不是在 Trac 中直接建模的。本质上,"/" 允许作为 wiki 页面名称的一部分。
您应该能够创建一个宏来执行您想要的操作;本质上:
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: