New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python-Markdown 3.0 Road Map #391
Comments
Wow, that looks like a very big plan! What namespace are you going to use for extensions names? If |
@mitya57 that's why I suggested using Setuptools' "entrypoints" (second item in 6). See this for a basic explanation of entrypoints. You can see them being used here. My thought is that we lose all of the existing support for string-based-names and only support passing in instances of Extension subclasses. Then, if an extension author would like to make his/her extension available via a string, they need to use entrypoints. Essentially, upon installation, the extension would be registered as being available with a given string as its name. Therefore 'foo' would work fine, even if the actual Extension class was |
Oh and one other thing, by using entrypoints, someone could potentially replace one extension with another. For example, if you have both That said, I'm thinking that the built-in extensions will probably all be installed at the root namespace and with "mdx_" prefix because that's what most third-party extensions already do. So, without entrypoints you would need to do: from mdx_extra import ExtraExtension On the other hand, that does put a lot of additional packages in the root namespace. |
I think splitting the extensions out is a generally a good idea. Now Python Markdown out of the box will parse Markdown. All the other bells and whistles will be distinguished as literal extras. It will also encourage people to develop there code in separate extensions as the previous extras are no longer shipped with Python Markdown. There would no longer be a gain for anyone trying to push their extension objectives into the previously built-in ones. Entrypoints is also an interesting approach as well. I remember taking a look at how Pygments included its modules as they use entrypoints as well.. I'll be interested to see how number 4 turns out as I started looking into that, but wasn't too excited when I realized how the current lists handled blocks. That's going to be some work. |
Thinking about it more, I will say though, that having the default extensions in one place opposed to split into individual repos makes it easier to see how the most commonly used extensions interact with each other. Currently, you know that those are the one's that most people use, and you can then code your plugins to insert around them accordingly and since the order of extension inclusions is extremely important. Assuming the default extensions will be under the PythonMarkdown group, it can probably still be assumed that those will be the most commonly used, but having them broken up will make it a pain to pull all the projects to see the interaction between them. I do understand the benefit of not having to install the one's you don't use though. I'm not really suggesting anything here, just mentioning I guess the one benefit of having the defaults bundled together. |
Following up on @facelessuser's thoughts, it seems like one obvious requirement will be rigorous compatibility testing with all other extensions. I am curious where the extension tests will live though. Compatibility tests needs to be independent of the extension repos to avoid not only duplication, but commits to one extension breaking the tests of another extension without even realizing it. I would suggest keeping a lot of the extension testing infrastructure in the core repo, but to move it into the |
@ryneeverett & @facelessuser you make some good points. I had given testing some consideration. We already have tests which simply pass known good plain Markdown through some of the built-in extensions (the ones that add features not change features) -- simply to make sure they don't break anything. I expect that those tests would move with the extension. Also, as we already use tox (which is very good at ensuring all required test dependencies are installed), we can test the more common extensions with the core to ensure that changes to the core don't break the extensions. The one thing I hadn't considered was the tests regarding the various extensions interacting with each other. Obviously, we could also use tox to install dependencies so that we can run tests for one extension with another extension. However, that means that the extensions need to run tests of their own independent from the core. This will require a little extra work on the testing framework. The benefit is that the testing framework will then also be usable by third party extensions. We'll need to add a way to specify which directory the framework looks for tests in (currently it assumes the directory that the framework itself is in). Thanks for the feedback. It is much appreciated. |
FYI, I've created the fork at https://github.com/Python-Markdown/markdown and have been slowly working on this. Feedback is certainly welcome. I've completed the following tasks so far:
|
The Roadmap is now on the wiki and this issue is being closed. All future discussion should happen on the new repo at https://github.com/Python-Markdown/markdown. |
This is the
currentplan to work towards a 3.0 release.This is a "living document" and will be edited over time. Please leave comments below, but be aware that older comments may not apply to the current state of this document.The Roapmap can now be found here.waylan/Python-Markdown
toPython-Markdown/markdown
. All work on 3.0 will happen at this new repository. The 2.x series will remain atwaylan/Python-Markdown
, which will be in "maintenance mode" and only receive bug fixes (2.6.x) going forward.Python-Markdown/<package name>
and, upon release, uploaded to PyPI as a separate package. Users can dopip install extensionname
for each extension they want. For that matter, "extra" will simply be a simple wrapper and a list of requirements (the various individual extensions) which pip would install automatically. A few changes to the testing framework will be required to specify different locations of tests for each extension.This will result in multiple benefits:
markdown.extensions.extra
) for the built-in extensions.InlinePatterns
=>inlineprocessors
(which match all other types)markdown.Markdown
might be moved to extensions??self.md
and othersself.markdown
to refer to theMarkdown
instance. This will be normalized toself.md
.md_globals
keyword from the extension API. Years ago, state and/or settings were stored in module level globals. We no longer use globals (aside from a few things inmarkdown.utils
); everything is now stored on the class instance.test
method of blockproccesors will be dropped). This is probably the largest body of work and must be completed before 3.0-Final is completed.(.*)
both before and after the supplied regex before compiling.setup.py
.The text was updated successfully, but these errors were encountered: