Repository: timvink/mkdocs-git-authors-plugin

Issue:
replace `config_options.Choice()`
We use `config_options.Choice`, which was [introduced](https://github.com/mkdocs/mkdocs/blob/master/mkdocs/config/config_options.py#L161) in MkDocs 1.1. 

This means we have a requirements on MkDocs 1.1, but that version brings some breaking changes (`mkdocs.utils.string_types` deprecated). Not all plugins have been updated yet, f.e. `pdf-export`. I would like to use that with the git-authors plugin, but downgrading is currently not an option.

Solution is to replace `config_options.Choice()` with a boolean option and downgrade mkdocs version requirement.

Discussion:

Patch:
diff --git a/mkdocs_git_authors_plugin/git/repo.py b/mkdocs_git_authors_plugin/git/repo.py
index 330fd32..0432f43 100644
--- a/mkdocs_git_authors_plugin/git/repo.py
+++ b/mkdocs_git_authors_plugin/git/repo.py
@@ -136,7 +136,14 @@ class Repo(object):
         Args:
             - plugin_config: dictionary
         """
-        self._config = plugin_config
+        config = plugin_config.copy()
+        if config['sort_authors_by_name'] is True:
+            config['sort_authors_by'] = 'name'
+        else:
+            config['sort_authors_by'] = 'contribution'
+            
+        del config['sort_authors_by_name']
+        self._config = config
 
     def _sort_key(self, author):
         """
diff --git a/mkdocs_git_authors_plugin/plugin.py b/mkdocs_git_authors_plugin/plugin.py
index 477feb1..4fd8fbd 100644
--- a/mkdocs_git_authors_plugin/plugin.py
+++ b/mkdocs_git_authors_plugin/plugin.py
@@ -10,9 +10,7 @@ class GitAuthorsPlugin(BasePlugin):
         ('show_contribution', config_options.Type(bool, default=False)),
         ('show_line_count', config_options.Type(bool, default=False)),
         ('count_empty_lines', config_options.Type(bool, default=True)),
-        ('sort_authors_by', config_options.Choice(
-            ['name', 'contribution'], default='name')
-        ),
+        ('sort_authors_by_name', config_options.Type(bool, default=True)),
         ('sort_reverse', config_options.Type(bool, default=False))
     )
 
diff --git a/setup.py b/setup.py
index fa13762..1d05c4a 100644
--- a/setup.py
+++ b/setup.py
@@ -21,7 +21,7 @@ setup(
         "Operating System :: OS Independent",
     ],
     install_requires=[
-        'mkdocs>=1.1'
+        'mkdocs>=1.0'
     ],
     packages=find_packages(),
     entry_points={


Test patch:
diff --git a/tests/test_util.py b/tests/test_util.py
index f6c8de6..579c100 100644
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -30,7 +30,7 @@ DEFAULT_CONFIG = {
     'show_contribution': False, 
     'show_line_count': False, 
     'count_empty_lines': True, 
-    'sort_authors_by': 'name', 
+    'sort_authors_by_name': True, 
     'sort_reverse': False
 }