A new Riff-radio.org site with a static approach.

listings-demo.html 1.9KB

123456789101112131415
  1. <p>Nikola intends to let you show code easily via listings:</p>
  2. <p><a class="reference external" href="link://listing/listings/hello.py">hello.py</a> <a class="reference external" href="link://listing_source/listings/hello.py">(Source)</a></p>
  3. <pre class="code python"><a name="rest_code_39d324261d5b4eb2910076b264d3954a-1"></a><span class="ch">#!/usr/bin/python</span>
  4. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-2"></a>
  5. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-3"></a><span class="kn">import</span> <span class="nn">sys</span>
  6. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-4"></a>
  7. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-5"></a>
  8. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-6"></a><span class="k">def</span> <span class="nf">hello</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="s1">&#39;world&#39;</span><span class="p">):</span>
  9. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-7"></a> <span class="n">greeting</span> <span class="o">=</span> <span class="s2">&quot;hello &quot;</span> <span class="o">+</span> <span class="n">name</span>
  10. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-8"></a> <span class="nb">print</span><span class="p">(</span><span class="n">greeting</span><span class="p">)</span>
  11. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-9"></a>
  12. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-10"></a>
  13. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-11"></a><span class="k">if</span> <span class="vm">__name__</span> <span class="o">==</span> <span class="s2">&quot;__main__&quot;</span><span class="p">:</span>
  14. <a name="rest_code_39d324261d5b4eb2910076b264d3954a-12"></a> <span class="n">hello</span><span class="p">(</span><span class="o">*</span><span class="n">sys</span><span class="o">.</span><span class="n">argv</span><span class="p">[</span><span class="mi">1</span><span class="p">:])</span>
  15. </pre>