0

how can i write code blocks in maruku for ruby,javascript

currently i am using technique. but my first line moving to left.

hash["test"] = "test"
hash.merge!("test" => "test")
h=HashWithIndifferentAccess.new
h.update(:test => "test")

{:lang=ruby html_use_syntax=true}

Subba Rao
  • 10,576
  • 7
  • 29
  • 31

2 Answers2

1

I'm not sure I fully understand the question, but Maruku is just a Markdown interpreter.

To produce a code block in Markdown, simply indent every line of the block by at least 4 spaces or 1 tab. For example, given this input:

This is a normal paragraph:

    This is a code block.

Markdown will generate:

<p>This is a normal paragraph:</p>

<pre><code>This is a code block.
</code></pre>
Ryan McGeary
  • 235,892
  • 13
  • 95
  • 104
0

I add this answer because I ended up here searching for a solution to code blocks with Maruku using Jekyll. For anyone else in the same boat, use the Liquid tags for code blocks instead of the Markdown syntax:

{% highlight java %}  
System.out.println("Hello, Maruku.");  
{% endhighlight %}  

Also see this question/answer: Highlight with Jekyll and pygments doesn't work

Community
  • 1
  • 1
Curtis
  • 536
  • 4
  • 10