是否有一个很好的用于客户端 DocBook 渲染的 XSL 样式表?
我希望 SVN 存储库中的 DocBook 文档在有人在 Web 浏览器中查看时看起来很漂亮。我已经开始编写 CSS 样式表,但我认为它将有很大的限制——尤其是有关超链接的限制。
DocBook 站点 上有大量 DocBook XSL 样式表,但是它们似乎不适合浏览器渲染。我不想生成静态文档并将它们放入SVN。我希望它们对于其他开发人员来说基本上是可读的,没有太多麻烦。
我可以编写自己的适合浏览器的 XSL 样式表来将 DocBook 转换为 HTML,但似乎其他人一定已经这样做了。我只是不知道在哪里可以找到它。
I want the DocBook documents in my SVN repository to look nice if someone looks at them in a web browser. I've started to write a CSS stylesheet, but I think that it will have significant limitations -- particularly ones regarding hyperlinks.
There is a large body of DocBook XSL stylesheets at the DocBook site , but they don't seem to be appropriate for browser rendering. I don't want to generate static documents and put them into SVN. I want them to be basically readable for other developers without much hassle.
I could write my own browser-appropriate XSL stylesheet to convert DocBook to HTML, but it seems like someone else must have already done this. I just don't know where to find it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
在过去的生活中,我使用了所见即所得文档书:http://www.wysiwygdocbook。 cs.hs-rm.de/~werntges/proj/wysiwyg-dbk01.html
In a past life I used wysiwygdocbook: http://www.cs.hs-rm.de/~werntges/proj/wysiwyg-dbk01.html
你是对的,DocBook XSL 样式表非常重,并不适合在浏览器中运行。 DocBook Wiki 列出了一些 CSS 样式表,也许其中一个可能适合您?
我体验过的唯一一个是 XMLMind XML Editor 显然用来呈现 DocBook 文档的编辑器。
You are right, the DocBook XSL stylesheets are very heavy, and are not really suitable for running in a browser. The DocBook Wiki lists some CSS stylesheets, perhaps one of those might work for you?
The only one I have experience of is the one which XMLMind XML Editor apparently uses to present DocBook documents.
我已经为浏览器端 DocBook 样式完成了一些非常基本且不完整的 XSLT+CSS 实现。你可以在这里查看 http://github.com/arsi/db2xhtml
但我想如果有的话,请参阅更高级的项目!
I've done some XSLT+CSS very basic and incomplete implementation for browserside DocBook styling. You can check it out here http://github.com/arsi/db2xhtml
But I would like to see more advanced project if available somewhere!
[编辑,因为我误读了问题]
您当然不想通过浏览器和 PI 运行样式表,但您也不想对任何相当复杂的内容执行此操作。如果您在 Web 服务器上运行或作为批处理任务运行,请在服务器端执行此操作。有什么方法可以在 svn 中插入服务器端进程吗?
DocBook 是一种复杂的“语言”,捕捉 DocBook 的大部分微妙之处都非常困难。使用 DocBook XSL 一点也不复杂,如果可以的话,我真的建议您朝这个方向发展。样式表旨在进行自定义,并且由 Bob Stayton 在 DocBook XSL:完整指南。
[Edited because I misread the question]
You certainly wouldn't want to run the stylesheets via a browser and the PI but then you wouldn't want to do that for any reasonably complex content. Do it server side if you're running over a web server or as a batch task. Is there any way that you can interpose a server side process in svn?
DocBook is a complex 'language' and capturing even most of the subleties of DocBook is very difficult. Using the DocBook XSL is not complex at all and I really would recommend you go in that direction if you can. The stylesheets are designed to be customised and are extremely well documented by Bob Stayton in DocBook XSL: The Complete Guide.
经过相当多的搜索后,我相信答案是“除了像我实现的那样的定制样式表之外,没有一个很好的用于客户端 DocBook 渲染的 XSL 样式表”。
After quite a bit of searching, I believe the answer is "there is not a nice XSL stylesheet for client-side DocBook rendering," besides the bespoke ones like the one I implemented.
通常,您会生成一个“演绎版”以供阅读/显示。呈现形式可以是 PDF、单个 HTML 页面或一组 HTML 页面。您很少将文档直接传送到网络上。
我讨厌被问到“你的技术能做 X 吗?”它假设对产品有很多了解(另外,通常答案是“是”,但这并不能回答真正的问题)。当我问“你想实现什么目标”时总是最好的,这样我就可以告诉你是否有任何一项技术很适合(或者我可以向你指出其他更适合的技术,或者更好的方法来解决这个问题)。
Typically you'd produce a 'rendition' for reading/display. The rendition can either be PDF, a single HTML page, or set of HTML pages. It's rare that you deliver docbook directly to web.
I hate getting the question that asks "can your technology do X?" It assumes a lot of knowledge about the product (plus, usually the answer is "yes" but that doesn't answer the real question). It's always best when I ask -- "what are you trying to accomplish" -- so I can tell you whether or not any piece of technology is a good fit (or I can point you to some other piece that's a much better fit, or a better way to go about it).