colorful rat Ratfactor.com > Dave's Repos

rubylit

A literate programming system in 35 lines of Ruby
git clone http://ratfactor.com/repos/rubylit/rubylit.git

rubylit/hello-segments.html

Download raw file: hello-segments.html

1 <html><body> 2 3 <h1 id="label-Hello+Segments-21">Hello Segments!<span><a href="#label-Hello+Segments-21">&para;</a> <a href="#top">&uarr;</a></span></h1> 4 5 <p>This one has stuff defined out of order in a silly way so we can demonstrate segments.</p> 6 7 <p>Right now we&#39;re in the start segment. The &lt;&lt;hello&gt;&gt; thingy will request that we “include” the hello segment defined after:</p> 8 9 <pre>&lt;&lt;Hello&gt;&gt; 10 puts &quot;World!&quot;</pre> 11 12 <h2 id="label-Hello">Hello<span><a href="#label-Hello">&para;</a> <a href="#top">&uarr;</a></span></h2> 13 14 <p>This segment will actually run first because it&#39;s included at the beginning of the unnamed start segment above.</p> 15 16 <pre class="ruby"><span class="ruby-identifier">puts</span> <span class="ruby-string">&quot;Hello...&quot;</span> 17 </pre> 18 19 <p>This example is obviously nonsense. But it should demonstrate the principle nicely.</p> 20 </body></html>