From: Komiya T. <i.t...@gm...> - 2022-01-09 14:41:31
|
Now I released pycmark-0.9.6 and pycmark-gfm-0.9.6 that contain renamed "Parser" classes on the top of the modules. I hope it helps to integrate with docutils. Thanks, 2022年1月9日(日) 2:27 Guenter Milde via Docutils-develop <doc...@li...>: > > Dear Takeshi KOMIYA, > > thank you for the fast reply. > > On 2022-01-08, Takeshi KOMIYA wrote: > > > I finished my work. It has been fully compatible with CommonMark. > > I tested pycmark today and could get it to work with `docutils-cli.py` > after a small modification: > > Running:: > > docutils-cli --parser=pycmark > > I got a ``NotImplementedError('subclass must override this method')``. > > The reason is, that `docutils.parsers.get_parser_class(parser_name)` > looks for a `Parser` class inside the module named `parser_name`. > However, pycmark/__init__.py imports the upstream base class: > > from docutils.parsers import Parser > > > I could fix this changing the above import line to > > import docutils.parsers > > and the parser class definition to start with > > class Parser(docutils.parsers.Parser): > """CommonMark parser for docutils.""" > > Now, pycmark.Parser is the CommonMark parser (as expected by Docutils) > and `docutils-cli --parser=pycmark` worked as a charm. > A quick-and-dirty test run showed that "pycmark" can act > as a handy drop-in Markdown/CommonMark parser. > > The advantage of `docutils-cli --parser=pycmark` over pycmark's `md2html` > is, that it offers the choice of all available writers from the command > line. > > > I thought to release v1.0 after that, but I lost my interest for it > > because myst-parser has appeared. > > Would you consider the above change in pycmark > (With either adapting or dropping the `md2html` "entry-point")? > > As a second best alternative, I could write a thin wrapper module in > Docutils. > > We would then have a selection of 3 CommonMark parsers: > > myst: > fully-featured and actively maintained > > pycmark: > lightweight, no further dependencies > > recommonmark: > long standing (also available as Debian package) > unmaintained/deprecated :( > > > Thanks, > Günter > > > > _______________________________________________ > Docutils-develop mailing list > Doc...@li... > https://lists.sourceforge.net/lists/listinfo/docutils-develop > > Please use "Reply All" to reply to the list. |