Can YARD do this?

C

Claus Folke Brobak

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 : "<h2>Section 2</h2>"

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
 
B

Benedikt Müller

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

[1]: http://haml-lang.com

2010/2/27 Claus Folke Brobak said:
RDoc can be used to convert a string, possibly with RDoc "tags", to
HTML.
Example:

=C2=A0require 'rubygems'
=C2=A0require 'rdoc/markup/to_html'

=C2=A0h =3D RDoc::Markup::ToHtml.new()
=C2=A0puts h.convert('=3D=3D Section 2') =C2=A0# Output : "<h2>Section 2<= /h2>"

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



--=20
Gru=C3=9F, Benedikt
 
C

Claus Folke Brobak

Benedikt said:
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
 
R

Robert Klemme

Benedikt said:
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.

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

Did you consider Textile or Markdown?

http://redcloth.org/

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

Kind regards

robert
 
C

Claus Folke Brobak

Robert said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top