问题
I'm starting to use pelican with reStructuredText rst
page format. I have custom javascript (jQuery) things that I'd like to control with div attributes like data-default-tpl="basename"
with nested content.
What to extend and what. I've looked at Directives
and nodes
, but I just can't wrap my head around how to do it.
.. rstdiv:: class1 class2
:name: namessid
:extra: thisIsMyextra
.. rstdiv:: nested class3
:name: nestedid
:extra: data-default-tpl="basename"
some text
.. container:: This is normal rst container
:name: contid
text
From rst to html with pelican.
<div id="nameisid" class="class1 class2" thisIsMyextra>
<div id="nestedid" class="nested class3" data-default-tpl="basename">
some text
</div>
</div>
<div id="contid" class="container This is normal rst container">
text
</div>
回答1:
I am not sure about this ... html rst directive plugin may work
来源:https://stackoverflow.com/questions/23824553/extending-rst-container-to-output-extra-div-attributes