What does <tt> mean in Ruby comments?
Passing on the source code written in Ruby, for example Rails, I often see that the small code is wrapped with a tt tag, as in rails / activesupport / core_ext / array / access.rb
# Equal to <tt>self[2]</tt>. # # %w( abcde).third # => "c" def third self[2] end What is the agreement, when and why was it decided to use these designations?
+6
2 answers
Found it myself in the Rails Documentation Guide .
Using the
+...+pair for a fixed-width font only works with words; that is: everything that matches\A\w+\z. For anything else, use<tt>...</tt>, in particular characters, setters, inline snippets, etc .:
0