我正在尝试使用版本 3.5.3 来美化我的 rdoc 文档。我不喜欢内置的 darkfish 主题,因此我尝试找到一种方法将其替换为官方 Rails API 文档所使用的主题,网址为 http://api.rubyonrails.org/,但我没有运气以任何现成的形式找到它。我已经在 github 上进行了各种搜索。
到目前为止我发现的是
这可能有点已经过时了,而且它已经分叉
两者不错,但不完全是我想要的。因此,在我开始摆弄这些模板之前,有谁知道 Rails API 文档使用的模板是否可以在某个地方作为 gem 使用?
谢谢!
I'm trying to prettify my rdoc documentation, using version 3.5.3. I'm not a fan of the built-in darkfish theme, so I tried to find a way to replace it with the one used by the official Rails API documentation at http://api.rubyonrails.org/, but I've had no luck finding it in any readily available form. I've searched all over github, among other things.
What I've found so far is
which might be slightly out of date, and it's fork
Both are nice, but not quite what I want. So before I start fiddling with those templates, does anyone know if the template used by the Rails API docs is available as a gem somewhere?
Thanks!
发布评论
评论(2)
我知道这已经很晚了,但看起来新版本的 Rails 使用了名为 sdoc 的东西,它通过 JavaScript 搜索增强了输出,并且在我看来更干净一些。执行简单的“gem install sdoc”即可获得您需要的内容,然后只需使用 rdoc.options << '-f' << 'sdoc'。
位于https://github.com/voloko/sdoc/
github项目似乎 ,谢谢提问!如果没有发布最初的答案,我将永远找不到该看的地方,并且在我自己的项目中一直被那个可怕的黑鱼主题所困扰!
I know this is very late, but it looks like the new version of Rails uses something called sdoc, which enhances the output with JavaScript searching, and is a little cleaner IMO. Doing a simple "gem install sdoc" will get what you need, then just use
rdoc.options << '-f' << 'sdoc'
.The github project appears to be at https://github.com/voloko/sdoc/
By the way, thanks for the question! Without the initial answer posted, I'd have never found where to look, and been stuck with that horrible darkfish theme for my own projects!
这看起来是这样的。忽略执行
gem install horo --pre
的说明——这实际上会给您提供较旧的测试版。只需执行gem install horo
,您将获得当前的 1.0.3 版本(编辑:我发送了一个拉取请求来更新说明,该请求已被接受)。https://github.com/tenderlove/horo
顺便说一下,我通过查看 < a href="http://github.com/rails/rails" rel="nofollow">Rails 源代码 并查看
Rakefile
以查看 RDoc 选项。具体来说,第 67 行显示了 rdoc.options << '-f' << 'horo'。This looks like it. Ignore the instructions that say to do a
gem install horo --pre
-- that'll actually give you an older beta version. Just dogem install horo
and you'll get the current 1.0.3 version (Edit: I sent a pull request to update the instructions, which has already been accepted).https://github.com/tenderlove/horo
By the way, I found this by looking at the Rails source code and viewing the
Rakefile
to see the RDoc options. Specifically, line 67 showsrdoc.options << '-f' << 'horo'
.