01
Sep
07

WordPress: include code

I’ve been putting some code, in a dirty way, just in the middle of my posts. I decide to learn a little bit more about wordpress and get things done properly. A small ruby code with indentation as sample.

#!/usr/bin/ruby
if ARGV.length == 0
    puts "no argv"
end

After trying <code>, <blockquote> and <pre> directives I think the best result was achieved using <pre> with <code>, just like the sample above. See the code bellow.

<pre><code>
#!/usr/bin/ruby
if ARGV.length == 0
puts “no argv”
end
</code></pre>

Anyone has a better solution for that? More details here.

Advertisements

0 Responses to “WordPress: include code”



  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Quotes

"Don't worry about what anybody else is going to do. The best way to predict the future is to invent it. Really smart people with reasonable funding can do just about anything that doesn't violate too many of Newton's Laws!" -- Alan Kay in 1971

My Twitter

My Delicious

RSS My Shared RSS

  • An error has occurred; the feed is probably down. Try again later.

Blog Stats

  • 74,846 hits

%d bloggers like this: