Ruby 相当于 Sphinx 文档生成器?

发布于 2025-01-07 16:47:51 字数 156 浏览 6 评论 0原文

Ruby 有一些很好的文档生成器,例如 Yard、rDoc,甚至 Glyph。问题是 Sphinx 提供网站、PDF、epub、LaTex...等。它在重组文本中完成所有这些事情。

在 Ruby 世界中还有其他选择吗?也许是程序的组合?如果我也能使用 Markdown 那就更好了。

Ruby has a few good document generators like Yard, rDoc, even Glyph. The thing is that Sphinx does websites, PDF's, epub, LaTex...etc. It does all these things in restructuredtext.

Is there an alternative to this in the Ruby world? Maybe a combination of programs? If I could use Markdown as well that would be even better.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

命硬 2025-01-14 16:47:51

从版本 1.0 开始,Sphinx 就有了“域”的概念,它是从 Python 和/或 C 以外的语言标记代码实体(如方法调用、对象、函数等)的方法。

有一个 ruby 域,所以你可以只使用 Sphinx 本身。您唯一会缺少的(我认为)是 Sphinx 使用 autodoc 从源代码自动创建文档的能力 扩展,专门用于 Python 代码。

Since version 1.0, Sphinx has had a concept of "domains" which are ways of marking up code entities (like method calls, objects, functions, whatever) from lannguages other than Python and/or C.

There is a ruby domain, so you could just use Sphinx itself. The only thing you would be missing (I think) is Sphinx's ability to create documentation from source automatically using the autodoc extension, which works specifically on Python code.

戈亓 2025-01-14 16:47:51

如果你想使用 Markdown,你可以查看 JDoc,这是一个非常简单的、基于 Ruby 的文档允许您使用广泛支持的标记并将其置于源代码控制之下的框架。它允许您在选择的文本编辑器中编辑文档,并且它支持:

  • Markdown 或 Textile
  • 语法突出显示
  • 简单的内部链接
  • 分层文档结构(对大型项目有用)
  • 可定制的样式和结构(但开箱即用看起来也不错) )

它生成静态 HTML,因此生成的文档易于托管,并且不会对服务器负载产生太大影响。

要查看其实际效果,请访问 wpmvc.org

If you want to use Markdown, you might check out JDoc, which is a very simple, Ruby-based documentation framework that lets you use widely-supported markup and put it under source control. It lets you edit the documentation in your text editor of choice, and it supports:

  • Markdown or Textile
  • syntax highlighting
  • easy internal links
  • a hierarchical documentation structure (useful for large projects)
  • customizable styling and structure (but it looks nice out of the box, too)

It generates static HTML, so the resulting documentation is easy to host and doesn't have much of an impact on your server load.

To see it in action, check out wpmvc.org.

谢绝鈎搭 2025-01-14 16:47:51

另外两个选项是使用 Middleman,它是一个静态站点生成器,接受 Kramdown 或 Markdown 作为输入。

还有一些专门为使用 Middleman 的技术文档设计的框架(两者都在 GitHub 上),包括 lord/slate 和 pnerger/dpslate(后者是前者的分支,并提供了一些不适合拉取的增强功能) 。 Slate 格式提供了一种文档格式,其中包含 Sphinx 的许多功能以及一些其他增强功能。它具有文档的三窗格视图,其中包括自动生成的目录、主中心正文以及右侧的示例代码面板。与 Sphinx 一样,示例代码具有语法突出显示。

Another couple of options would be to use Middleman which is a static site generator that accepts either Kramdown or Markdown as input.

There are also frameworks that are designed specifically for technical documentation that use Middleman (both of which are on GitHub) including lord/slate and pnerger/dpslate (the later is a fork of the former and provides some enhancements that were not appropriate for pulling). The Slate format provides a format for documentation that includes many of the features of Sphinx with some additional enhancements. It features a three-pane view of a document which includes an automatically generated Table of Contents, a Main center body, and then sample code panel to the right. Like Sphinx the sample code has syntax highlighting.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文