executablebooks / MyST-Parser

An extended commonmark compliant parser, with bridges to docutils/sphinx
https://myst-parser.readthedocs.io
MIT License
714 stars 191 forks source link

[Docs] Python API Docs out of date re: module structure #597

Open sneakers-the-rat opened 2 years ago

sneakers-the-rat commented 2 years ago

Describe the bug

context When I browse the API docs, they tell me that I should use myst_parser.docutils_.Parser to parse a document

expectation I expected to be able to import myst_parser.docutils_.Parser

bug But instead an ImportError happens:

Traceback (most recent call last):
  File "./.pyenv/versions/3.9.1/lib/python3.9/code.py", line 90, in runcode
    exec(code, self.locals)
  File "<input>", line 5, in <module>
AttributeError: module 'myst_parser' has no attribute 'docutils_'

suggestion

I just had to use

from myst_parser.parsers.docutils_ import Parser

instead!

Reproduce the bug

from myst_parser.docutils_ import Parser

List your environment

myst_parser.__version__ == 0.18.0

welcome[bot] commented 2 years ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

chrisjsewell commented 1 year ago

Heya, I can't reproduce this issue, and myst-parser 0.18.0 does have a module myst_parser.docutils_ : https://github.com/executablebooks/MyST-Parser/blob/v0.18.0/myst_parser/docutils_.py, from which you can import Parser

Can you perhaps provide more detail, about your system and how you installed it, and whether the file is actually present