Skip to content
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

Preserve order of Python Markdown extensions #486

Merged
merged 1 commit into from
Apr 28, 2015
Merged

Preserve order of Python Markdown extensions #486

merged 1 commit into from
Apr 28, 2015

Conversation

facelessuser
Copy link
Contributor

Python Markdown inclusion order can be important when including various custom extensions. Conflicts can arise as to where extensions get inserted in the workflow. By preserving order of how extensions are
defined in the settings file, this can allow a user to control insertion order and work around these issues. As Py26 supported is noted to be removed in the future, I saw no reason to add additional dependencies for OrderedDict. Try catch statements can be removed when Py26 support is removed.

Python Markdown inclusion order can be important when including various
custom extensions.  Conflicts can arise as to where extensions get
inserted in the workflow.  By preserving order of how extensions are
defined in the settings file, this can allow a user to control
insertion order and work around these issues.  As Py26 supported is
noted to be removed in the future, I saw no reason to add additional
dependencies for OrderedDict.  Try catch statements can be removed when
Py26 support is removed.
@@ -67,3 +68,34 @@ def test_create_media_urls(self):
for path, expected_result in expected_results.items():
urls = utils.create_media_urls(site_navigation, [path])
self.assertEqual(urls[0], expected_result)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than try/catching in the unittest I'd prefer:

@unittest.skipIf(sys.version_info[:2] == (2, 6))

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think the Py26 unittest lib has skipIf. Seems to be new in Py31 https://docs.python.org/3/library/unittest.html#skipping-tests-and-expected-failures.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, of course, sorry. It is in py27 but not py26, so nevermind!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I was just about to correct about the Py31 to Py27. But yeah, it would have been much cleaner.

@d0ugal
Copy link
Member

d0ugal commented Apr 28, 2015

One mine comment, otherwise happy to merge this. Thanks!

@d0ugal d0ugal added the Bug label Apr 28, 2015
@d0ugal d0ugal added this to the 0.13.0 milestone Apr 28, 2015
d0ugal added a commit that referenced this pull request Apr 28, 2015
Preserve order of Python Markdown extensions
@d0ugal d0ugal merged commit c3d1b9b into mkdocs:master Apr 28, 2015
@d0ugal
Copy link
Member

d0ugal commented Apr 28, 2015

Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants