Extending rst container to output extra div attributes

风流意气都作罢 提交于 2019-12-07 04:47:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!