docs/maruku.html in maruku-0.3.0 vs docs/maruku.html in maruku-0.4.0

- old
+ new

@@ -1,23 +1,17 @@ <?xml version='1.0' encoding='utf-8'?> <!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'> -<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'> -<head> -<title>Maruku: a Markdown-superset interpreter</title> - -<link href='style.css' rel='stylesheet' type='text/css' /> -</head> -<body> +<html lang='en' xml:lang='en' xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html; charset=utf-8' http-equiv='Content-type' /><title>Maruku: a Markdown-superset interpreter</title><link href='style.css' rel='stylesheet' type='text/css' /></head><body> <h1 id='maruku_a_markdownsuperset_interpreter'>Mar<strong>u</strong>k<strong>u</strong>: a Markdown-superset interpreter</h1> <p><a href='http://maruku.rubyforge.org/&gt;'>Maruku</a> is a Markdown interpreter written in <a href='http://www.ruby-lang.org'>Ruby</a>.</p> <p>Maruku allows you to write in an easy-to-read-and-write syntax, like this:</p> <blockquote> -<p><a href='http://maruku.rubyforge.org/maruku.md'>This document in Markdown</a> </p> +<p><a href='http://maruku.rubyforge.org/maruku.md'>This document in Markdown</a></p> </blockquote> <p>Then it can be translated to HTML:</p> <blockquote> @@ -36,102 +30,58 @@ <li> <p>the original <a href='http://maruku.rubyforge.org/markdown_syntax.html'>Markdown syntax</a> (<a href='http://maruku.rubyforge.org/markdown_syntax.html'>HTML</a> or <a href='http://maruku.rubyforge.org/markdown_syntax.pdf'>PDF</a>), translated by Maruku).</p> </li> <li> -<p>all the improvements in <a href='http://www.michelf.com/projects/php-markdown/extra/'>PHP Markdown Extra</a>. </p> +<p>all the improvements in <a href='http://www.michelf.com/projects/php-markdown/extra/'>PHP Markdown Extra</a>.</p> </li> <li> -<p>a new <a href='#meta'>meta-data syntax</a></p> +<p>a new <a href='http://maruku.rubyforge.org/proposal.html'>meta-data syntax</a></p> </li> </ul> <p><strong>Authors</strong>: Maruku has been developed so far by <a href='http://www.dis.uniroma1.it/~acensi/'>Andrea Censi</a>. Contributors are most welcome!</p> <p><strong>The name of the game</strong>: Maruku is the <a href='http://en.wikipedia.org/wiki/Romaji'>romaji</a> translitteration of the <a href='http://en.wikipedia.org/wiki/Katakana'>katakana</a> translitteration of &quot;Mark&quot;, the first word in Markdown. I chose this name because Ruby is Japanese, and also the sillable &quot;ru&quot; appears in Maruku.</p> - <hr /> - <p>Table of contents: (<strong>auto-generated by Maruku!</strong>)</p> +<div class='maruku_toc'><ul style='list-style: none;'><li><span class='maruku_section_number'>1. </span><a href='#release_notes'>Release notes</a></li><li><span class='maruku_section_number'>2. </span><a href='#download'>Download</a><ul style='list-style: none;'><li><span class='maruku_section_number'>2.1. </span><a href='#bugs_report'>Bugs report</a></li></ul></li><li><span class='maruku_section_number'>3. </span><a href='#usage'>Usage</a><ul style='list-style: none;'><li><span class='maruku_section_number'>3.1. </span><a href='#from_the_command_line'>From the command line</a></li></ul></li><li><span class='maruku_section_number'>4. </span><a href='#extra'>Examples of PHP Markdown Extra syntax</a></li><li><span class='maruku_section_number'>5. </span><a href='#maruku-and-bluecloth'>Maruku and Bluecloth</a></li><li><span class='maruku_section_number'>6. </span><a href='#meta'>New meta-data syntax</a><ul style='list-style: none;'><li><span class='maruku_section_number'>6.1. </span><a href='#metadata_for_blocklevel_and_spanlevel_elements'>Meta-data for block-level and span-level elements</a></li><li><span class='maruku_section_number'>6.2. </span><a href='#metadata_for_the_document'>Meta-data for the document</a></li><li><span class='maruku_section_number'>6.3. </span><a href='#metalist'>List of meta-data</a></li><li><span class='maruku_section_number'>6.4. </span><a href='#examples'>Examples</a></li></ul></li><li><span class='maruku_section_number'>7. </span><a href='#features'>Other Features</a><ul style='list-style: none;'><li><span class='maruku_section_number'>7.1. </span><a href='#automatic_generation_of_the_table_of_contents'>Automatic generation of the table of contents</a></li><li><span class='maruku_section_number'>7.2. </span><a href='#this_header_contains_emphasis_strong_text_and_'>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></a></li><li><span class='maruku_section_number'>7.3. </span><a href='#use_html_entities'>Use HTML entities</a></li></ul></li><li><span class='maruku_section_number'>8. </span><a href='#future'>Future developments</a><ul style='list-style: none;'><li><span class='maruku_section_number'>8.1. </span><a href='#a_syntax_for_adding_math'>A syntax for adding math</a></li></ul></li></ul></div><hr /> +<h2 id='release_notes'><span class='maruku_section_number'>1. </span>Release notes</h2> -<div class='maruku_toc'> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>1. </span><a href='#release_notes'>Release notes - version 0.3.0 (January 3rd, 2007)</a></li> +<p>Note: Maruku seems to be very robust, nevertheless it is still beta-level software. So if you want to use it in production environments, please check back in a month or so, while we squash the remaining bugs.</p> -<li><span class='maruku_section_number'>2. </span><a href='#download'>Download</a> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>2.1. </span><a href='#bugs_report'>Bugs report</a></li> -</ul> -</li> +<p>In the meantime, feel free to toy around, and please signal problems, request features, by <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>contacting me</a> or using the <a href='http://rubyforge.org/tracker/?group_id=2795'>tracker</a>. For issues about the Markdown syntax itself and improvements to it, please write to the <a href='http://six.pairlist.net/mailman/listinfo/markdown-discuss'>Markdown-discuss mailing list</a>.</p> -<li><span class='maruku_section_number'>3. </span><a href='#usage'>Usage</a> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>3.1. </span><a href='#from_the_command_line'>From the command line</a></li> -</ul> -</li> +<p>Have fun!</p> -<li><span class='maruku_section_number'>4. </span><a href='#extra'>Examples of PHP Markdown Extra syntax</a></li> +<h4 id='changes_in_04'>Changes in 0.4</h4> -<li><span class='maruku_section_number'>5. </span><a href='#maruku-and-bluecloth'>Maruku and Bluecloth</a></li> +<ul> +<li>First implementation of <a href='http://maruku.rubyforge.org/proposal.html'>the new meta-data syntax</a>.</li> -<li><span class='maruku_section_number'>6. </span><a href='#meta'>New meta-data syntax</a> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>6.1. </span><a href='#metadata_for_the_document'>Meta-data for the document</a></li> +<li>General refactorization of the code and much cleaner error reporting.</li> -<li><span class='maruku_section_number'>6.2. </span><a href='#metadata_for_elements'>Meta-data for elements</a></li> +<li>Created <a href='http://maruku.rubyforge.org/rdoc/'>the RDOC documentation</a>.</li> -<li><span class='maruku_section_number'>6.3. </span><a href='#shortcuts'>Shortcuts</a></li> +<li>The <code>add_whitespace</code> method took too much time -- it was O(n^2).</li> -<li><span class='maruku_section_number'>6.4. </span><a href='#metalist'>List of meta-data</a></li> - -<li><span class='maruku_section_number'>6.5. </span><a href='#examples'>Examples</a></li> +<li>Added unit-tests for block-level elements.</li> </ul> -</li> -<li><span class='maruku_section_number'>7. </span><a href='#features'>Other Features</a> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>7.1. </span><a href='#automatic_generation_of_the_table_of_contents'>Automatic generation of the table of contents</a></li> +<h4 id='changes_in_03'>Changes in 0.3</h4> -<li><span class='maruku_section_number'>7.2. </span><a href='#this_header_contains_emphasis_strong_text_and_'>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></a></li> - -<li><span class='maruku_section_number'>7.3. </span><a href='#use_html_entities'>Use HTML entities</a></li> -</ul> -</li> - -<li><span class='maruku_section_number'>8. </span><a href='#future'>Future developments</a> -<ul style='list-style: none;'> -<li><span class='maruku_section_number'>8.1. </span><a href='#a_syntax_for_adding_math'>A syntax for adding math</a></li> -</ul> -</li> -</ul> -</div> - -<hr /> - -<h2 id='release_notes'><span class='maruku_section_number'>1. </span>Release notes - version 0.3.0 (January 3rd, 2007)</h2> - -<p>Note: Maruku seems to be very robust, nevertheless it is still beta-level software. So if you want to use it in production environments, please check back in a month or so, while we squash the remaining bugs.</p> - -<p>In the meantime, feel free to toy around, and please signal problems, request features, by <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>contacting me</a> or using the <a href='http://rubyforge.org/tracker/?group_id=2795'>tracker</a>. For issues about the Markdown syntax itself and improvements to it, please write to the <a href='http://six.pairlist.net/mailman/listinfo/markdown-discuss'>Markdown-discuss mailing list</a>.</p> - -<p>Have fun!</p> - -<p>Changes in 0.3.0:</p> - <ul> <li> <p>A real parser is used instead of a regexp-based system, also for span-level elements.</p> <p>Now Maruku is almost 2x faster than Bluecloth, while having more features.</p> <p>Here are some benchmarks:</p> - <pre><code>BlueCloth (to_html): parsing 0.00 sec + rendering 1.54 sec = 1.55 sec Maruku (to_html): parsing 0.47 sec + rendering 0.38 sec = 0.85 sec Maruku (to_latex): parsing 0.49 sec + rendering 0.25 sec = 0.73 sec</code></pre> - <p>This is the result of running <code>lib/maruku/tests/benchmark.rb</code> on the Markdown specification.</p> </li> <li> <p>Prettier HTML output by adding whitespace.</p> @@ -143,14 +93,12 @@ <li> <p>Error management: Having a real parser, Maruku warns you about syntax issues.</p> <p>The default action is to warn and try to continue. If you do this:</p> - <pre><code>Maruku.new(string, {:on_error =&gt; :raise}) </code></pre> - <p>then syntax errors will cause an exception to be raised (you can catch this and retry).</p> </li> <li> <p>Fixed a series of bugs in handling inline HTML code.</p> @@ -161,17 +109,17 @@ <ul> <li> <p>UTF-8 input/output works OK for HTML, however I am having pain trying to export to LaTeX. I want at least Japanese characters support, so if you know how to do this you are very welcome to give me an hand.</p> -<p>For example: in the HTML version, you should see accented characters in this parenthesis: </p> +<p>For example: in the HTML version, you should see accented characters in this parenthesis:</p> <blockquote> <p>(àèìòù)</p> </blockquote> -<p>and Japanese text in these other parentheses: </p> +<p>and Japanese text in these other parentheses:</p> <blockquote> <p>(カタカナで 私の 名前は アンドレア チェンシ です).</p> <p>(日本のガルは 大好き、でも、日本語は難しですから、そうぞ 英語話すガルを おしえてください).</p> @@ -204,147 +152,91 @@ <h2 id='download'><span class='maruku_section_number'>2. </span>Download</h2> <p>The development site is <a href='http://rubyforge.org/projects/maruku/'>http://rubyforge.org/projects/maruku/</a>.</p> <p>Install with:</p> - -<pre><code>$ gem install maruku -</code></pre> - +<pre class='shell' style='background-color: #efefff;'>$ gem install maruku</pre> <p>Released files can also be seen at <a href='http://rubyforge.org/frs/?group_id=2795'>http://rubyforge.org/frs/?group_id=2795</a>.</p> <p>Anonymous access to the repository is possible with:</p> - -<pre><code>$ svn checkout svn://rubyforge.org/var/svn/maruku -</code></pre> - +<pre class='shell' style='background-color: #efefff;'>$ svn checkout svn://rubyforge.org/var/svn/maruku</pre> <p>If you want commit access to the repository, just create an account on Rubyforge and <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>drop me a mail</a>.</p> <h3 id='bugs_report'><span class='maruku_section_number'>2.1. </span>Bugs report</h3> <p>Use the <a href='http://rubyforge.org/tracker/?group_id=2795'>tracker</a> or <a href='http://www.dis.uniroma1.it/~acensi/contact.html'>drop me an email</a>.</p> <h2 id='usage'><span class='maruku_section_number'>3. </span>Usage</h2> <p>This is the basic usage:</p> - -<pre class='ruby'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>rubygems</span><span class='punct'>'</span> +<pre class='ruby' style='background-color: #efffef;'><span class='ident'>require</span> <span class='punct'>'</span><span class='string'>rubygems</span><span class='punct'>'</span> <span class='ident'>require</span> <span class='punct'>'</span><span class='string'>maruku</span><span class='punct'>'</span> <span class='ident'>doc</span> <span class='punct'>=</span> <span class='constant'>Maruku</span><span class='punct'>.</span><span class='ident'>new</span><span class='punct'>(</span><span class='ident'>markdown_string</span><span class='punct'>)</span> <span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html</span></pre> - <p>The method <code>to_html</code> outputs only an HTML fragment, while the method <code>to_html_document</code> outputs a complete XHTML 1.0 document:</p> - -<pre class='ruby'><span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document</span></pre> - +<pre class='ruby' style='background-color: #efffef;'><span class='ident'>puts</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document</span></pre> <p>You can have the REXML document tree with:</p> - -<pre class='ruby'><span class='ident'>tree</span> <span class='punct'>=</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document_tree</span></pre> - +<pre class='ruby' style='background-color: #efffef;'><span class='ident'>tree</span> <span class='punct'>=</span> <span class='ident'>doc</span><span class='punct'>.</span><span class='ident'>to_html_document_tree</span></pre> <h3 id='from_the_command_line'><span class='maruku_section_number'>3.1. </span>From the command line</h3> <p>There are two command-line programs installed: <code>maruku</code> and <code>marutex</code>.</p> <ul> <li> <p><code>maruku</code> converts Markdown to HTML:</p> +<pre class='shell' style='background-color: #efefff;'>$ maruku file.md # creates file.html</pre></li> -<pre><code>$ maruku file.md # creates file.html</code></pre> -</li> - <li> -<p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF</p> - -<pre><code>$ marutex file.md # creates file.tex and file.pdf</code></pre> -</li> +<p><code>marutex</code> converts Markdown to LaTeX, then calls <code>pdflatex</code> to transform to PDF:</p> +<pre class='shell' style='background-color: #efefff;'>$ marutex file.md # creates file.tex and file.pdf</pre></li> </ul> <h2 id='extra'><span class='maruku_section_number'>4. </span>Examples of PHP Markdown Extra syntax</h2> <ul> <li> <p>tables</p> - -<pre><code>Col1 | Very very long head | Very very long head| +<pre class='markdown' style='background-color: #ffefef;'>Col1 | Very very long head | Very very long head| -----|:-------------------:|-------------------:| -cell | center-align | right-align | -</code></pre> +cell | center-align | right-align |</pre><table><thead><tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr></thead><tbody><tr><td style='text-align: left;'>cell</td><td style='text-align: center;'>center-align</td><td style='text-align: right;'>right-align</td></tr></tbody></table></li> -<table class='example'> -<thead> -<tr><th>Col1</th><th>Very very long head</th><th>Very very long head</th></tr> -</thead> -<tbody> -<tr> -<td style='text-align: left;'>cell</td> - -<td style='text-align: center;'>center-align</td> - -<td style='text-align: right;'>right-align</td> -</tr> -</tbody></table> -</li> - <li> <p>footnotes <sup id='fnref:1'><a href='#fn:1' rel='footnote'>1</a></sup></p> +<pre class='markdown' style='background-color: #ffefef;'>* footnotes [^foot] -<pre><code>* footnotes [^foot] - -[^foot]: I really was missing those.</code></pre> -</li> - -<li> -<p>Markdown inside HTML elememnts</p> -</li> +[^foot]: I really was missing those.</pre></li> </ul> -<pre class='xml'><span class='punct'>&lt;</span><span class='tag'>div</span> <span class='attribute'>markdown</span><span class='punct'>=&quot;</span><span class='string'>1</span><span class='punct'>&quot;</span> <span class='attribute'>style</span><span class='punct'>=&quot;</span><span class='string'>border: solid 1px black</span><span class='punct'>&quot;&gt;</span> +<ul> +<li> +<p>Markdown inside HTML elements</p> +<pre><code>&lt;div markdown=&quot;1&quot; style=&quot;border: solid 1px black&quot;&gt; This is a div with Markdown **strong text** -<span class='punct'>&lt;/</span><span class='tag'>div</span><span class='punct'>&gt;</span></pre> - -<div style='border: solid 1px black'> +&lt;/div&gt;</code></pre><div style='border: solid 1px black'> <p>This is a div with Markdown <strong>strong text</strong></p> -</div> +</div></li> -<ul> <li> <p>header ids</p> - -<pre><code>## Download ## {#download} -</code></pre> - +<pre class='markdown' style='background-color: #ffefef;'>## Download ## {#download}</pre> <p>For example, <a href='#download'>a link to the download</a> header.</p> - -<p>Note that you can use also the new <a href='#meta'>meta-data syntax</a> for the same purpose:</p> - -<pre><code>@ id: download -## Header ## </code></pre> </li> <li> <p>definition lists</p> +<pre class='markdown' style='background-color: #ffefef;'>Definition list +: something very hard to parse</pre><dl><dt>Definition list</dt><dd>something very hard to parse</dd></dl></li> -<pre><code>Definition list -: something very hard to parse -</code></pre> - -<dl> -<dt>Definition list</dt> - -<dd>something very hard to parse</dd> -</dl> -</li> - <li> <p>abbreviations or <abbr title='Simply an abbreviation'>ABB</abbr> for short.</p> </li> </ul> <h2 id='maruku-and-bluecloth'><span class='maruku_section_number'>5. </span>Maruku and Bluecloth</h2> -<p>The other Ruby implementation of Markdown is <a href='http://www.deveiate.org/projects/BlueCloth'>Bluecloth</a>. </p> +<p>The other Ruby implementation of Markdown is <a href='http://www.deveiate.org/projects/BlueCloth'>Bluecloth</a>.</p> <p>Maruku is much different in philosophy from Bluecloth: the biggest difference is that <em>parsing</em> is separated from <em>rendering</em>. In Maruku, an in-memory representation of the Markdown document is created. Instead, Bluecloth mantains the document in memory as a String at all times, and does a series of <code>gsub</code> to transform to HTML.</p> <p>The in-memory representation makes it very easy to export to various formats (at the moment HTML and LaTeX/PDF; the next is pretty-printed Markdown).</p> @@ -362,248 +254,94 @@ <h2 id='meta'><span class='maruku_section_number'>6. </span>New meta-data syntax</h2> <p>Maruku implements a syntax that allows to attach &quot;meta&quot; information to objects.</p> -<h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.1. </span>Meta-data for the document</h3> +<h3 id='metadata_for_blocklevel_and_spanlevel_elements'><span class='maruku_section_number'>6.1. </span>Meta-data for block-level and span-level elements</h3> -<p>Meta-data for the document itself is specified through the use of email headers:</p> +<p>See <a href='http://maruku.rubyforge.org/proposal.html'>this proposal</a>.</p> -<pre><code>Title: A simple document containing meta-headers +<h3 id='metadata_for_the_document'><span class='maruku_section_number'>6.2. </span>Meta-data for the document</h3> + +<p>Meta-data for the document itself is specified through the use of email headers:</p> +<pre class='markdown' style='background-color: #ffefef;'>Title: A simple document containing meta-headers CSS: style.css -Content of the document -</code></pre> - -<p>When creating the document through </p> - -<pre class='ruby'><span class='constant'>Maruku</span><span class='punct'>.</span><span class='ident'>new</span><span class='punct'>(</span><span class='ident'>s</span><span class='punct'>).</span><span class='ident'>to_html_document</span></pre> - +Content of the document</pre> +<p>When creating the document through</p> +<pre class='ruby' style='background-color: #efffef;'><span class='constant'>Maruku</span><span class='punct'>.</span><span class='ident'>new</span><span class='punct'>(</span><span class='ident'>s</span><span class='punct'>).</span><span class='ident'>to_html_document</span></pre> <p>the title and stylesheet are added as expected.</p> <p>Meta-data keys are assumed to be case-insensitive.</p> - -<h3 id='metadata_for_elements'><span class='maruku_section_number'>6.2. </span>Meta-data for elements</h3> - -<p>Maruku introduces a new syntax for attaching metadata to paragraphs, tables, and so on.</p> - -<p>For example, consider the creation of two paragraphs:</p> - -<pre><code>Paragraph 1 is a warning. - -Paragraph 2 -</code></pre> - -<p>Now you really want to attach a &apos;class&apos; attribute to the paragraphs (for example for CSS styling). Maruku allows you to use:</p> - -<pre><code>@ class: warning -Paragraph 1 is a warning - -Paragraph 2 - -</code></pre> - -<p>You can add more by separating with a <code>;</code>:</p> - -<pre><code>@ class: warning; id: warning1 -Paragraph 1 is a warning -</code></pre> - -<p>A meta-data declaration is composed of </p> - -<ol> -<li>newline</li> - -<li>an at-symbol <code>@</code></li> - -<li>a series of name-value pairs. Each name-value is separated by a colon <code>:</code>, pairs are separated by semi-colons <code>;</code> </li> -</ol> - -<p>Many declaration can be used, and they refer to <em>the following</em> object:</p> - -<pre><code>@ class: warning -@ id: warning1 -Paragraph 1 is a warning -</code></pre> - -<p>These can also be separated by newlines:</p> - -<pre><code>@ class: warning - -@ id: warning1 - -Paragraph 1 is a warning - -</code></pre> - -<h3 id='shortcuts'><span class='maruku_section_number'>6.3. </span>Shortcuts</h3> - -<p>This:</p> - -<pre><code>@ .xyz -Paragraph -</code></pre> - -<p>is equivalent to:</p> - -<pre><code>@ class: xyz -Paragraph -</code></pre> - -<p>This:</p> - -<pre><code>@ #xyz -Paragraph -</code></pre> - -<p>is equivalent to:</p> - -<pre><code>@ id: xyz -Paragraph -</code></pre> - -<p>Also, if the value is not present, it defaults to <code>true</code>:</p> - -<pre><code>@ test - -This paragraph has the attribute `test` set to `true`. -</code></pre> - <hr /> - -<h3 id='metalist'><span class='maruku_section_number'>6.4. </span>List of meta-data</h3> - -<dl> -<dt><strong><code>title</code>, <code>subject</code></strong></dt> - -<dd> +<h3 id='metalist'><span class='maruku_section_number'>6.3. </span>List of meta-data</h3> +<dl><dt><strong><code>title</code>, <code>subject</code></strong></dt><dd> <p>(document) Sets the title of the document (HTML: used in the <code>TITLE</code> element).</p> -</dd> - -<dt><strong><code>use_numbered_headers</code></strong></dt> - -<dd> +</dd><dt><strong><code>use_numbered_headers</code></strong></dt><dd> <p>(document) If <code>true</code>, headers are numbered (just like this document). Default is <code>false</code>.</p> -</dd> - -<dt><strong><code>css</code></strong></dt> - -<dd> +</dd><dt><strong><code>css</code></strong></dt><dd> <p>(document, HTML) Url of stylesheet.</p> -</dd> - -<dt><strong><code>html_use_syntax</code></strong></dt> - -<dd> +</dd><dt><strong><code>html_use_syntax</code></strong></dt><dd> <p>(document, HTML) If set, use the <a href='http://syntax.rubyforge.org/'>Ruby <code>syntax</code> library</a> to add source highlighting.</p> -</dd> - -<dt><strong><code>latex_use_listings</code></strong></dt> - -<dd> +</dd><dt><strong><code>latex_use_listings</code></strong></dt><dd> <p>(document, LaTeX) If set, use the fancy <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code> package</a> for better displaying code blocks.</p> -<p> If not set, use standard <code>verbatim</code> environment.</p> -</dd> - -<dt><strong><code>style</code>, <code>id</code>, <code>class</code></strong></dt> - -<dd> +<p>If not set, use standard <code>verbatim</code> environment.</p> +</dd><dt><strong><code>style</code>, <code>id</code>, <code>class</code></strong></dt><dd> <p>(any block object, HTML) Standard CSS attributes are copied.</p> -</dd> - -<dt><strong><code>lang</code></strong></dt> - -<dd> +</dd><dt><strong><code>lang</code></strong></dt><dd> <p>(code blocks) Name of programming language (<code>ruby</code>) for syntax highlighting.</p> -<p> Default for this is <code>code_lang</code> in document.</p> +<p>Default for this is <code>code_lang</code> in document.</p> -<p> Syntax highlighting is delegated to the <a href='http://syntax.rubyforge.org/'><code>syntax</code> library</a> for HTML output and to the <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code> package</a> for LaTeX output.</p> -</dd> - -<dt><strong><code>code_show_spaces</code></strong></dt> - -<dd> +<p>Syntax highlighting is delegated to the <a href='http://syntax.rubyforge.org/'><code>syntax</code> library</a> for HTML output and to the <a href='http://www.ctan.org/tex-archive/macros/latex/contrib/listings/'><code>listings</code> package</a> for LaTeX output.</p> +</dd><dt><strong><code>code_show_spaces</code></strong></dt><dd> <p>Shows tabs and newlines (default is read in the document object).</p> -</dd> - -<dt><strong><code>code_background_color</code></strong></dt> - -<dd> +</dd><dt><strong><code>code_background_color</code></strong></dt><dd> <p>Background color for code blocks. (default is read in the document object).</p> -<p>The format is either a named color (<code>green</code>, <code>red</code>) or a CSS color of the form <code>#ff00ff</code>. </p> +<p>The format is either a named color (<code>green</code>, <code>red</code>) or a CSS color of the form <code>#ff00ff</code>.</p> <ul> <li> <p>for <strong>HTML output</strong>, the value is put straight in the <code>background-color</code> CSS property of the block.</p> </li> <li> -<p>for <strong>LaTeX output</strong>, if it is a named color, it must be a color accepted by the LaTeX <code>color</code> packages. If it is of the form <code>#ff00ff</code>, Maruku defines a color using the <code>\color[rgb]{r,g,b}</code> macro. </p> +<p>for <strong>LaTeX output</strong>, if it is a named color, it must be a color accepted by the LaTeX <code>color</code> packages. If it is of the form <code>#ff00ff</code>, Maruku defines a color using the <code>\color[rgb]{r,g,b}</code> macro.</p> <p>For example, for <code>#0000ff</code>, the macro is called as: <code>\color[rgb]{0,0,1}</code>.</p> </li> </ul> -</dd> -</dl> +</dd></dl> +<h3 id='examples'><span class='maruku_section_number'>6.4. </span>Examples</h3> -<h3 id='examples'><span class='maruku_section_number'>6.5. </span>Examples</h3> - <p>An example of this is the following:</p> - -<pre><code>@&not;code_show_spaces;&not;code_background_color:&not;green - -&raquo;&nbsp;&nbsp;&nbsp;&not;One&not;space -&raquo;&nbsp;&nbsp;&nbsp;&not;&not;Two&not;spaces -&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&not;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;space,&not;tab -&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;tab,&not;tab&not;and&not;all&not;is&not;green! -</code></pre> - +<pre class='markdown' style='background-color: #ffefef;'> One space + Two spaces + Tab, space, tab + Tab, tab, tab and all is green! +{code_show_spaces code_background_color=#ffeedd}</pre> <p>That will produce:</p> - -<pre style='background-color: green;'><code>&not;One&not;space +<pre style='background-color: #ffeedd;'><code>&not;One&not;space &not;&not;Two&not;spaces &raquo;&nbsp;&nbsp;&nbsp;&not;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;space,&not;tab -&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;tab,&not;tab&not;and&not;all&not;is&not;green! +&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;&raquo;&nbsp;&nbsp;&nbsp;Tab,&not;tab,&not;tab&not;and&not;all&not;is&not;green!</code></pre> +<p>Or highlighting (support depends on languages):</p> +<pre><code> &lt;div style=&quot;text-align:center&quot;&gt;Div&lt;/div&gt; +{lang=html} </code></pre> - -<p>Example with css-style color:</p> - -<pre><code>@ code_background_color: #455678 - - A strange color -</code></pre> - <p>produces:</p> - -<pre style='background-color: #455678;'><code>A strange color -</code></pre> - -<p>Or highlighting (does not work well yet):</p> - -<pre><code>@ lang: xml - &lt;div style=&quot;text-align:center&quot;&gt;Div&lt;/div&gt; -</code></pre> - -<p>produces:</p> - -<pre class='xml'><span class='punct'>&lt;</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>=&quot;</span><span class='string'>text-align:center</span><span class='punct'>&quot;&gt;</span>Div<span class='punct'>&lt;/</span><span class='tag'>div</span><span class='punct'>&gt;</span></pre> - -<hr /> - +<pre class='xml'><span class='punct'>&lt;</span><span class='tag'>div</span> <span class='attribute'>style</span><span class='punct'>=&quot;</span><span class='string'>text-align:center</span><span class='punct'>&quot;&gt;</span>Div<span class='punct'>&lt;/</span><span class='tag'>div</span><span class='punct'>&gt;</span></pre><hr /> <h2 id='features'><span class='maruku_section_number'>7. </span>Other Features</h2> <h3 id='automatic_generation_of_the_table_of_contents'><span class='maruku_section_number'>7.1. </span>Automatic generation of the table of contents</h3> <p>If you create a list, and then set the <code>toc</code> attribute, when rendering Maruku will create an auto-generated table of contents.</p> - -<pre><code>@ toc -* This will become a table of contents (this text will be scraped). +<pre><code>* This will become a table of contents (this text will be scraped). +{toc} </code></pre> - <p>You can see an example of this at the beginning of this document.</p> <h3 id='this_header_contains_emphasis_strong_text_and_'><span class='maruku_section_number'>7.2. </span>This header contains <em>emphasis</em> <strong>strong text</strong> and <code>code</code></h3> <p>Note that this header contains formatting and it still works, also in the table of contents.</p> @@ -611,73 +349,23 @@ <p>And <a href='#features'>This is a <em>link</em> with <strong>all</strong> <strong><em>sort</em></strong> of <code>weird stuff</code></a> in the text.</p> <h3 id='use_html_entities'><span class='maruku_section_number'>7.3. </span>Use HTML entities</h3> <p>If you want to use HTML entities, go on! We will take care of the translation to LaTeX:</p> - -<table> -<thead> -<tr><th>Entity</th><th>Result</th></tr> -</thead> -<tbody> -<tr> -<td style='text-align: left;'><code>&amp;copy;</code></td> - -<td style='text-align: left;'>&copy;</td> -</tr> - -<tr> -<td style='text-align: left;'><code>&amp;pound;</code></td> - -<td style='text-align: left;'>&pound;</td> -</tr> - -<tr> -<td style='text-align: left;'><code>a&amp;nbsp;b</code></td> - -<td style='text-align: left;'>a&nbsp;b</td> -</tr> - -<tr> -<td style='text-align: left;'><code>&amp;lambda;</code></td> - -<td style='text-align: left;'>&lambda;</td> -</tr> - -<tr> -<td style='text-align: left;'><code>&amp;mdash;</code></td> - -<td style='text-align: left;'>&mdash;</td> -</tr> -</tbody></table> - +<table><thead><tr><th>Entity</th><th>Result</th></tr></thead><tbody><tr><td style='text-align: left;'><code>&amp;copy;</code></td><td style='text-align: left;'>&copy;</td></tr><tr><td style='text-align: left;'><code>&amp;pound;</code></td><td style='text-align: left;'>&pound;</td></tr><tr><td style='text-align: left;'><code>a&amp;nbsp;b</code></td><td style='text-align: left;'>a&nbsp;b</td></tr><tr><td style='text-align: left;'><code>&amp;lambda;</code></td><td style='text-align: left;'>&lambda;</td></tr><tr><td style='text-align: left;'><code>&amp;mdash;</code></td><td style='text-align: left;'>&mdash;</td></tr></tbody></table> <h2 id='future'><span class='maruku_section_number'>8. </span>Future developments</h2> <p>I think that <a href='http://sophos.berkeley.edu/macfarlane/pandoc/'>Pandoc</a> and <a href='http://fletcher.freeshell.org/wiki/MultiMarkdown'>MultiMarkdown</a> are very cool projects. However, they are written in Haskell and Perl, respectively. I would love to have an equivalent in Ruby.</p> <h3 id='a_syntax_for_adding_math'><span class='maruku_section_number'>8.1. </span>A syntax for adding math</h3> <p>Something inspired from LaTeX should be familiar to all:</p> - <pre><code>This is inline math: $\alpha$ This is an equation with label: $ \alpha = \beta + \gamma $ (eq:1) -This is a reference to equation: please see (eq:1)</code></pre> - -<div class='footnotes'> -<hr /> - -<ol> -<li id='fn:1'> -<p>I really was missing those.<a href='#fnref:1' rev='footnote'>&#8617;</a></p> -</li> -</ol> -</div> - -<div class='maruku_signature'> -<hr /> -<span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 00:33 on Wednesday, January 03rd, 2007.</span></div> -</body></html> +This is a reference to equation: please see (eq:1)</code></pre><div class='footnotes'><hr /><ol><li id='fn:1'> +<p>I really was missing those.</p> +<a href='#fnref:1' rev='footnote'>&#8617;</a></li></ol></div><div class='maruku_signature'><hr /><span style='font-size: small; font-style: italic'>Created by <a href='http://maruku.rubyforge.org' title='Maruku: a Markdown interpreter'>Maruku</a> at 21:05 on Saturday, January 06th, 2007.</span></div></body></html>