Formatting comments with lesstile
Apart from the usage of some normal HTML tags (like strong, em, and so on), the comments in this blog can be formatted using lesstile.
Here is a short explanation about the usage of this gem:
Links
If you want to create some links, typing "Search in Google":http://www.google.com/ produces: Search in Google.
Code
If you want to format some code, open and close it with three dashes. Write the following:
---here is some formatted code---
to get
1 |
here is some formatted code |
Blank spaces before the dashes do not affect the result, but breaklines can introduce unexpected blank lines.
Ruby code
You can be also more precise and define which language you are using. For the moment HTML and Ruby are supported. Just write the name of the language after the dashes, like this:
--- ruby
def hello_world
puts “hello world!”
end
---
and you’ll get:
1 2 3 |
def hello_world puts "hello world!" end |
it doesn’t matter whether you capitalize the word ruby or not.
HTML code
Finally, after writing:
--- HTML
<strong>Look, HTML code</strong>
---
you’ll get
<strong>Look, HTML code</strong> |
as expected. And that’s it! Make your comments, ladies and gentlemen.
![Validate my Atom 1.0 feed [Valid Atom 1.0]](/images/valid-atom.png)