Posted Mon, 22 Jul 2019 14:17:15 GMT in reply to
Kevin Wolff
Reply
On Wed, 17 Jul 2019 00:39:32 GMT, Kevin Wolff wrote:
I tried to write code with some highlighting. But failed.
Tried to include or write embed html code. Failed again.
pre.codebox
code
span.keyword class
| Point:
span.keyword def
| __init__(
em.common self
| , x, y)
em.common self
| .x = x
em.common self
| .y = y
Code above only write on 1 line.
If the contents are static, you could use the '.' syntax together with embedded HTML:
pre.codebox
code.
<span class="keyword">class</span> Point:
<span class="leyword">def</span> __init__(<em class="common">self</em>, x, y)
<em class="common">self</em>.x = x
<em class="common">self</em>.y = y
Otherwise, using individual text lines together with embedded nodes is the best way to go:
pre.codebox: code
| #[span.keyword class] Print:
| #[span.keyword def] __init__(#[em.common self], x, y)
| #[em.common self].x = x
| #[em.common self].y = y
Note that "pre" elements are specially recognized to ensure the indentaion and line breaks of contained elements are preserved.