Skip to content

Instantly share code, notes, and snippets.

@ahnbizcad
Last active August 29, 2015 14:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ahnbizcad/4e01e640b0765819953a to your computer and use it in GitHub Desktop.
Save ahnbizcad/4e01e640b0765819953a to your computer and use it in GitHub Desktop.
Syntax Highlighting with AsciiDoctor & CodeRay
:source-highlighter: coderay
:coderay-css: class
:coderay-linenums-mode: table
[source,ruby,linenums,role="my_css_class"]
.filename.ext
----
example code
----
gem 'asciidoctor'
gem 'coderay', '~> 1.1.0'
== Asciidoctor.convert(@article.content, safe: 'safe')
<div class="content">
<pre class="highlight">
<code class="language-ruby" data-lang="ruby">
require 'sinatra'
get '/hi' do
"Hello World!"
end
</code>
</pre>
</div>
<div class="listingblock my_css_class">
<div class="title">app.rb<
</div>
<div class="content">
<pre class="highlight">
<code class="language-ruby" data-lang="ruby">require 'sinatra' get '/hi' do "Hello World!" end
</code>
</pre>
</div>
<div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment