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

Conversation

Projects
None yet
2 participants
@facelessuser
Contributor

facelessuser commented Apr 28, 2015

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.

Preserve order of Python Markdown extensions
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)

This comment has been minimized.

@d0ugal

d0ugal Apr 28, 2015

Member

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

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

This comment has been minimized.

@facelessuser

facelessuser Apr 28, 2015

Contributor

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.

This comment has been minimized.

@d0ugal

d0ugal Apr 28, 2015

Member

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

This comment has been minimized.

@facelessuser

facelessuser Apr 28, 2015

Contributor

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

@d0ugal

This comment has been minimized.

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

Merge pull request #486 from facelessuser/master
Preserve order of Python Markdown extensions

@d0ugal d0ugal merged commit c3d1b9b into mkdocs:master Apr 28, 2015

3 checks passed

continuous-integration/appveyor AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
coverage/coveralls Coverage decreased (-0.04%) to 85.99%
Details
@d0ugal

This comment has been minimized.

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