- Implement via custom processor
- [.] Allow toggle of tasks
- Ship with Marked.app
Last active
December 18, 2015 19:09
-
-
Save muhqu/5831075 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
/usr/local/bin/marked "$@" \ | |
| sed \ | |
-e 's!\[\ \]!<input type="checkbox" onclick="return false" onkeydown="return false">!' \ | |
-e 's!\[[.\-]\]!<input type="checkbox" onclick="return false" onkeydown="return false" indeterminate>!' \ | |
-e 's!\[[√xX]\]!<input type="checkbox" onclick="return false" onkeydown="return false" checked>!' \ | |
| awk '{print;if($0~/indeterminate/)found=1;}END{if(found)print "<script>window.addEventListener(\"load\",function(){var arr=document.querySelectorAll(\"input[type=checkbox][indeterminate]\");for(i in arr)arr[i].indeterminate=true;});</script>"}' | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment