I am working on a simple checklist using reStructuredText. To this end I use a bullet list, but I would like to replace the standard bullet points with custom signs, such as empty checkboxes. Optimally, the checkboxes would be clickable in the HTML and/or PDF document.
If it is not possible/trivial in reST, could you recommend other text-based format where it is possible?
Bartosz
reStructuredText (RST, ReST, or reST) is a file format for textual data used primarily in the Python programming language community for technical documentation.
For comments, add 2 periods .. followed by a newline and then your comment indented.
RST stands for ReStructured Text. It is the standard markup language used for documenting python packages. Sphinx is the Python package that generates an html website from RST files, and it is what we are using to generate this site.
I ran into this yesterday and just faked it. If you're just looking for something that has the same visual effect as a checkbox when the user prints the document (the user can't submit my document as an HTML form, for example), it's really easy to do:
- [ ] Checkbox item 1.
- [ ] sub-item.
- [ ] another sub-item.
- [ ] a sub-sub-item.
- [X] an already filled in checkbox.
When viewed, it looks like:
[ ] Checkbox item 1.
[ ] sub-item.
[ ] another sub-item.
[ ] a sub-sub-item.
[X] an already filled in checkbox.
try to use Unicode char.
It is beautiful than typing []
direct but hassle.
☑ U+2611
☐ U+2610
.. |check| raw:: html
<input checked="" type="checkbox">
.. |check_| raw:: html
<input checked="" disabled="" type="checkbox">
.. |uncheck| raw:: html
<input type="checkbox">
.. |uncheck_| raw:: html
<input disabled="" type="checkbox">
checkbox
=============
check to enable: |check|
check disable: |check_|
uncheck enable: |uncheck|
uncheck disable: |uncheck_|
you can run above code on this website: https://livesphinx.herokuapp.com/
and you will see as below picture:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With