prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Documentation for the v2 of the configuration file
  At first, I was thinking to automate this given the schema, but the spec isn't very large so we can just hand-write this without too much effort.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `docs/doc_extensions.py`
  Content:
  ```
  1 """
  2 Read the Docs documentation extensions for Sphinx
  3 
  4 Adds the following roles:
  5 
  6 djangosetting
  7     Output an inline literal of the corresponding setting value. Useful for
  8     keeping documentation up to date without editing on settings changes.
  9 """
  10 
  11 from docutils import nodes, utils
  12 
  13 from django.conf import settings
  14 
  15 from readthedocs.projects.models import Feature
  16 
  17 
  18 def django_setting_role(typ, rawtext, text, lineno, inliner, options=None,
  19                         content=None):
  20     """Always up to date Django settings from the application"""
  21     dj_setting = getattr(settings, utils.unescape(text), 'None')
  22     node = nodes.literal(dj_setting, dj_setting)
  23     return [node], []
  24 
  25 
  26 def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,
  27                         content=None):
  28     """Up to date feature flags from the application."""
  29     all_features = Feature.FEATURES
  30     requested_feature = utils.unescape(text)
  31     for feature in all_features:
  32         if requested_feature.lower() == feature[0].lower():
  33             desc = nodes.Text(feature[1], feature[1])
  34     return [desc], []
  35 
  36 
  37 def setup(_):
  38     from docutils.parsers.rst import roles
  39     roles.register_local_role(
  40         'djangosetting',
  41         django_setting_role
  42     )
  43     roles.register_local_role(
  44         'featureflags',
  45         feature_flags_role
  46     )
  47 
  48     return {
  49         'version': 'builtin',
  50         'parallel_read_safe': True,
  51         'parallel_write_safe': True,
  52     }
  53
  ```
  --- 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()
  
  ```
  
golden_diff: diff --git a/docs/doc_extensions.py b/docs/doc_extensions.py
  --- a/docs/doc_extensions.py
  +++ b/docs/doc_extensions.py
  @@ -6,11 +6,14 @@
   djangosetting
       Output an inline literal of the corresponding setting value. Useful for
       keeping documentation up to date without editing on settings changes.
  -"""
   
  -from docutils import nodes, utils
  +buildpyversions
  +    Output a comma separated list of the supported python versions for a
  +    Read the Docs build image.
  +"""
   
   from django.conf import settings
  +from docutils import nodes, utils
   
   from readthedocs.projects.models import Feature
   
  @@ -23,8 +26,23 @@
       return [node], []
   
   
  +def python_supported_versions_role(typ, rawtext, text, lineno, inliner,
  +                                   options=None, content=None):
  +    """Up to date supported python versions for each build image."""
  +    image = '{}:{}'.format(settings.DOCKER_DEFAULT_IMAGE, text)
  +    image_settings = settings.DOCKER_IMAGE_SETTINGS[image]
  +    python_versions = image_settings['python']['supported_versions']
  +    node_list = []
  +    separator = ', '
  +    for i, version in enumerate(python_versions):
  +        node_list.append(nodes.literal(version, version))
  +        if i < len(python_versions) - 1:
  +            node_list.append(nodes.Text(separator))
  +    return (node_list, [])
  +
  +
   def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,
  -                        content=None):
  +                       content=None):
       """Up to date feature flags from the application."""
       all_features = Feature.FEATURES
       requested_feature = utils.unescape(text)
  @@ -40,9 +58,13 @@
           'djangosetting',
           django_setting_role
       )
  +    roles.register_local_role(
  +        'buildpyversions',
  +        python_supported_versions_role,
  +    )
       roles.register_local_role(
           'featureflags',
  -        feature_flags_role
  +        feature_flags_role,
       )
   
       return {
  
verification_info: {"golden_diff": "diff --git a/docs/doc_extensions.py b/docs/doc_extensions.py\n--- a/docs/doc_extensions.py\n+++ b/docs/doc_extensions.py\n@@ -6,11 +6,14 @@\n djangosetting\n     Output an inline literal of the corresponding setting value. Useful for\n     keeping documentation up to date without editing on settings changes.\n-\"\"\"\n \n-from docutils import nodes, utils\n+buildpyversions\n+    Output a comma separated list of the supported python versions for a\n+    Read the Docs build image.\n+\"\"\"\n \n from django.conf import settings\n+from docutils import nodes, utils\n \n from readthedocs.projects.models import Feature\n \n@@ -23,8 +26,23 @@\n     return [node], []\n \n \n+def python_supported_versions_role(typ, rawtext, text, lineno, inliner,\n+                                   options=None, content=None):\n+    \"\"\"Up to date supported python versions for each build image.\"\"\"\n+    image = '{}:{}'.format(settings.DOCKER_DEFAULT_IMAGE, text)\n+    image_settings = settings.DOCKER_IMAGE_SETTINGS[image]\n+    python_versions = image_settings['python']['supported_versions']\n+    node_list = []\n+    separator = ', '\n+    for i, version in enumerate(python_versions):\n+        node_list.append(nodes.literal(version, version))\n+        if i < len(python_versions) - 1:\n+            node_list.append(nodes.Text(separator))\n+    return (node_list, [])\n+\n+\n def feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,\n-                        content=None):\n+                       content=None):\n     \"\"\"Up to date feature flags from the application.\"\"\"\n     all_features = Feature.FEATURES\n     requested_feature = utils.unescape(text)\n@@ -40,9 +58,13 @@\n         'djangosetting',\n         django_setting_role\n     )\n+    roles.register_local_role(\n+        'buildpyversions',\n+        python_supported_versions_role,\n+    )\n     roles.register_local_role(\n         'featureflags',\n-        feature_flags_role\n+        feature_flags_role,\n     )\n \n     return {\n", "issue": "Documentation for the v2 of the configuration file\nAt first, I was thinking to automate this given the schema, but the spec isn't very large so we can just hand-write this without too much effort.\n", "before_files": [{"content": "\"\"\"\nRead the Docs documentation extensions for Sphinx\n\nAdds the following roles:\n\ndjangosetting\n    Output an inline literal of the corresponding setting value. Useful for\n    keeping documentation up to date without editing on settings changes.\n\"\"\"\n\nfrom docutils import nodes, utils\n\nfrom django.conf import settings\n\nfrom readthedocs.projects.models import Feature\n\n\ndef django_setting_role(typ, rawtext, text, lineno, inliner, options=None,\n                        content=None):\n    \"\"\"Always up to date Django settings from the application\"\"\"\n    dj_setting = getattr(settings, utils.unescape(text), 'None')\n    node = nodes.literal(dj_setting, dj_setting)\n    return [node], []\n\n\ndef feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,\n                        content=None):\n    \"\"\"Up to date feature flags from the application.\"\"\"\n    all_features = Feature.FEATURES\n    requested_feature = utils.unescape(text)\n    for feature in all_features:\n        if requested_feature.lower() == feature[0].lower():\n            desc = nodes.Text(feature[1], feature[1])\n    return [desc], []\n\n\ndef setup(_):\n    from docutils.parsers.rst import roles\n    roles.register_local_role(\n        'djangosetting',\n        django_setting_role\n    )\n    roles.register_local_role(\n        'featureflags',\n        feature_flags_role\n    )\n\n    return {\n        'version': 'builtin',\n        'parallel_read_safe': True,\n        'parallel_write_safe': True,\n    }\n", "path": "docs/doc_extensions.py"}], "after_files": [{"content": "\"\"\"\nRead the Docs documentation extensions for Sphinx\n\nAdds the following roles:\n\ndjangosetting\n    Output an inline literal of the corresponding setting value. Useful for\n    keeping documentation up to date without editing on settings changes.\n\nbuildpyversions\n    Output a comma separated list of the supported python versions for a\n    Read the Docs build image.\n\"\"\"\n\nfrom django.conf import settings\nfrom docutils import nodes, utils\n\nfrom readthedocs.projects.models import Feature\n\n\ndef django_setting_role(typ, rawtext, text, lineno, inliner, options=None,\n                        content=None):\n    \"\"\"Always up to date Django settings from the application\"\"\"\n    dj_setting = getattr(settings, utils.unescape(text), 'None')\n    node = nodes.literal(dj_setting, dj_setting)\n    return [node], []\n\n\ndef python_supported_versions_role(typ, rawtext, text, lineno, inliner,\n                                   options=None, content=None):\n    \"\"\"Up to date supported python versions for each build image.\"\"\"\n    image = '{}:{}'.format(settings.DOCKER_DEFAULT_IMAGE, text)\n    image_settings = settings.DOCKER_IMAGE_SETTINGS[image]\n    python_versions = image_settings['python']['supported_versions']\n    node_list = []\n    separator = ', '\n    for i, version in enumerate(python_versions):\n        node_list.append(nodes.literal(version, version))\n        if i < len(python_versions) - 1:\n            node_list.append(nodes.Text(separator))\n    return (node_list, [])\n\n\ndef feature_flags_role(typ, rawtext, text, lineno, inliner, options=None,\n                       content=None):\n    \"\"\"Up to date feature flags from the application.\"\"\"\n    all_features = Feature.FEATURES\n    requested_feature = utils.unescape(text)\n    for feature in all_features:\n        if requested_feature.lower() == feature[0].lower():\n            desc = nodes.Text(feature[1], feature[1])\n    return [desc], []\n\n\ndef setup(_):\n    from docutils.parsers.rst import roles\n    roles.register_local_role(\n        'djangosetting',\n        django_setting_role\n    )\n    roles.register_local_role(\n        'buildpyversions',\n        python_supported_versions_role,\n    )\n    roles.register_local_role(\n        'featureflags',\n        feature_flags_role,\n    )\n\n    return {\n        'version': 'builtin',\n        'parallel_read_safe': True,\n        'parallel_write_safe': True,\n    }\n", "path": "docs/doc_extensions.py"}]}