Last active
August 29, 2015 14:08
-
-
Save ahnbizcad/4e01e640b0765819953a to your computer and use it in GitHub Desktop.
Syntax Highlighting with AsciiDoctor & CodeRay
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
:source-highlighter: coderay | |
:coderay-css: class | |
:coderay-linenums-mode: table | |
[source,ruby,linenums,role="my_css_class"] | |
.filename.ext | |
---- | |
example code | |
---- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gem 'asciidoctor' | |
gem 'coderay', '~> 1.1.0' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
== Asciidoctor.convert(@article.content, safe: 'safe') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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