MyST-Parser icon indicating copy to clipboard operation
MyST-Parser copied to clipboard

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

Open sneakers-the-rat opened this issue 3 years ago • 2 comments

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

sneakers-the-rat avatar Jul 07 '22 04:07 sneakers-the-rat

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:

welcome[bot] avatar Jul 07 '22 04:07 welcome[bot]

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

chrisjsewell avatar Aug 15 '22 20:08 chrisjsewell