Lorem ipsum
Div-Blocks ( @@@ )
Renders a <div> block to which you can apply ID, CLASS and further attributes.
@@@ .myclass // ← <div class='myclass'>
Some text...
@@@ // ← </div>
HTML output:
<div class='myclass'>
<p>Some text…</p>
</div><!-- class='myclass' -->
Note:
If you use HTML <div>…</div> within a markdown file, the content between these tags will
not be markdown-compiled.
(To be precise, that holds true for any block-level elements but not for inline elements.)
Thus, results can be confusing.
Using Div-Blocks avoids this problem.
Marker Characters
By default, characters @ and % are configured to serve as markers for DIV-blocks.
Use config option divblockChars to override, e.g. (in site/config/config.php)
'usility.markdownplus.options' => [
'divblockChars' => '@%$:', // ← '@', '%', '$' and ':'
],
Chaining
For consecutive DIV blocks, you may omit the closing marker
@@@ .myclass
Some text...
@@@ .other-class // <-- no closing marker here
Some more text...
@@@
HTML output:
<div class='myclass'>
<p>Some text…</p>
</div><!-- class='myclass' -->
<div class='other-class'>
<p>Some more text…</p>
</div><!-- class='myclass' -->
Nesting
DIV blocks can be nested. In that case tags need to have different lengths or markers.
Example:
%%% #wrapper
@@@ #outer
@@@@ #inner
Some text…
@@@@
@@@
%%%
HTML output:
<div id='wrapper'>
<div id='outer'>
<div class='inner'>
<p>Some text…</p>
</div><!-- class='inner' -->
</div><!-- id='outer' -->
</div><!-- id='wrapper' -->
Remember:
Characters serving as markers are @ and % –modify if necessary, see above.
Styling
@@@ background:yellow
Lorem ipsum
@@@
Lorem ipsum
Adding Attributes
@@@ aria-hidden=true
Lorem ipsum
@@@
HTML Output:
<div aria-hidden='true'>
Lorem ipsum
</div>
Specifying the HTML Tag
@@@ <article
Lorem ipsum
@@@
HTML Output:
<article>
<p>Lorem ipsum</p>
</article>
Mixing
@@@ <article .class1.class2 #id3 background:yellow aria-hidden=true
Lorem ipsum
@@@
Result:
HTML Output:
<article id='id3' class='class1 class2' style='background:yellow;' aria-hidden='true'>
<p>Lorem ipsum</p>
</article>
Note:
As you can see in the last example, you can use a combination of such instructions.