We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Support terminal coloring on Windows
E.g. we might use the [colorama](https://pypi.org/project/colorama/) library, otherwise the output looks like this in cmd.exe:

```
←[33mWARNING  -  ←[0mmkdocs_autorefs.plugin: cookbook-reference.md: Could not find cross-reference target '['a']'
←[33mWARNING  -  ←[0mmkdocs_autorefs.plugin: cookbook-reference.md: Could not find cross-reference target '['a']'
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `mkdocs/__main__.py`
Content:
```
1 #!/usr/bin/env python
2 
3 import os
4 import sys
5 import logging
6 import click
7 import textwrap
8 import shutil
9 
10 from mkdocs import __version__
11 from mkdocs import utils
12 from mkdocs import config
13 from mkdocs.commands import build, gh_deploy, new, serve
14 
15 log = logging.getLogger(__name__)
16 
17 
18 class ColorFormatter(logging.Formatter):
19     colors = {
20         'CRITICAL': 'red',
21         'ERROR': 'red',
22         'WARNING': 'yellow',
23         'DEBUG': 'blue'
24     }
25 
26     text_wrapper = textwrap.TextWrapper(
27         width=shutil.get_terminal_size(fallback=(0, 0)).columns,
28         replace_whitespace=False,
29         break_long_words=False,
30         break_on_hyphens=False,
31         initial_indent=' '*12,
32         subsequent_indent=' '*12
33     )
34 
35     def format(self, record):
36         message = super().format(record)
37         prefix = f'{record.levelname:<8} -  '
38         if record.levelname in self.colors:
39             prefix = click.style(prefix, fg=self.colors[record.levelname])
40         if self.text_wrapper.width:
41             # Only wrap text if a terminal width was detected
42             msg = '\n'.join(
43                 self.text_wrapper.fill(line)
44                 for line in message.splitlines()
45             )
46             # Prepend prefix after wrapping so that color codes don't affect length
47             return prefix + msg[12:]
48         return prefix + message
49 
50 
51 class State:
52     ''' Maintain logging level.'''
53 
54     def __init__(self, log_name='mkdocs', level=logging.INFO):
55         self.logger = logging.getLogger(log_name)
56         # Don't restrict level on logger; use handler
57         self.logger.setLevel(1)
58         self.logger.propagate = False
59 
60         self.stream = logging.StreamHandler()
61         self.stream.setFormatter(ColorFormatter())
62         self.stream.setLevel(level)
63         self.stream.name = 'MkDocsStreamHandler'
64         self.logger.addHandler(self.stream)
65 
66         # Add CountHandler for strict mode
67         self.counter = utils.log_counter
68         self.counter.setLevel(logging.WARNING)
69         self.logger.addHandler(self.counter)
70 
71 
72 pass_state = click.make_pass_decorator(State, ensure=True)
73 
74 clean_help = "Remove old files from the site_dir before building (the default)."
75 config_help = "Provide a specific MkDocs config"
76 dev_addr_help = ("IP address and port to serve documentation locally (default: "
77                  "localhost:8000)")
78 strict_help = ("Enable strict mode. This will cause MkDocs to abort the build "
79                "on any warnings.")
80 theme_help = "The theme to use when building your documentation."
81 theme_choices = utils.get_theme_names()
82 site_dir_help = "The directory to output the result of the documentation build."
83 use_directory_urls_help = "Use directory URLs when building pages (the default)."
84 reload_help = "Enable the live reloading in the development server (this is the default)"
85 no_reload_help = "Disable the live reloading in the development server."
86 dirty_reload_help = "Enable the live reloading in the development server, but only re-build files that have changed"
87 commit_message_help = ("A commit message to use when committing to the "
88                        "Github Pages remote branch. Commit {sha} and MkDocs {version} are available as expansions")
89 remote_branch_help = ("The remote branch to commit to for Github Pages. This "
90                       "overrides the value specified in config")
91 remote_name_help = ("The remote name to commit to for Github Pages. This "
92                     "overrides the value specified in config")
93 force_help = "Force the push to the repository."
94 ignore_version_help = "Ignore check that build is not being deployed with an older version of MkDocs."
95 watch_theme_help = ("Include the theme in list of files to watch for live reloading. "
96                     "Ignored when live reload is not used.")
97 shell_help = "Use the shell when invoking Git."
98 
99 
100 def add_options(opts):
101     def inner(f):
102         for i in reversed(opts):
103             f = i(f)
104         return f
105 
106     return inner
107 
108 
109 def verbose_option(f):
110     def callback(ctx, param, value):
111         state = ctx.ensure_object(State)
112         if value:
113             state.stream.setLevel(logging.DEBUG)
114     return click.option('-v', '--verbose',
115                         is_flag=True,
116                         expose_value=False,
117                         help='Enable verbose output',
118                         callback=callback)(f)
119 
120 
121 def quiet_option(f):
122     def callback(ctx, param, value):
123         state = ctx.ensure_object(State)
124         if value:
125             state.stream.setLevel(logging.ERROR)
126     return click.option('-q', '--quiet',
127                         is_flag=True,
128                         expose_value=False,
129                         help='Silence warnings',
130                         callback=callback)(f)
131 
132 
133 common_options = add_options([quiet_option, verbose_option])
134 common_config_options = add_options([
135     click.option('-f', '--config-file', type=click.File('rb'), help=config_help),
136     # Don't override config value if user did not specify --strict flag
137     # Conveniently, load_config drops None values
138     click.option('-s', '--strict', is_flag=True, default=None, help=strict_help),
139     click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help),
140     # As with --strict, set the default to None so that this doesn't incorrectly
141     # override the config file
142     click.option('--use-directory-urls/--no-directory-urls', is_flag=True, default=None, help=use_directory_urls_help)
143 ])
144 
145 PYTHON_VERSION = sys.version[:3]
146 
147 PKG_DIR = os.path.dirname(os.path.abspath(__file__))
148 
149 
150 @click.group(context_settings={'help_option_names': ['-h', '--help']})
151 @click.version_option(
152     __version__,
153     '-V', '--version',
154     message=f'%(prog)s, version %(version)s from { PKG_DIR } (Python { PYTHON_VERSION })'
155 )
156 @common_options
157 def cli():
158     """
159     MkDocs - Project documentation with Markdown.
160     """
161 
162 
163 @cli.command(name="serve")
164 @click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')
165 @click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help, default=True)
166 @click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)
167 @click.option('--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)
168 @click.option('--watch-theme', help=watch_theme_help, is_flag=True)
169 @common_config_options
170 @common_options
171 def serve_command(dev_addr, livereload, **kwargs):
172     """Run the builtin development server"""
173     serve.serve(dev_addr=dev_addr, livereload=livereload, **kwargs)
174 
175 
176 @cli.command(name="build")
177 @click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)
178 @common_config_options
179 @click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)
180 @common_options
181 def build_command(clean, **kwargs):
182     """Build the MkDocs documentation"""
183     build.build(config.load_config(**kwargs), dirty=not clean)
184 
185 
186 @cli.command(name="gh-deploy")
187 @click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)
188 @click.option('-m', '--message', help=commit_message_help)
189 @click.option('-b', '--remote-branch', help=remote_branch_help)
190 @click.option('-r', '--remote-name', help=remote_name_help)
191 @click.option('--force', is_flag=True, help=force_help)
192 @click.option('--ignore-version', is_flag=True, help=ignore_version_help)
193 @click.option('--shell', is_flag=True, help=shell_help)
194 @common_config_options
195 @click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)
196 @common_options
197 def gh_deploy_command(clean, message, remote_branch, remote_name, force, ignore_version, shell, **kwargs):
198     """Deploy your documentation to GitHub Pages"""
199     cfg = config.load_config(
200         remote_branch=remote_branch,
201         remote_name=remote_name,
202         **kwargs
203     )
204     build.build(cfg, dirty=not clean)
205     gh_deploy.gh_deploy(cfg, message=message, force=force, ignore_version=ignore_version, shell=shell)
206 
207 
208 @cli.command(name="new")
209 @click.argument("project_directory")
210 @common_options
211 def new_command(project_directory):
212     """Create a new MkDocs project"""
213     new.new(project_directory)
214 
215 
216 if __name__ == '__main__':  # pragma: no cover
217     cli()
218
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py
--- a/mkdocs/__main__.py
+++ b/mkdocs/__main__.py
@@ -12,6 +12,15 @@
 from mkdocs import config
 from mkdocs.commands import build, gh_deploy, new, serve
 
+
+if sys.platform.startswith("win"):
+    try:
+        import colorama
+    except ImportError:
+        pass
+    else:
+        colorama.init()
+
 log = logging.getLogger(__name__)

{"golden_diff": "diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py\n--- a/mkdocs/__main__.py\n+++ b/mkdocs/__main__.py\n@@ -12,6 +12,15 @@\n from mkdocs import config\n from mkdocs.commands import build, gh_deploy, new, serve\n \n+\n+if sys.platform.startswith(\"win\"):\n+    try:\n+        import colorama\n+    except ImportError:\n+        pass\n+    else:\n+        colorama.init()\n+\n log = logging.getLogger(__name__)\n", "issue": "Support terminal coloring on Windows\nE.g. we might use the [colorama](https://pypi.org/project/colorama/) library, otherwise the output looks like this in cmd.exe:\r\n\r\n```\r\n\u2190[33mWARNING  -  \u2190[0mmkdocs_autorefs.plugin: cookbook-reference.md: Could not find cross-reference target '['a']'\r\n\u2190[33mWARNING  -  \u2190[0mmkdocs_autorefs.plugin: cookbook-reference.md: Could not find cross-reference target '['a']'\r\n```\n", "before_files": [{"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport logging\nimport click\nimport textwrap\nimport shutil\n\nfrom mkdocs import __version__\nfrom mkdocs import utils\nfrom mkdocs import config\nfrom mkdocs.commands import build, gh_deploy, new, serve\n\nlog = logging.getLogger(__name__)\n\n\nclass ColorFormatter(logging.Formatter):\n    colors = {\n        'CRITICAL': 'red',\n        'ERROR': 'red',\n        'WARNING': 'yellow',\n        'DEBUG': 'blue'\n    }\n\n    text_wrapper = textwrap.TextWrapper(\n        width=shutil.get_terminal_size(fallback=(0, 0)).columns,\n        replace_whitespace=False,\n        break_long_words=False,\n        break_on_hyphens=False,\n        initial_indent=' '*12,\n        subsequent_indent=' '*12\n    )\n\n    def format(self, record):\n        message = super().format(record)\n        prefix = f'{record.levelname:<8} -  '\n        if record.levelname in self.colors:\n            prefix = click.style(prefix, fg=self.colors[record.levelname])\n        if self.text_wrapper.width:\n            # Only wrap text if a terminal width was detected\n            msg = '\\n'.join(\n                self.text_wrapper.fill(line)\n                for line in message.splitlines()\n            )\n            # Prepend prefix after wrapping so that color codes don't affect length\n            return prefix + msg[12:]\n        return prefix + message\n\n\nclass State:\n    ''' Maintain logging level.'''\n\n    def __init__(self, log_name='mkdocs', level=logging.INFO):\n        self.logger = logging.getLogger(log_name)\n        # Don't restrict level on logger; use handler\n        self.logger.setLevel(1)\n        self.logger.propagate = False\n\n        self.stream = logging.StreamHandler()\n        self.stream.setFormatter(ColorFormatter())\n        self.stream.setLevel(level)\n        self.stream.name = 'MkDocsStreamHandler'\n        self.logger.addHandler(self.stream)\n\n        # Add CountHandler for strict mode\n        self.counter = utils.log_counter\n        self.counter.setLevel(logging.WARNING)\n        self.logger.addHandler(self.counter)\n\n\npass_state = click.make_pass_decorator(State, ensure=True)\n\nclean_help = \"Remove old files from the site_dir before building (the default).\"\nconfig_help = \"Provide a specific MkDocs config\"\ndev_addr_help = (\"IP address and port to serve documentation locally (default: \"\n                 \"localhost:8000)\")\nstrict_help = (\"Enable strict mode. This will cause MkDocs to abort the build \"\n               \"on any warnings.\")\ntheme_help = \"The theme to use when building your documentation.\"\ntheme_choices = utils.get_theme_names()\nsite_dir_help = \"The directory to output the result of the documentation build.\"\nuse_directory_urls_help = \"Use directory URLs when building pages (the default).\"\nreload_help = \"Enable the live reloading in the development server (this is the default)\"\nno_reload_help = \"Disable the live reloading in the development server.\"\ndirty_reload_help = \"Enable the live reloading in the development server, but only re-build files that have changed\"\ncommit_message_help = (\"A commit message to use when committing to the \"\n                       \"Github Pages remote branch. Commit {sha} and MkDocs {version} are available as expansions\")\nremote_branch_help = (\"The remote branch to commit to for Github Pages. This \"\n                      \"overrides the value specified in config\")\nremote_name_help = (\"The remote name to commit to for Github Pages. This \"\n                    \"overrides the value specified in config\")\nforce_help = \"Force the push to the repository.\"\nignore_version_help = \"Ignore check that build is not being deployed with an older version of MkDocs.\"\nwatch_theme_help = (\"Include the theme in list of files to watch for live reloading. \"\n                    \"Ignored when live reload is not used.\")\nshell_help = \"Use the shell when invoking Git.\"\n\n\ndef add_options(opts):\n    def inner(f):\n        for i in reversed(opts):\n            f = i(f)\n        return f\n\n    return inner\n\n\ndef verbose_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.stream.setLevel(logging.DEBUG)\n    return click.option('-v', '--verbose',\n                        is_flag=True,\n                        expose_value=False,\n                        help='Enable verbose output',\n                        callback=callback)(f)\n\n\ndef quiet_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.stream.setLevel(logging.ERROR)\n    return click.option('-q', '--quiet',\n                        is_flag=True,\n                        expose_value=False,\n                        help='Silence warnings',\n                        callback=callback)(f)\n\n\ncommon_options = add_options([quiet_option, verbose_option])\ncommon_config_options = add_options([\n    click.option('-f', '--config-file', type=click.File('rb'), help=config_help),\n    # Don't override config value if user did not specify --strict flag\n    # Conveniently, load_config drops None values\n    click.option('-s', '--strict', is_flag=True, default=None, help=strict_help),\n    click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help),\n    # As with --strict, set the default to None so that this doesn't incorrectly\n    # override the config file\n    click.option('--use-directory-urls/--no-directory-urls', is_flag=True, default=None, help=use_directory_urls_help)\n])\n\nPYTHON_VERSION = sys.version[:3]\n\nPKG_DIR = os.path.dirname(os.path.abspath(__file__))\n\n\n@click.group(context_settings={'help_option_names': ['-h', '--help']})\n@click.version_option(\n    __version__,\n    '-V', '--version',\n    message=f'%(prog)s, version %(version)s from { PKG_DIR } (Python { PYTHON_VERSION })'\n)\n@common_options\ndef cli():\n    \"\"\"\n    MkDocs - Project documentation with Markdown.\n    \"\"\"\n\n\n@cli.command(name=\"serve\")\n@click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')\n@click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help, default=True)\n@click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)\n@click.option('--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)\n@click.option('--watch-theme', help=watch_theme_help, is_flag=True)\n@common_config_options\n@common_options\ndef serve_command(dev_addr, livereload, **kwargs):\n    \"\"\"Run the builtin development server\"\"\"\n    serve.serve(dev_addr=dev_addr, livereload=livereload, **kwargs)\n\n\n@cli.command(name=\"build\")\n@click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)\n@common_config_options\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef build_command(clean, **kwargs):\n    \"\"\"Build the MkDocs documentation\"\"\"\n    build.build(config.load_config(**kwargs), dirty=not clean)\n\n\n@cli.command(name=\"gh-deploy\")\n@click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)\n@click.option('-m', '--message', help=commit_message_help)\n@click.option('-b', '--remote-branch', help=remote_branch_help)\n@click.option('-r', '--remote-name', help=remote_name_help)\n@click.option('--force', is_flag=True, help=force_help)\n@click.option('--ignore-version', is_flag=True, help=ignore_version_help)\n@click.option('--shell', is_flag=True, help=shell_help)\n@common_config_options\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef gh_deploy_command(clean, message, remote_branch, remote_name, force, ignore_version, shell, **kwargs):\n    \"\"\"Deploy your documentation to GitHub Pages\"\"\"\n    cfg = config.load_config(\n        remote_branch=remote_branch,\n        remote_name=remote_name,\n        **kwargs\n    )\n    build.build(cfg, dirty=not clean)\n    gh_deploy.gh_deploy(cfg, message=message, force=force, ignore_version=ignore_version, shell=shell)\n\n\n@cli.command(name=\"new\")\n@click.argument(\"project_directory\")\n@common_options\ndef new_command(project_directory):\n    \"\"\"Create a new MkDocs project\"\"\"\n    new.new(project_directory)\n\n\nif __name__ == '__main__':  # pragma: no cover\n    cli()\n", "path": "mkdocs/__main__.py"}], "after_files": [{"content": "#!/usr/bin/env python\n\nimport os\nimport sys\nimport logging\nimport click\nimport textwrap\nimport shutil\n\nfrom mkdocs import __version__\nfrom mkdocs import utils\nfrom mkdocs import config\nfrom mkdocs.commands import build, gh_deploy, new, serve\n\n\nif sys.platform.startswith(\"win\"):\n    try:\n        import colorama\n    except ImportError:\n        pass\n    else:\n        colorama.init()\n\nlog = logging.getLogger(__name__)\n\n\nclass ColorFormatter(logging.Formatter):\n    colors = {\n        'CRITICAL': 'red',\n        'ERROR': 'red',\n        'WARNING': 'yellow',\n        'DEBUG': 'blue'\n    }\n\n    text_wrapper = textwrap.TextWrapper(\n        width=shutil.get_terminal_size(fallback=(0, 0)).columns,\n        replace_whitespace=False,\n        break_long_words=False,\n        break_on_hyphens=False,\n        initial_indent=' '*12,\n        subsequent_indent=' '*12\n    )\n\n    def format(self, record):\n        message = super().format(record)\n        prefix = f'{record.levelname:<8} -  '\n        if record.levelname in self.colors:\n            prefix = click.style(prefix, fg=self.colors[record.levelname])\n        if self.text_wrapper.width:\n            # Only wrap text if a terminal width was detected\n            msg = '\\n'.join(\n                self.text_wrapper.fill(line)\n                for line in message.splitlines()\n            )\n            # Prepend prefix after wrapping so that color codes don't affect length\n            return prefix + msg[12:]\n        return prefix + message\n\n\nclass State:\n    ''' Maintain logging level.'''\n\n    def __init__(self, log_name='mkdocs', level=logging.INFO):\n        self.logger = logging.getLogger(log_name)\n        # Don't restrict level on logger; use handler\n        self.logger.setLevel(1)\n        self.logger.propagate = False\n\n        self.stream = logging.StreamHandler()\n        self.stream.setFormatter(ColorFormatter())\n        self.stream.setLevel(level)\n        self.stream.name = 'MkDocsStreamHandler'\n        self.logger.addHandler(self.stream)\n\n        # Add CountHandler for strict mode\n        self.counter = utils.log_counter\n        self.counter.setLevel(logging.WARNING)\n        self.logger.addHandler(self.counter)\n\n\npass_state = click.make_pass_decorator(State, ensure=True)\n\nclean_help = \"Remove old files from the site_dir before building (the default).\"\nconfig_help = \"Provide a specific MkDocs config\"\ndev_addr_help = (\"IP address and port to serve documentation locally (default: \"\n                 \"localhost:8000)\")\nstrict_help = (\"Enable strict mode. This will cause MkDocs to abort the build \"\n               \"on any warnings.\")\ntheme_help = \"The theme to use when building your documentation.\"\ntheme_choices = utils.get_theme_names()\nsite_dir_help = \"The directory to output the result of the documentation build.\"\nuse_directory_urls_help = \"Use directory URLs when building pages (the default).\"\nreload_help = \"Enable the live reloading in the development server (this is the default)\"\nno_reload_help = \"Disable the live reloading in the development server.\"\ndirty_reload_help = \"Enable the live reloading in the development server, but only re-build files that have changed\"\ncommit_message_help = (\"A commit message to use when committing to the \"\n                       \"Github Pages remote branch. Commit {sha} and MkDocs {version} are available as expansions\")\nremote_branch_help = (\"The remote branch to commit to for Github Pages. This \"\n                      \"overrides the value specified in config\")\nremote_name_help = (\"The remote name to commit to for Github Pages. This \"\n                    \"overrides the value specified in config\")\nforce_help = \"Force the push to the repository.\"\nignore_version_help = \"Ignore check that build is not being deployed with an older version of MkDocs.\"\nwatch_theme_help = (\"Include the theme in list of files to watch for live reloading. \"\n                    \"Ignored when live reload is not used.\")\nshell_help = \"Use the shell when invoking Git.\"\n\n\ndef add_options(opts):\n    def inner(f):\n        for i in reversed(opts):\n            f = i(f)\n        return f\n\n    return inner\n\n\ndef verbose_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.stream.setLevel(logging.DEBUG)\n    return click.option('-v', '--verbose',\n                        is_flag=True,\n                        expose_value=False,\n                        help='Enable verbose output',\n                        callback=callback)(f)\n\n\ndef quiet_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.stream.setLevel(logging.ERROR)\n    return click.option('-q', '--quiet',\n                        is_flag=True,\n                        expose_value=False,\n                        help='Silence warnings',\n                        callback=callback)(f)\n\n\ncommon_options = add_options([quiet_option, verbose_option])\ncommon_config_options = add_options([\n    click.option('-f', '--config-file', type=click.File('rb'), help=config_help),\n    # Don't override config value if user did not specify --strict flag\n    # Conveniently, load_config drops None values\n    click.option('-s', '--strict', is_flag=True, default=None, help=strict_help),\n    click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help),\n    # As with --strict, set the default to None so that this doesn't incorrectly\n    # override the config file\n    click.option('--use-directory-urls/--no-directory-urls', is_flag=True, default=None, help=use_directory_urls_help)\n])\n\nPYTHON_VERSION = sys.version[:3]\n\nPKG_DIR = os.path.dirname(os.path.abspath(__file__))\n\n\n@click.group(context_settings={'help_option_names': ['-h', '--help']})\n@click.version_option(\n    __version__,\n    '-V', '--version',\n    message=f'%(prog)s, version %(version)s from { PKG_DIR } (Python { PYTHON_VERSION })'\n)\n@common_options\ndef cli():\n    \"\"\"\n    MkDocs - Project documentation with Markdown.\n    \"\"\"\n\n\n@cli.command(name=\"serve\")\n@click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')\n@click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help, default=True)\n@click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)\n@click.option('--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)\n@click.option('--watch-theme', help=watch_theme_help, is_flag=True)\n@common_config_options\n@common_options\ndef serve_command(dev_addr, livereload, **kwargs):\n    \"\"\"Run the builtin development server\"\"\"\n    serve.serve(dev_addr=dev_addr, livereload=livereload, **kwargs)\n\n\n@cli.command(name=\"build\")\n@click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)\n@common_config_options\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef build_command(clean, **kwargs):\n    \"\"\"Build the MkDocs documentation\"\"\"\n    build.build(config.load_config(**kwargs), dirty=not clean)\n\n\n@cli.command(name=\"gh-deploy\")\n@click.option('-c', '--clean/--dirty', is_flag=True, default=True, help=clean_help)\n@click.option('-m', '--message', help=commit_message_help)\n@click.option('-b', '--remote-branch', help=remote_branch_help)\n@click.option('-r', '--remote-name', help=remote_name_help)\n@click.option('--force', is_flag=True, help=force_help)\n@click.option('--ignore-version', is_flag=True, help=ignore_version_help)\n@click.option('--shell', is_flag=True, help=shell_help)\n@common_config_options\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef gh_deploy_command(clean, message, remote_branch, remote_name, force, ignore_version, shell, **kwargs):\n    \"\"\"Deploy your documentation to GitHub Pages\"\"\"\n    cfg = config.load_config(\n        remote_branch=remote_branch,\n        remote_name=remote_name,\n        **kwargs\n    )\n    build.build(cfg, dirty=not clean)\n    gh_deploy.gh_deploy(cfg, message=message, force=force, ignore_version=ignore_version, shell=shell)\n\n\n@cli.command(name=\"new\")\n@click.argument(\"project_directory\")\n@common_options\ndef new_command(project_directory):\n    \"\"\"Create a new MkDocs project\"\"\"\n    new.new(project_directory)\n\n\nif __name__ == '__main__':  # pragma: no cover\n    cli()\n", "path": "mkdocs/__main__.py"}]}