开发者

Macro or equivalent in reStructuredText?

开发者 https://www.devze.com 2023-02-12 12:42 出处:网络
I have a <form> like this all the times. .. raw:: html <form action=\"txmt://open/?url=file:///Users/smcho/smcho/works/prgtask/ni/gtest_boost_options/readme.txt\">

I have a <form> like this all the times.

.. raw:: html

    <form action="txmt://open/?url=file:///Users/smcho/smcho/works/prgtask/ni/gtest_boost_options/readme.txt">
    <button type="submit">Edit</button>
    </form>

Is t开发者_如何学Chere any macro or equivalent in reStructuredText so that I can get the same result, for example?

.. form :: /Users/smcho/smcho/works/prgtask/ni/gtest_boost_options/readme.txt


You could implement your own "form" directive in python. For instructions on how to do that, see http://docutils.sourceforge.net/docs/howto/rst-directives.html


You can use any template engine to generate your restructured text, and that gives you macros, loops, and much more. It will require some effort at the beginning, but it should not be terribly hard.

0

精彩评论

暂无评论...
验证码 换一张
取 消