The actual parameter parsing logic in emacs org mode is quite complex [1]. All we want for now is to handle parameter values containing spaces [2]. Splitting on ` :` gets us close enough for now. As I'm very opposed to copying 100 lines of parameter parsing logic just to get exports right let's wait for use cases - no hurt in gathering requirements as we go. [1] https://github.com/bzg/org-mode/blob/master/lisp/ob-core.el#L1481 [2] I never ran into such parameters before and wrongly assumed that splitting on spaces would be enough. boy was i wrong - just look at that massive function [1]! that's why we can't have nice things!
195 lines
3.7 KiB
HTML
195 lines
3.7 KiB
HTML
<pre class="example">
|
|
some results without a block
|
|
</pre>
|
|
<figure>
|
|
<div class="src src-bash">
|
|
<div class="highlight">
|
|
<pre>
|
|
echo "a bash source block"
|
|
|
|
function hello {
|
|
echo Hello World!
|
|
}
|
|
|
|
hello
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<figcaption>
|
|
block caption
|
|
</figcaption>
|
|
</figure>
|
|
<div class="src src-text">
|
|
<div class="highlight">
|
|
<pre>
|
|
a source block without a language
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<div class="src src-bash">
|
|
<div class="highlight">
|
|
<pre>
|
|
echo a source block with results
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<pre class="example">
|
|
a source block with results
|
|
</pre>
|
|
<pre class="example">
|
|
a source block that only exports results
|
|
</pre>
|
|
<pre class="example">
|
|
but the result block is
|
|
</pre>
|
|
<pre class="example">
|
|
an example block with
|
|
multiple lines including
|
|
|
|
|
|
empty lines!
|
|
|
|
it also has multiple parameters
|
|
|
|
src, example & export blocks treat their content as raw text
|
|
/inline/ *markup* is ignored
|
|
and whitespace is honored and not removed
|
|
|
|
content of example blocks is still html escaped - see <script>alert("escaped")</script>
|
|
</pre>
|
|
<pre class="example">
|
|
examples like this
|
|
are also supported
|
|
|
|
note that /inline/ *markup* ignored
|
|
</pre>
|
|
<blockquote>
|
|
<p>Mongodb is <strong>webscale</strong>. (source: <a href="http://www.mongodb-is-web-scale.com/">mongodb-is-web-scale</a>)</p>
|
|
<p>
|
|
blocks like the quote block parse their content and can contain</p>
|
|
<ul>
|
|
<li>
|
|
<p>lists</p>
|
|
</li>
|
|
<li>
|
|
<p>inline <em>markup</em></p>
|
|
</li>
|
|
<li>
|
|
<p>tables</p>
|
|
<table>
|
|
<tbody>
|
|
<tr>
|
|
<td>foo</td>
|
|
</tr>
|
|
<tr>
|
|
<td>bar</td>
|
|
</tr>
|
|
<tr>
|
|
<td>baz</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
</li>
|
|
<li>
|
|
<p>paragraphs</p>
|
|
</li>
|
|
<li>
|
|
<p>…</p>
|
|
<p>
|
|
whitespace is honored and not removed (but is not displayed because that's how html works by default)
|
|
it can be made visible using css (e.g. <code class="verbatim">white-space: pre</code>).</p>
|
|
</li>
|
|
</ul>
|
|
</blockquote>
|
|
<div class="src src-org">
|
|
<div class="highlight">
|
|
<pre>
|
|
#+BEGIN_SRC bash
|
|
echo src (with language org) and example blocks support escaping using commata
|
|
#+END_SRC
|
|
|
|
,* I am not a real headline - commata escape characters aren't renderered
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<pre class="example">
|
|
#+BEGIN_SRC bash
|
|
echo src (with language org) and example blocks support escaping using commata
|
|
#+END_SRC
|
|
|
|
,* I am not a real headline - commata escape characters aren't renderered
|
|
</pre>
|
|
<script>
|
|
console.log("Hello World!")
|
|
</script>
|
|
<ul>
|
|
<li>
|
|
<p>list item 1
|
|
blocks can contain unindented lines that would normally end a list item</p>
|
|
<pre class="example">
|
|
this line is not indented - if it was outside of a block the list item would end
|
|
</pre>
|
|
<blockquote>
|
|
<p>this line is not indented - if it was outside of a block the list item would end</p>
|
|
</blockquote>
|
|
<p>now we're outside the block again and the following unindented line will be outside of the list item</p>
|
|
</li>
|
|
</ul>
|
|
<p>this unindented line is outside of the list item</p>
|
|
<ul>
|
|
<li>
|
|
<p>list item 2</p>
|
|
<div class="src src-text">
|
|
<div class="highlight">
|
|
<pre>
|
|
#+BEGIN_EXAMPLE
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<p>#+END_EXAMPLE</p>
|
|
<blockquote>
|
|
<pre class="example">
|
|
#+END_QUOTE
|
|
</pre>
|
|
</blockquote>
|
|
</li>
|
|
<li>
|
|
<p>verse blocks</p>
|
|
<ul>
|
|
<li>
|
|
<p>emacs / ox-hugo rendering</p>
|
|
<p class="verse">
|
|
Great clouds overhead<br />
|
|
Tiny black birds rise and fall<br />
|
|
Snow covers Emacs<br />
|
|
<br />
|
|
---AlexSchroeder<br />
|
|
</p>
|
|
</li>
|
|
<li>
|
|
<p>go-org rendering</p>
|
|
<div class="src src-html">
|
|
<div class="highlight">
|
|
<pre>
|
|
<style>
|
|
.verse-block p { white-space: pre; }
|
|
.verse-block p + p { margin: 0; }
|
|
</style>
|
|
</pre>
|
|
</div>
|
|
</div>
|
|
<style>
|
|
.verse-block p { white-space: pre; }
|
|
.verse-block p + p { margin: 0; }
|
|
</style>
|
|
<div class="verse-block">
|
|
<p>Great clouds overhead
|
|
Tiny black birds rise and fall
|
|
Snow covers Emacs</p>
|
|
<p>
|
|
—AlexSchroeder</p>
|
|
</div>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|