3

Is it possible to generate RDoc in LaTeX format? I looked at RDoc and YARD, but didn't find what I need.

I am writing a documentation in LaTeX for my project in Ruby, and I need a way to easily embed the API reference, as an appendix or as a chapter, in the final PDF. The most convenient, for me, would be to generate LaTeX source from Ruby source files and include it where appropriate.

Piotr Turek
  • 346
  • 1
  • 2
  • 11

1 Answers1

2

I have no experience with it, but a short google-search shows:

Another possibility: DO you know the listings-package in LaTeX? There is also a ruby support. You would get no rdoc-commands, but maybe you could make LaTeX-commands in your code?


Papyrus is a plugin for RDoc that enables RDoc to generate PDF files. It's based on LaTeX. So there should be a intermediate TeX-file.

From the readme.rdoc of the github repository for papyrus:

This library is a plugin for Ruby’s documentation generator RDoc. It provides both a generator for outputting PDF (Portable document format) (the RDoc::Generator::Papyrus class) files and a formatter for turning the parsed RDoc markup into LaTeX code (RDoc::Markup::ToLaTeX; RDoc::Markup::ToLaTeX_Crossref adds cross-reference facilities).

knut
  • 27,320
  • 6
  • 84
  • 112
  • I have seen the second link, but I have no idea how to use it in practice. The second one is meant to produce PDFs, but I'll take a look whether it's possible to get the raw LaTeX output. I actually use the listings package to provide code examples, but I need something more automatic. – Piotr Turek Aug 15 '11 at 13:25
  • Both of these links are broken now, sadly. – Translunar Sep 17 '13 at 20:01
  • 1
    @mohawkjohn: I added another source. – knut Sep 17 '13 at 20:56