Skip to content

Instantly share code, notes, and snippets.

@shidarin
Created July 11, 2014 14:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shidarin/68e6ad8ae519d10526d9 to your computer and use it in GitHub Desktop.
Save shidarin/68e6ad8ae519d10526d9 to your computer and use it in GitHub Desktop.
Sphinx vs Octopress/Octostrap code blocks - A comparison of Sphinx output and Octopress/Octostrap output
Sphinx:
Marked code is surrounded by <span class="hll"></span>
Octopress:
Marked code is surrounded by <span class="line marked"><span>
(Start lines have additional class of "start", end lines have "end"
Non-line numbered Code:
Sphinx:
<div class="highlight-console">
<div class="highlight">
<pre>
<span class="gp">$</span>
</pre>
</div>
</div>
Octopress:
<figure class="code panel panel-default">
<div class="highlight">
<table>
<tbody>
<tr>
<td class="code">
<pre>
<code class="console">
<span class="line">
<span class="n">tc</span>
</span>
</code>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</figure>
Line Numbered Code
Sphinx:
<div class="highlight-python">
<table class="highlighttable">
<tbody>
<tr>
<td class="linenos">
<div class="linenodiv">
<pre>
1
</pre>
</div>
</td>
<td class="code">
<div class="highlight">
<pre>
CODE CRAP
</pre>
</div>
</td>
</tr>
</tbody>
</table>
</div>
Octopress:
<figure class="code panel panel-default">
<figcaption class="panel-heading">
<h3 class="panel-title">init.py</h3>
</figcaption>
<div class="highlight">
<table>
<tbody>
<tr>
<td class="gutter">
<pre class="line-numbers">
<span class="line-number">1</span>
</pre>
</td>
<td class="code">
<pre>
<code class="python">
<span class="line">
<span class="kn">import</span>
</span>
</code>
</pre>
</td>
</tr>
</tbody>
</table>
</div>
</figure>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment