Building an API for Flask-Markdown
- From:
- Dan Colish
- Date:
- 2010-07-25 @ 19:49
I've been thinking of some ways to build a nicer API for this extension,
but I believe its always going to be limited by the nature of the Markdown
project is relies upon. The main issue I see is that adding any markdown
extensions are expected to be modules and they require a bit of work to
hook in if they're added any time except during the markdown class
instantiation.When I tried to add them later, we'd be missing an important
hook function that must be called upon the extension module load. The
modules also usually include the extension class and a preprocessor class
in addition to the makeExtension hook (which just returns an instance of
the class). Also, its important to note the hook function must be there
since it is called during the load_extension call.
Any thoughts about how this could be made simpler?
--Dan