# Bug in rdoc?

**URL:** <https://www.ruby-forum.com/t/bug-in-rdoc/72322>\
**Category:** Ruby\
**Created:** [October 16, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322 "2006-10-16T13:10:17Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 16, 2006, 1:10pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/1 "2006-10-16T13:10:17Z")

</div>

– The following example, is taken from the rdoc documentation.  
For the long options, it converts – into — (a long hyphen)  
instead of two separate hyphens with some whitespace in between.  
(see www.servalys.nl/ doc/index.html for the output)

=begin rdoc

–output _name [, name]_::  
specify the name of one or more output files. If multiple  
files are present, the first is used as the index.

–quiet::: do not output the names, sizes, byte counts,  
index areas, or bit ratios of units as  
they are processed.

=end

Is this a bug in rdoc?

Wybo

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 16, 2006, 3:57pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/2 "2006-10-16T15:57:40Z")

</div>

On Oct 16, 2006, at 7:10 AM, Wybo D. wrote:

> –quiet::: do not output the names, sizes, byte counts,  
> index areas, or bit ratios of units as  
> they are processed.
> 
> =end
> 
> Is this a bug in rdoc?

No, it’s a feature.

Back in the old days, when people typed on typewriters, which didn’t  
have an em-dash (what you call a long hyphen) key, two hyphens were  
used to indicate an em-dash. Since the ASCII character set doesn’t  
have em-dash, this convention is carried over to rdoc.

Why does this bother you?

Regards, Morton

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 16, 2006, 4:15pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/3 "2006-10-16T16:15:43Z")

</div>

On 10/16/06, Morton G. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > ```
> > specify the name of one or more output files. If multiple
> > 
> > ```
> 
> No, it’s a feature.
> 
> Back in the old days, when people typed on typewriters, which didn’t  
> have an em-dash (what you call a long hyphen) key, two hyphens were  
> used to indicate an em-dash. Since the ASCII character set doesn’t  
> have em-dash, this convention is carried over to rdoc.
> 
> Why does this bother you?

Because it’s not clearly visible that one must type two dashes there.  
The solution would be to not convert special chars in blocks  
(the conversion takes place at  
lib\rdoc\markup\simple\_markup\to\_html.rb:195)

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 16, 2006, 4:48pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/4 "2006-10-16T16:48:07Z")

</div>

Jan S. wrote:

> > > –output _name [, name]_::
> 
> The solution would be to not convert special chars in blocks  
> I agree!

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 17, 2006, 1:01pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/5 "2006-10-17T13:01:10Z")

</div>

I wrote:

> –quiet::: do not output the names, sizes, byte counts,  
> index areas, or bit ratios of units as  
> they are processed.
> 
> =end

now if one runs rdoc on a file containing only the range of lines  
between =begin and =end, this generates html as expected. But anything  
other than a shebang line in front spoils this. In this case, the  
following text produces an empty html-page:

puts “this is a test”

=begin rdoc

–output _name [, name]_::  
specify the name of one or more output files. If multiple  
files are present, the first is used as the index.

–quiet::: do not output the names, sizes, byte counts,  
index areas, or bit ratios of units as  
they are processed.

=end

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 17, 2006, 3:21pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/6 "2006-10-17T15:21:14Z")

</div>

Wybo D. wrote:

> now if one runs rdoc on a file containing only the range of lines  
> between =begin and =end, this generates html as expected. But anything  
> other than a shebang line in front spoils this. In this case, the  
> following text produces an empty html-page:

Do you consider this a bug? I consider it a feature. I like being able  
to have random comment blocks (with =begin…=end or many lines of #)  
in my files and not have them added to the RDoc output.

---

<div class="post-metadata">

**Author:** ![wybodekker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f05b48/32.png) [@wybodekker](https://www.ruby-forum.com/u/wybodekker)\
**Post date:** [October 17, 2006, 5:53pm UTC](https://www.ruby-forum.com/t/bug-in-rdoc/72322/7 "2006-10-17T17:53:18Z")

</div>

Phrogz wrote:

> Wybo D. wrote:
> 
> > now if one runs rdoc on a file containing only the range of lines  
> > between =begin and =end, this generates html as expected. But anything  
> > other than a shebang line in front spoils this. In this case, the  
> > following text produces an empty html-page:
> 
> Do you consider this a bug? I consider it a feature. I like being able  
> to have random comment blocks (with =begin…=end or many lines of #)  
> in my files and not have them added to the RDoc output.

Sure, but the text between

=begin rdoc

and

=end

should get in the Rdoc output. What else would these directives be  
useful for??
