Skip to content

Latest commit

 

History

History
232 lines (141 loc) · 4.57 KB

ox-s9y-examples.md

File metadata and controls

232 lines (141 loc) · 4.57 KB

basic formatting

Most normal Org formatting like bold code italic striketrough underline as well as sections and headlines should work out of the box.

Unimplemented element types should throw an error pointing to their missing implementation.

headlines

Because Serendipity uses the first two headline levels for itself (title of blog and title of article), the blog entry can only use level three and lower headlines for subsections.

I usually simply use * blog as the first level headline and the article title on the second level. Both headlines are exported as an HTML comment so I can copy the article title over to the title text field in the Serendipity editor.

input

* dummy
** dummy
*** dummy
**** TOPIC

output

<!--  dummy  -->
<!--  dummy  -->
<h3>dummy</h3>
<h4>TOPIC</h4>

source code blocks

Source code using #+BEGIN_SRC / #+END_SRC will be rendered as a [geshi] code block.

The source language will be copied to the geshi tag. Some mappings are needed, see (ox-s9y--map-to-geshi-language) and expand accordingly if you miss anything.

input

#+BEGIN_SRC java
package foo;
/* dummy dummy */
#+END_SRC

output

[geshi lang=java]package foo;
/* dummy dummy */[/geshi]

foldable <details> blocks

Use a headline tagged with :details: to generate a foldable HTML <details> block. The <details> is closed by default. The headline title will be used as a <summary> and can contain markup.

<details> blocks may be nested.

The <details> block will end at the next headline of the same or higher level. To end the block early, insert a special headline with the title END (also tagged as :details:). While this will end the <details> block, the END headline will not show up in the output.

input

introduction paragraph

* plain *bold* /italic/ _underline_ +strike+                        :details:
paragraph =one=

#+BEGIN_SRC shell
#!/bin/sh
echo formatted code
#+END_SRC

paragraph =two=
* END                                                               :details:

footer paragraph

output

<p>introduction paragraph</p>

<details>
<summary>plain <strong>bold</strong> <em>italic</em> <u>underline</u> <s>strike</s></summary>
<p>paragraph <code>one</code></p>

[geshi lang=bash]#!/bin/sh
echo formatted code[/geshi]

<p>paragraph <code>two</code></p>
</details>
<p>footer paragraph</p>

block quotes

Quote blocks using #+BEGIN_QUOTE / #+END_QUOTE will be rendered as an HTML <blockquote> tag.

input

#+BEGIN_QUOTE
Somebody
said
this.
#+END_QUOTE

output

<blockquote>Somebody
said
this.
</blockquote>

entities

Use \ast{} to export verbatim asterisks when * would activate bold formatting.

Other Org entities should also work.

input

This is *bold* and this is in \ast{}asterisks\ast{}.

output

<p>This is <strong>bold</strong> and this is in &lowast;asterisks&lowast;.</p>

dangling links

To refer to a future blog article that has not yet been written, add a link with todo:some text as the link target. This will generate an <abbr> tag showing the given text as a hover text instead of a regular <a> link.

If you leave out some text and just use todo: as a link target, a default text will be supplied. This text can be customized via M-x customize-variable ox-s9y-todo-link-title.

input

[[todo:Show this text][bar]]

output

<p><abbr title="Show this text">bar</abbr></p>