frostming / marko

A markdown parser with high extensibility.
https://marko-py.readthedocs.io/en/latest/
MIT License
345 stars 38 forks source link

ast_renderer not imported by default #170

Closed h-dubois closed 11 months ago

h-dubois commented 11 months ago

I had to modify the marko __init__.py file to be able to use marko.ast_renderer in my project.

I added

from . import ast_renderer

And it fixed it.

Maybe this issue is more widespread.

Using Python 3.11.3 with Marko 2.0.0

frostming commented 11 months ago

It's rather a personal taste than a bug. import a doesn't mean you can use a.b.c, in which case you must import a.b.

Library authors choose to export some objects but not others.

Either import the fullname:

import marko.ast_renderer
marko.ast_renderer.XMLRenderer()

Or use from import:

from marko.ast_renderer import XMLRenderer