Skip to content

Instantly share code, notes, and snippets.

@mrnugget
Created April 14, 2012 12:51
Show Gist options
  • Save mrnugget/2384233 to your computer and use it in GitHub Desktop.
Save mrnugget/2384233 to your computer and use it in GitHub Desktop.
MarkDown Testting

H2

  • Item 1
  • Item 2
  • Item3

Blockquotes

The next few lines should be a blockquote

'Sometimes I look up to the sky and I wish that someday someone would quote me. Like in a block. Seriously.'

Now the code

Here is a little bit of Ruby code, to test code blocks. Intended with 4 spaces.

def mymethod(arg)
  puts "Hello #{arg}"
end

Let's hope this works.

Here is some more code, wrapped in 3 backticks:

module MarkdownToHtml
  def body_to_html
   convert_to_html(body)
  end

  protected

    def mymethod(supercool, arg)
      myarray = []
      myhash = {hello: "dude", bye: "dude}
      puts "Why is that dude?
    end

Here is some more code again, this time with 4 spaces intended:

 def convert_to_html(string)
  markdown = Redcarpet::Markdown.new(
    Redcarpet::Render::HTML.new(hard_wrap: true),
    no_intra_emphasis: true,
    autolink: true,
    fenced_code_blocks: true
  )
  Redcarpet::Render::SmartyPants.render(markdown.render(string))
end

Hope that works.

JavaScript Code

I do hope highlight.js catches javascript.

$(function() {
  var myvar = "hello";
  alert("Foobar");
  console.log("Hello there, my friend!");
  function hellodude(name) {
    console.log("I just wanted to say: Hello");
    $(".hello").html("My Friend! Welcome back!);
  }
});

This better work.

Autolinks

http://www.thisshouldbealink.de

This is an example inline link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment