Open retsyo opened 8 years ago
Hi,
I can recommend you to look at pymdown-extensions pack by @facelessuser. In particular,
[ ]
and [x]
syntax;I cannot say anything about the table items aligning — perhaps you might try to write your own extension for this :)
See also this wiki page for the documentation on how to load extensions.
thanks. However, I have read but still be puzzled. Is there any instruction for a user but not a coder? I mean, 1. download something from some url, then put it under which directory; 2. how to enable the extension in retext
p.s. I have installed PyMdown Extensions via "pip install pymdown-extensions", which says "Successfully installed Markdown-2.6.7 pymdown-extensions-1.1", there is still no tasklist, code highlight
import re
# more python code
import re
[ ]a
[x]a
Hi,
This highly depends on your system (which you did not mention). Usually, pip
is the command to install packages for Python 2, and for ReText you need pip3
command (which will install for Python 3). So, the correct command will be:
$ pip3 install --user pymdown-extensions
Python-Markdown (and ReText) requires the module name, which can be imported from Python. In example, for the Tasklist extension it will be pymdownx.tasklist
(because that extension is installed into site-packages/pymdownx/tasklist.py
file).
That said, the following piece of Markdown works for me:
<!-- Required extensions: pymdownx.tasklist -->
- [ ] item 1
- [x] item 2
You can also put these extension names into the Preferences dialog so that they are applied globally. After doing this, open a new tab, because the change does not affect the existing tabs.
I really like how these modules are pluggable, but I'd definitely vote for tasklist to be bundled by default.
I do not want to bundle anything, but maybe there will be a better interface to discover and install extensions in future versions.
I cannot get any extensions to work at all.
@JamesStallings What exact extension you tried to use, and what steps did you do that failed to work? Have you read the wiki page about Markdown extensions?
@mitya57 thanks for the reply, I have tried to use 3rd party checklist and third party caption.
Please explain what you did, to allow me to help you.
In this thread (https://github.com/retext-project/retext/issues/243#issuecomment-249485790) there are steps to set up tasklist extension. Was the package installed successfully? What are the contents of your Markdown file? What output do you get with it?
I found an online md editor, https://www.zybuluo.com/mdeditor which needs some time to load fully, and is in Chinese I found some feature is nice. Does any plugin support them in retext?
[ ]
and[x]
will be rendered as check box