# Can YARD do this?

**URL:** <https://www.ruby-forum.com/t/can-yard-do-this/184259>\
**Category:** Ruby\
**Created:** [February 27, 2010, 3:22pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259 "2010-02-27T15:22:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Claus\_Folke\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@Claus\_Folke\_B](https://www.ruby-forum.com/u/Claus_Folke_B)\
**Post date:** [February 27, 2010, 3:22pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259/1 "2010-02-27T15:22:57Z")

</div>

RDoc can be used to convert a string, possibly with RDoc “tags”, to  
HTML.  
Example:

require ‘rubygems’  
require ‘rdoc/markup/to\_html’

h = RDoc::Markup::ToHtml.new()  
puts h.convert(’== Section 2’) # Output : “

## Section 2
”

The string could be the contents of a text file, and this is a  
functionality I use very often as a way to generate an HTML file from a  
text file.

I was wondering if YARD can be used the same way, that is, to generate  
HTML from plain text, possibly with RDoc “tags”?

I have not been able to find anything along these lines in the YARD  
documentation.

Claus

---

<div class="post-metadata">

**Author:** ![Claus\_Folke\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@Claus\_Folke\_B](https://www.ruby-forum.com/u/Claus_Folke_B)\
**Post date:** [February 27, 2010, 3:44pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259/2 "2010-02-27T15:44:04Z")

</div>

If I understand you right, haml[1](http://haml-lang.com) is the right thing for you!

2010/2/27 Claus Folke B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

---

<div class="post-metadata">

**Author:** ![Claus\_Folke\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@Claus\_Folke\_B](https://www.ruby-forum.com/u/Claus_Folke_B)\
**Post date:** [February 27, 2010, 5:18pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259/3 "2010-02-27T17:18:04Z")

</div>

Benedikt MÃ¼ller wrote:

> If I understand you right, haml[1] is the right thing for you!

After a brief look at HAML, I am not so sure you are right. 🙂

The nice thing about writing a text file i RDoc format is that the text  
file is very readable in itself. I write a lot of documents in text/RDoc  
format, then later publish them in HTML format.

I find using the same format for writing Ruby program documentation and  
stand-alone documents very handy. The reason for asking about YARD is  
that it has some nice features for specifying method parameters and  
return values in Ruby program comments.

Claus

---

<div class="post-metadata">

**Author:** ![Claus\_Folke\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@Claus\_Folke\_B](https://www.ruby-forum.com/u/Claus_Folke_B)\
**Post date:** [February 27, 2010, 6:15pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259/4 "2010-02-27T18:15:04Z")

</div>

On 27.02.2010 17:18, Claus Folke B. wrote:

> stand-alone documents very handy. The reason for asking about YARD is  
> that it has some nice features for specifying method parameters and  
> return values in Ruby program comments.

Looking at the architecture diagram I doubt it: it seems you always  
store content in the repository and documentation is generated from  
there. It seems this is not as simple as generating output directly.

[http://yardoc.org/docs/yard/file:docs/Overview.md](http://yardoc.org/docs/yard/file:docs/Overview.md)

Did you consider Textile or Markdown?

[http://redcloth.org/](http://redcloth.org/)

[http://tomayko.com/writings/ruby-markdown-libraries-real-cheap-for-you-two-for-price-of-one](http://tomayko.com/writings/ruby-markdown-libraries-real-cheap-for-you-two-for-price-of-one)

Kind regards

robert

---

<div class="post-metadata">

**Author:** ![Claus\_Folke\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/e36b37/32.png) [@Claus\_Folke\_B](https://www.ruby-forum.com/u/Claus_Folke_B)\
**Post date:** [February 27, 2010, 6:56pm UTC](https://www.ruby-forum.com/t/can-yard-do-this/184259/5 "2010-02-27T18:56:06Z")

</div>

Robert K. wrote:

> Did you consider Textile or Markdown?

Hi Robert,

Yes, I have taken a look at both. But as I wrote, I find it convenient  
to use the same markup when documenting Ruby program and writing  
stand-alone documents.

Claus
