We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Configuration strict option not checking broken links
I was testing mkdocs earlier this year and was using "strict: true" in my mkdocs.yml. If I recall correctly, it was working then and building would break if there was a broken link in the .md.

However I am now using v0.14.0 and this config option seems to have no effect on the build - I get no warnings or errors when building regardless of the value of strict.


--- 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 # coding: utf-8
3 
4 from __future__ import unicode_literals
5 import logging
6 import click
7 import socket
8 
9 from mkdocs import __version__
10 from mkdocs import utils
11 from mkdocs import exceptions
12 from mkdocs.config import load_config
13 from mkdocs.commands import build, gh_deploy, new, serve
14 
15 log = logging.getLogger(__name__)
16 
17 # Disable the warning that Click displays (as of Click version 5.0) when users
18 # use unicode_literals in Python 2.
19 # See http://click.pocoo.org/dev/python3/#unicode-literals for more details.
20 click.disable_unicode_literals_warning = True
21 
22 
23 class State(object):
24     ''' Maintain logging level.'''
25 
26     def __init__(self, log_name='mkdocs', level=logging.INFO):
27         self.logger = logging.getLogger(log_name)
28         self.logger.propagate = False
29         stream = logging.StreamHandler()
30         formatter = logging.Formatter("%(levelname)-7s -  %(message)s ")
31         stream.setFormatter(formatter)
32         self.logger.addHandler(stream)
33 
34         self.logger.setLevel(level)
35 
36 
37 pass_state = click.make_pass_decorator(State, ensure=True)
38 
39 
40 def verbose_option(f):
41     def callback(ctx, param, value):
42         state = ctx.ensure_object(State)
43         if value:
44             state.logger.setLevel(logging.DEBUG)
45     return click.option('-v', '--verbose',
46                         is_flag=True,
47                         expose_value=False,
48                         help='Enable verbose output',
49                         callback=callback)(f)
50 
51 
52 def quiet_option(f):
53     def callback(ctx, param, value):
54         state = ctx.ensure_object(State)
55         if value:
56             state.logger.setLevel(logging.ERROR)
57     return click.option('-q', '--quiet',
58                         is_flag=True,
59                         expose_value=False,
60                         help='Silence warnings',
61                         callback=callback)(f)
62 
63 
64 def common_options(f):
65     f = verbose_option(f)
66     f = quiet_option(f)
67     return f
68 
69 
70 clean_help = "Remove old files from the site_dir before building"
71 config_help = "Provide a specific MkDocs config"
72 dev_addr_help = ("IP address and port to serve documentation locally (default: "
73                  "localhost:8000)")
74 strict_help = ("Enable strict mode. This will cause MkDocs to abort the build "
75                "on any warnings.")
76 theme_dir_help = "The theme directory to use when building your documentation."
77 theme_help = "The theme to use when building your documentation."
78 theme_choices = utils.get_theme_names()
79 site_dir_help = "The directory to output the result of the documentation build."
80 reload_help = "Enable the live reloading in the development server (this is the default)"
81 no_reload_help = "Disable the live reloading in the development server."
82 dirty_reload_help = "Enable the live reloading in the development server, but only re-build files that have changed"
83 commit_message_help = ("A commit message to use when commiting to the "
84                        "Github Pages remote branch")
85 remote_branch_help = ("The remote branch to commit to for Github Pages. This "
86                       "overrides the value specified in config")
87 remote_name_help = ("The remote name to commit to for Github Pages. This "
88                     "overrides the value specified in config")
89 
90 
91 @click.group(context_settings={'help_option_names': ['-h', '--help']})
92 @click.version_option(__version__, '-V', '--version')
93 @common_options
94 def cli():
95     """
96     MkDocs - Project documentation with Markdown.
97     """
98 
99 
100 @cli.command(name="serve")
101 @click.option('-f', '--config-file', type=click.File('rb'), help=config_help)
102 @click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')
103 @click.option('-s', '--strict', is_flag=True, help=strict_help)
104 @click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)
105 @click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)
106 @click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help)
107 @click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)
108 @click.option('-d', '--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)
109 @common_options
110 def serve_command(dev_addr, config_file, strict, theme, theme_dir, livereload):
111     """Run the builtin development server"""
112 
113     logging.getLogger('tornado').setLevel(logging.WARNING)
114 
115     try:
116         serve.serve(
117             config_file=config_file,
118             dev_addr=dev_addr,
119             strict=strict,
120             theme=theme,
121             theme_dir=theme_dir,
122             livereload=livereload
123         )
124     except (exceptions.ConfigurationError, socket.error) as e:
125         # Avoid ugly, unhelpful traceback
126         raise SystemExit('\n' + str(e))
127 
128 
129 @cli.command(name="build")
130 @click.option('-c', '--clean/--dirty', is_flag=True, help=clean_help)
131 @click.option('-f', '--config-file', type=click.File('rb'), help=config_help)
132 @click.option('-s', '--strict', is_flag=True, help=strict_help)
133 @click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)
134 @click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)
135 @click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)
136 @common_options
137 def build_command(clean, config_file, strict, theme, theme_dir, site_dir):
138     """Build the MkDocs documentation"""
139     try:
140         build.build(load_config(
141             config_file=config_file,
142             strict=strict,
143             theme=theme,
144             theme_dir=theme_dir,
145             site_dir=site_dir
146         ), dirty=not clean)
147     except exceptions.ConfigurationError as e:
148         # Avoid ugly, unhelpful traceback
149         raise SystemExit('\n' + str(e))
150 
151 
152 @cli.command(name="json")
153 @click.option('-c', '--clean', is_flag=True, help=clean_help)
154 @click.option('-f', '--config-file', type=click.File('rb'), help=config_help)
155 @click.option('-s', '--strict', is_flag=True, help=strict_help)
156 @click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)
157 @common_options
158 def json_command(clean, config_file, strict, site_dir):
159     """Build the MkDocs documentation to JSON files
160 
161     Rather than building your documentation to HTML pages, this
162     outputs each page in a simple JSON format. This command is
163     useful if you want to index your documentation in an external
164     search engine.
165     """
166 
167     log.warning("The json command is deprecated and will be removed in a "
168                 "future MkDocs release. For details on updating: "
169                 "http://www.mkdocs.org/about/release-notes/")
170 
171     try:
172         build.build(load_config(
173             config_file=config_file,
174             strict=strict,
175             site_dir=site_dir
176         ), dump_json=True, dirty=not clean)
177     except exceptions.ConfigurationError as e:
178         # Avoid ugly, unhelpful traceback
179         raise SystemExit('\n' + str(e))
180 
181 
182 @cli.command(name="gh-deploy")
183 @click.option('-c', '--clean', is_flag=True, help=clean_help)
184 @click.option('-f', '--config-file', type=click.File('rb'), help=config_help)
185 @click.option('-m', '--message', help=commit_message_help)
186 @click.option('-b', '--remote-branch', help=remote_branch_help)
187 @click.option('-r', '--remote-name', help=remote_name_help)
188 @common_options
189 def gh_deploy_command(config_file, clean, message, remote_branch, remote_name):
190     """Deploy your documentation to GitHub Pages"""
191     try:
192         config = load_config(
193             config_file=config_file,
194             remote_branch=remote_branch,
195             remote_name=remote_name
196         )
197         build.build(config, dirty=not clean)
198         gh_deploy.gh_deploy(config, message=message)
199     except exceptions.ConfigurationError as e:
200         # Avoid ugly, unhelpful traceback
201         raise SystemExit('\n' + str(e))
202 
203 
204 @cli.command(name="new")
205 @click.argument("project_directory")
206 @common_options
207 def new_command(project_directory):
208     """Create a new MkDocs project"""
209     new.new(project_directory)
210 
211 if __name__ == '__main__':
212     cli()
213
```
--- 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
@@ -9,7 +9,7 @@
 from mkdocs import __version__
 from mkdocs import utils
 from mkdocs import exceptions
-from mkdocs.config import load_config
+from mkdocs import config
 from mkdocs.commands import build, gh_deploy, new, serve
 
 log = logging.getLogger(__name__)
@@ -112,6 +112,10 @@
 
     logging.getLogger('tornado').setLevel(logging.WARNING)
 
+    # Don't override config value if user did not specify --strict flag
+    # Conveniently, load_config drops None values
+    strict = strict or None
+
     try:
         serve.serve(
             config_file=config_file,
@@ -136,8 +140,13 @@
 @common_options
 def build_command(clean, config_file, strict, theme, theme_dir, site_dir):
     """Build the MkDocs documentation"""
+
+    # Don't override config value if user did not specify --strict flag
+    # Conveniently, load_config drops None values
+    strict = strict or None
+
     try:
-        build.build(load_config(
+        build.build(config.load_config(
             config_file=config_file,
             strict=strict,
             theme=theme,
@@ -168,8 +177,12 @@
                 "future MkDocs release. For details on updating: "
                 "http://www.mkdocs.org/about/release-notes/")
 
+    # Don't override config value if user did not specify --strict flag
+    # Conveniently, load_config drops None values
+    strict = strict or None
+
     try:
-        build.build(load_config(
+        build.build(config.load_config(
             config_file=config_file,
             strict=strict,
             site_dir=site_dir
@@ -189,13 +202,13 @@
 def gh_deploy_command(config_file, clean, message, remote_branch, remote_name):
     """Deploy your documentation to GitHub Pages"""
     try:
-        config = load_config(
+        cfg = config.load_config(
             config_file=config_file,
             remote_branch=remote_branch,
             remote_name=remote_name
         )
-        build.build(config, dirty=not clean)
-        gh_deploy.gh_deploy(config, message=message)
+        build.build(cfg, dirty=not clean)
+        gh_deploy.gh_deploy(cfg, message=message)
     except exceptions.ConfigurationError as e:
         # Avoid ugly, unhelpful traceback
         raise SystemExit('\n' + str(e))

{"golden_diff": "diff --git a/mkdocs/__main__.py b/mkdocs/__main__.py\n--- a/mkdocs/__main__.py\n+++ b/mkdocs/__main__.py\n@@ -9,7 +9,7 @@\n from mkdocs import __version__\n from mkdocs import utils\n from mkdocs import exceptions\n-from mkdocs.config import load_config\n+from mkdocs import config\n from mkdocs.commands import build, gh_deploy, new, serve\n \n log = logging.getLogger(__name__)\n@@ -112,6 +112,10 @@\n \n     logging.getLogger('tornado').setLevel(logging.WARNING)\n \n+    # Don't override config value if user did not specify --strict flag\n+    # Conveniently, load_config drops None values\n+    strict = strict or None\n+\n     try:\n         serve.serve(\n             config_file=config_file,\n@@ -136,8 +140,13 @@\n @common_options\n def build_command(clean, config_file, strict, theme, theme_dir, site_dir):\n     \"\"\"Build the MkDocs documentation\"\"\"\n+\n+    # Don't override config value if user did not specify --strict flag\n+    # Conveniently, load_config drops None values\n+    strict = strict or None\n+\n     try:\n-        build.build(load_config(\n+        build.build(config.load_config(\n             config_file=config_file,\n             strict=strict,\n             theme=theme,\n@@ -168,8 +177,12 @@\n                 \"future MkDocs release. For details on updating: \"\n                 \"http://www.mkdocs.org/about/release-notes/\")\n \n+    # Don't override config value if user did not specify --strict flag\n+    # Conveniently, load_config drops None values\n+    strict = strict or None\n+\n     try:\n-        build.build(load_config(\n+        build.build(config.load_config(\n             config_file=config_file,\n             strict=strict,\n             site_dir=site_dir\n@@ -189,13 +202,13 @@\n def gh_deploy_command(config_file, clean, message, remote_branch, remote_name):\n     \"\"\"Deploy your documentation to GitHub Pages\"\"\"\n     try:\n-        config = load_config(\n+        cfg = config.load_config(\n             config_file=config_file,\n             remote_branch=remote_branch,\n             remote_name=remote_name\n         )\n-        build.build(config, dirty=not clean)\n-        gh_deploy.gh_deploy(config, message=message)\n+        build.build(cfg, dirty=not clean)\n+        gh_deploy.gh_deploy(cfg, message=message)\n     except exceptions.ConfigurationError as e:\n         # Avoid ugly, unhelpful traceback\n         raise SystemExit('\\n' + str(e))\n", "issue": "Configuration strict option not checking broken links\nI was testing mkdocs earlier this year and was using \"strict: true\" in my mkdocs.yml. If I recall correctly, it was working then and building would break if there was a broken link in the .md.\n\nHowever I am now using v0.14.0 and this config option seems to have no effect on the build - I get no warnings or errors when building regardless of the value of strict.\n\n", "before_files": [{"content": "#!/usr/bin/env python\n# coding: utf-8\n\nfrom __future__ import unicode_literals\nimport logging\nimport click\nimport socket\n\nfrom mkdocs import __version__\nfrom mkdocs import utils\nfrom mkdocs import exceptions\nfrom mkdocs.config import load_config\nfrom mkdocs.commands import build, gh_deploy, new, serve\n\nlog = logging.getLogger(__name__)\n\n# Disable the warning that Click displays (as of Click version 5.0) when users\n# use unicode_literals in Python 2.\n# See http://click.pocoo.org/dev/python3/#unicode-literals for more details.\nclick.disable_unicode_literals_warning = True\n\n\nclass State(object):\n    ''' Maintain logging level.'''\n\n    def __init__(self, log_name='mkdocs', level=logging.INFO):\n        self.logger = logging.getLogger(log_name)\n        self.logger.propagate = False\n        stream = logging.StreamHandler()\n        formatter = logging.Formatter(\"%(levelname)-7s -  %(message)s \")\n        stream.setFormatter(formatter)\n        self.logger.addHandler(stream)\n\n        self.logger.setLevel(level)\n\n\npass_state = click.make_pass_decorator(State, ensure=True)\n\n\ndef verbose_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.logger.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.logger.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\ndef common_options(f):\n    f = verbose_option(f)\n    f = quiet_option(f)\n    return f\n\n\nclean_help = \"Remove old files from the site_dir before building\"\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_dir_help = \"The theme directory to use when building your documentation.\"\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.\"\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 commiting to the \"\n                       \"Github Pages remote branch\")\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\")\n\n\n@click.group(context_settings={'help_option_names': ['-h', '--help']})\n@click.version_option(__version__, '-V', '--version')\n@common_options\ndef cli():\n    \"\"\"\n    MkDocs - Project documentation with Markdown.\n    \"\"\"\n\n\n@cli.command(name=\"serve\")\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)\n@click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)\n@click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help)\n@click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)\n@click.option('-d', '--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)\n@common_options\ndef serve_command(dev_addr, config_file, strict, theme, theme_dir, livereload):\n    \"\"\"Run the builtin development server\"\"\"\n\n    logging.getLogger('tornado').setLevel(logging.WARNING)\n\n    try:\n        serve.serve(\n            config_file=config_file,\n            dev_addr=dev_addr,\n            strict=strict,\n            theme=theme,\n            theme_dir=theme_dir,\n            livereload=livereload\n        )\n    except (exceptions.ConfigurationError, socket.error) as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"build\")\n@click.option('-c', '--clean/--dirty', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)\n@click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef build_command(clean, config_file, strict, theme, theme_dir, site_dir):\n    \"\"\"Build the MkDocs documentation\"\"\"\n    try:\n        build.build(load_config(\n            config_file=config_file,\n            strict=strict,\n            theme=theme,\n            theme_dir=theme_dir,\n            site_dir=site_dir\n        ), dirty=not clean)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"json\")\n@click.option('-c', '--clean', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef json_command(clean, config_file, strict, site_dir):\n    \"\"\"Build the MkDocs documentation to JSON files\n\n    Rather than building your documentation to HTML pages, this\n    outputs each page in a simple JSON format. This command is\n    useful if you want to index your documentation in an external\n    search engine.\n    \"\"\"\n\n    log.warning(\"The json command is deprecated and will be removed in a \"\n                \"future MkDocs release. For details on updating: \"\n                \"http://www.mkdocs.org/about/release-notes/\")\n\n    try:\n        build.build(load_config(\n            config_file=config_file,\n            strict=strict,\n            site_dir=site_dir\n        ), dump_json=True, dirty=not clean)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"gh-deploy\")\n@click.option('-c', '--clean', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_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@common_options\ndef gh_deploy_command(config_file, clean, message, remote_branch, remote_name):\n    \"\"\"Deploy your documentation to GitHub Pages\"\"\"\n    try:\n        config = load_config(\n            config_file=config_file,\n            remote_branch=remote_branch,\n            remote_name=remote_name\n        )\n        build.build(config, dirty=not clean)\n        gh_deploy.gh_deploy(config, message=message)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\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\nif __name__ == '__main__':\n    cli()\n", "path": "mkdocs/__main__.py"}], "after_files": [{"content": "#!/usr/bin/env python\n# coding: utf-8\n\nfrom __future__ import unicode_literals\nimport logging\nimport click\nimport socket\n\nfrom mkdocs import __version__\nfrom mkdocs import utils\nfrom mkdocs import exceptions\nfrom mkdocs import config\nfrom mkdocs.commands import build, gh_deploy, new, serve\n\nlog = logging.getLogger(__name__)\n\n# Disable the warning that Click displays (as of Click version 5.0) when users\n# use unicode_literals in Python 2.\n# See http://click.pocoo.org/dev/python3/#unicode-literals for more details.\nclick.disable_unicode_literals_warning = True\n\n\nclass State(object):\n    ''' Maintain logging level.'''\n\n    def __init__(self, log_name='mkdocs', level=logging.INFO):\n        self.logger = logging.getLogger(log_name)\n        self.logger.propagate = False\n        stream = logging.StreamHandler()\n        formatter = logging.Formatter(\"%(levelname)-7s -  %(message)s \")\n        stream.setFormatter(formatter)\n        self.logger.addHandler(stream)\n\n        self.logger.setLevel(level)\n\n\npass_state = click.make_pass_decorator(State, ensure=True)\n\n\ndef verbose_option(f):\n    def callback(ctx, param, value):\n        state = ctx.ensure_object(State)\n        if value:\n            state.logger.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.logger.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\ndef common_options(f):\n    f = verbose_option(f)\n    f = quiet_option(f)\n    return f\n\n\nclean_help = \"Remove old files from the site_dir before building\"\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_dir_help = \"The theme directory to use when building your documentation.\"\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.\"\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 commiting to the \"\n                       \"Github Pages remote branch\")\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\")\n\n\n@click.group(context_settings={'help_option_names': ['-h', '--help']})\n@click.version_option(__version__, '-V', '--version')\n@common_options\ndef cli():\n    \"\"\"\n    MkDocs - Project documentation with Markdown.\n    \"\"\"\n\n\n@cli.command(name=\"serve\")\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-a', '--dev-addr', help=dev_addr_help, metavar='<IP:PORT>')\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)\n@click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)\n@click.option('--livereload', 'livereload', flag_value='livereload', help=reload_help)\n@click.option('--no-livereload', 'livereload', flag_value='no-livereload', help=no_reload_help)\n@click.option('-d', '--dirtyreload', 'livereload', flag_value='dirty', help=dirty_reload_help)\n@common_options\ndef serve_command(dev_addr, config_file, strict, theme, theme_dir, livereload):\n    \"\"\"Run the builtin development server\"\"\"\n\n    logging.getLogger('tornado').setLevel(logging.WARNING)\n\n    # Don't override config value if user did not specify --strict flag\n    # Conveniently, load_config drops None values\n    strict = strict or None\n\n    try:\n        serve.serve(\n            config_file=config_file,\n            dev_addr=dev_addr,\n            strict=strict,\n            theme=theme,\n            theme_dir=theme_dir,\n            livereload=livereload\n        )\n    except (exceptions.ConfigurationError, socket.error) as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"build\")\n@click.option('-c', '--clean/--dirty', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-t', '--theme', type=click.Choice(theme_choices), help=theme_help)\n@click.option('-e', '--theme-dir', type=click.Path(), help=theme_dir_help)\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef build_command(clean, config_file, strict, theme, theme_dir, site_dir):\n    \"\"\"Build the MkDocs documentation\"\"\"\n\n    # Don't override config value if user did not specify --strict flag\n    # Conveniently, load_config drops None values\n    strict = strict or None\n\n    try:\n        build.build(config.load_config(\n            config_file=config_file,\n            strict=strict,\n            theme=theme,\n            theme_dir=theme_dir,\n            site_dir=site_dir\n        ), dirty=not clean)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"json\")\n@click.option('-c', '--clean', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_help)\n@click.option('-s', '--strict', is_flag=True, help=strict_help)\n@click.option('-d', '--site-dir', type=click.Path(), help=site_dir_help)\n@common_options\ndef json_command(clean, config_file, strict, site_dir):\n    \"\"\"Build the MkDocs documentation to JSON files\n\n    Rather than building your documentation to HTML pages, this\n    outputs each page in a simple JSON format. This command is\n    useful if you want to index your documentation in an external\n    search engine.\n    \"\"\"\n\n    log.warning(\"The json command is deprecated and will be removed in a \"\n                \"future MkDocs release. For details on updating: \"\n                \"http://www.mkdocs.org/about/release-notes/\")\n\n    # Don't override config value if user did not specify --strict flag\n    # Conveniently, load_config drops None values\n    strict = strict or None\n\n    try:\n        build.build(config.load_config(\n            config_file=config_file,\n            strict=strict,\n            site_dir=site_dir\n        ), dump_json=True, dirty=not clean)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\n\n\n@cli.command(name=\"gh-deploy\")\n@click.option('-c', '--clean', is_flag=True, help=clean_help)\n@click.option('-f', '--config-file', type=click.File('rb'), help=config_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@common_options\ndef gh_deploy_command(config_file, clean, message, remote_branch, remote_name):\n    \"\"\"Deploy your documentation to GitHub Pages\"\"\"\n    try:\n        cfg = config.load_config(\n            config_file=config_file,\n            remote_branch=remote_branch,\n            remote_name=remote_name\n        )\n        build.build(cfg, dirty=not clean)\n        gh_deploy.gh_deploy(cfg, message=message)\n    except exceptions.ConfigurationError as e:\n        # Avoid ugly, unhelpful traceback\n        raise SystemExit('\\n' + str(e))\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\nif __name__ == '__main__':\n    cli()\n", "path": "mkdocs/__main__.py"}]}