If you donβt want to follow the path of creating a custom directive, you can use the normal warning block and βfakeβ checkboxes. Your markup can be standard reStructuredText:
.. admonition:: The title - Check one - Check two
Then you can include some custom CSS markup in your reStructuredText file in the target list items in the declarations:
.. raw:: html <style> .admonition ul { list-style-type: none; } .admonition li:before { content: "\2610"; } </style>
Here, CSS targets any element of a list element that is a child of any element with a warning class and replaces the marker points of the element with simulated flags using the Unicode voting symbol , β.
Docutils applies an additional class to general warnings , which is a concatenation of the "warning" and the warning header. So in the example above, we could be more specific with the element that we are targeting with the CSS rule:
.admonition-the-title ul { }
This can be used to target one alert inside your document.
Credit goes to these two answers to the SO question. How do I create a checklist in reStructuredText (reST)?
Obviously, the above goals output HTML. However, I did not use rst2pdf, so I can not comment on how you need to change this to work with this program. Hope someone else answers this. As far as I know, rst2pdf supports a cascading style mechanism , so it should be simple (for those who know the syntax of the rst2pdf stylesheet) to add an extra role .. raw:: pdf and change the list styles specified.
source share