We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
ReadTheDocs spacing is off for providers
http://fake-factory.readthedocs.org/en/latest/providers/internet.html

The spacing makes this pretty unreadable without constantly scrolling back and forth, which is annoying. 

Since these are the official extended docs linked to in the project ReadMe, it'd certainly be aesthetically nicer if they used native RTD formatting, for example see the formatting for the reference page of the factory boy project: http://factoryboy.readthedocs.org/en/latest/reference.html

I dug around a little trying to make a pull request to fix this, but it looks like Faker's docs are auto-generated somehow and I didn't have time to figure it all out. If you point me in the right direction, I'd be happy to submit a PR. 


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `faker/build_docs.py`
Content:
```
1 # coding=utf-8
2 
3 from __future__ import print_function
4 from __future__ import unicode_literals
5 
6 import os
7 import sys
8 
9 
10 if sys.version < '3':
11     text_type = unicode
12     binary_type = str
13 else:
14     text_type = str
15     binary_type = bytes
16 
17 
18 DOCS_ROOT = os.path.abspath(os.path.join('..', 'docs'))
19 
20 
21 def write(fh, s):
22     return fh.write(s.encode('utf-8'))
23 
24 
25 def write_provider(fh, doc, provider, formatters, excludes=None):
26 
27     if excludes is None:
28         excludes = []
29 
30     write(fh, '\n')
31     title = "``{0}``".format(doc.get_provider_name(provider))
32     write(fh, '%s\n' % title)
33     write(fh, "-" * len(title))
34     write(fh, '\n\n::\n')
35 
36     for signature, example in formatters.items():
37         if signature in excludes:
38             continue
39         try:
40             lines = text_type(example).expandtabs().splitlines()
41         except UnicodeEncodeError:
42             msg = 'error on "{0}" with value "{1}"'.format(signature, example)
43             raise Exception(msg)
44         margin = max(30, doc.max_name_len+1)
45         remains = 150 - margin
46         separator = '#'
47         write(fh, '\n')
48         for line in lines:
49             for i in range(0, (len(line) // remains) + 1):
50                 write(fh, "\t{fake:<{margin}}{separator} {example}".format(
51                     fake=signature,
52                     separator=separator,
53                     example=line[i*remains:(i+1)*remains],
54                     margin=margin
55                 ))
56                 signature = separator = ' '
57     write(fh, '\n')
58 
59 
60 def write_docs(*args, **kwargs):
61     from faker import Faker, documentor
62     from faker.config import DEFAULT_LOCALE, AVAILABLE_LOCALES
63 
64     fake = Faker(locale=DEFAULT_LOCALE)
65 
66     from faker.providers import BaseProvider
67     base_provider_formatters = [f for f in dir(BaseProvider)]
68 
69     doc = documentor.Documentor(fake)
70 
71     formatters = doc.get_formatters(with_args=True, with_defaults=True)
72 
73     for provider, fakers in formatters:
74         provider_name = doc.get_provider_name(provider)
75         fname = os.path.join(DOCS_ROOT, 'providers', '%s.rst' % provider_name)
76         with open(fname, 'wb') as fh:
77             write_provider(fh, doc, provider, fakers)
78 
79     with open(os.path.join(DOCS_ROOT, 'providers.rst'), 'wb') as fh:
80         write(fh, 'Providers\n')
81         write(fh, '=========\n')
82         write(fh, '.. toctree::\n')
83         write(fh, '   :maxdepth: 2\n\n')
84         [write(fh, '   providers/%s\n' % doc.get_provider_name(provider))
85          for provider, fakers in formatters]
86 
87     AVAILABLE_LOCALES = list(AVAILABLE_LOCALES)
88     AVAILABLE_LOCALES.sort()
89     for lang in AVAILABLE_LOCALES:
90         fname = os.path.join(DOCS_ROOT, 'locales', '%s.rst' % lang)
91         with open(fname, 'wb') as fh:
92             write(fh, '\n')
93             title = 'Language {0}\n'.format(lang)
94             write(fh, title)
95             write(fh, '=' * len(title))
96             write(fh, '\n')
97             fake = Faker(locale=lang)
98             d = documentor.Documentor(fake)
99 
100             for p, fs in d.get_formatters(with_args=True, with_defaults=True,
101                                           locale=lang,
102                                           excludes=base_provider_formatters):
103                 write_provider(fh, d, p, fs)
104 
105     with open(os.path.join(DOCS_ROOT, 'locales.rst'), 'wb') as fh:
106         write(fh, 'Locales\n')
107         write(fh, '=======\n')
108         write(fh, '.. toctree::\n')
109         write(fh, '   :maxdepth: 2\n\n')
110         [write(fh, '   locales/%s\n' % lang) for lang in AVAILABLE_LOCALES]
111 
112 
113 # wrappers for sphinx
114 def _main(app, *args, **kwargs):
115     return write_docs(*args, **kwargs)
116 
117 
118 def setup(app):
119     app.connect(str('builder-inited'), _main)
120 
121 
122 if __name__ == "__main__":
123     write_docs(*sys.argv[1:])
124
```
--- 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/faker/build_docs.py b/faker/build_docs.py
--- a/faker/build_docs.py
+++ b/faker/build_docs.py
@@ -41,20 +41,11 @@
         except UnicodeEncodeError:
             msg = 'error on "{0}" with value "{1}"'.format(signature, example)
             raise Exception(msg)
-        margin = max(30, doc.max_name_len+1)
-        remains = 150 - margin
-        separator = '#'
         write(fh, '\n')
-        for line in lines:
-            for i in range(0, (len(line) // remains) + 1):
-                write(fh, "\t{fake:<{margin}}{separator} {example}".format(
-                    fake=signature,
-                    separator=separator,
-                    example=line[i*remains:(i+1)*remains],
-                    margin=margin
-                ))
-                signature = separator = ' '
-    write(fh, '\n')
+        write(fh, "\t{fake}\n{example}\n".format(
+            fake=signature,
+            example='\n'.join(['\t# ' + line for line in lines]),
+        ))
 
 
 def write_docs(*args, **kwargs):

{"golden_diff": "diff --git a/faker/build_docs.py b/faker/build_docs.py\n--- a/faker/build_docs.py\n+++ b/faker/build_docs.py\n@@ -41,20 +41,11 @@\n         except UnicodeEncodeError:\n             msg = 'error on \"{0}\" with value \"{1}\"'.format(signature, example)\n             raise Exception(msg)\n-        margin = max(30, doc.max_name_len+1)\n-        remains = 150 - margin\n-        separator = '#'\n         write(fh, '\\n')\n-        for line in lines:\n-            for i in range(0, (len(line) // remains) + 1):\n-                write(fh, \"\\t{fake:<{margin}}{separator} {example}\".format(\n-                    fake=signature,\n-                    separator=separator,\n-                    example=line[i*remains:(i+1)*remains],\n-                    margin=margin\n-                ))\n-                signature = separator = ' '\n-    write(fh, '\\n')\n+        write(fh, \"\\t{fake}\\n{example}\\n\".format(\n+            fake=signature,\n+            example='\\n'.join(['\\t# ' + line for line in lines]),\n+        ))\n \n \n def write_docs(*args, **kwargs):\n", "issue": "ReadTheDocs spacing is off for providers\nhttp://fake-factory.readthedocs.org/en/latest/providers/internet.html\n\nThe spacing makes this pretty unreadable without constantly scrolling back and forth, which is annoying. \n\nSince these are the official extended docs linked to in the project ReadMe, it'd certainly be aesthetically nicer if they used native RTD formatting, for example see the formatting for the reference page of the factory boy project: http://factoryboy.readthedocs.org/en/latest/reference.html\n\nI dug around a little trying to make a pull request to fix this, but it looks like Faker's docs are auto-generated somehow and I didn't have time to figure it all out. If you point me in the right direction, I'd be happy to submit a PR. \n\n", "before_files": [{"content": "# coding=utf-8\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\n\n\nif sys.version < '3':\n    text_type = unicode\n    binary_type = str\nelse:\n    text_type = str\n    binary_type = bytes\n\n\nDOCS_ROOT = os.path.abspath(os.path.join('..', 'docs'))\n\n\ndef write(fh, s):\n    return fh.write(s.encode('utf-8'))\n\n\ndef write_provider(fh, doc, provider, formatters, excludes=None):\n\n    if excludes is None:\n        excludes = []\n\n    write(fh, '\\n')\n    title = \"``{0}``\".format(doc.get_provider_name(provider))\n    write(fh, '%s\\n' % title)\n    write(fh, \"-\" * len(title))\n    write(fh, '\\n\\n::\\n')\n\n    for signature, example in formatters.items():\n        if signature in excludes:\n            continue\n        try:\n            lines = text_type(example).expandtabs().splitlines()\n        except UnicodeEncodeError:\n            msg = 'error on \"{0}\" with value \"{1}\"'.format(signature, example)\n            raise Exception(msg)\n        margin = max(30, doc.max_name_len+1)\n        remains = 150 - margin\n        separator = '#'\n        write(fh, '\\n')\n        for line in lines:\n            for i in range(0, (len(line) // remains) + 1):\n                write(fh, \"\\t{fake:<{margin}}{separator} {example}\".format(\n                    fake=signature,\n                    separator=separator,\n                    example=line[i*remains:(i+1)*remains],\n                    margin=margin\n                ))\n                signature = separator = ' '\n    write(fh, '\\n')\n\n\ndef write_docs(*args, **kwargs):\n    from faker import Faker, documentor\n    from faker.config import DEFAULT_LOCALE, AVAILABLE_LOCALES\n\n    fake = Faker(locale=DEFAULT_LOCALE)\n\n    from faker.providers import BaseProvider\n    base_provider_formatters = [f for f in dir(BaseProvider)]\n\n    doc = documentor.Documentor(fake)\n\n    formatters = doc.get_formatters(with_args=True, with_defaults=True)\n\n    for provider, fakers in formatters:\n        provider_name = doc.get_provider_name(provider)\n        fname = os.path.join(DOCS_ROOT, 'providers', '%s.rst' % provider_name)\n        with open(fname, 'wb') as fh:\n            write_provider(fh, doc, provider, fakers)\n\n    with open(os.path.join(DOCS_ROOT, 'providers.rst'), 'wb') as fh:\n        write(fh, 'Providers\\n')\n        write(fh, '=========\\n')\n        write(fh, '.. toctree::\\n')\n        write(fh, '   :maxdepth: 2\\n\\n')\n        [write(fh, '   providers/%s\\n' % doc.get_provider_name(provider))\n         for provider, fakers in formatters]\n\n    AVAILABLE_LOCALES = list(AVAILABLE_LOCALES)\n    AVAILABLE_LOCALES.sort()\n    for lang in AVAILABLE_LOCALES:\n        fname = os.path.join(DOCS_ROOT, 'locales', '%s.rst' % lang)\n        with open(fname, 'wb') as fh:\n            write(fh, '\\n')\n            title = 'Language {0}\\n'.format(lang)\n            write(fh, title)\n            write(fh, '=' * len(title))\n            write(fh, '\\n')\n            fake = Faker(locale=lang)\n            d = documentor.Documentor(fake)\n\n            for p, fs in d.get_formatters(with_args=True, with_defaults=True,\n                                          locale=lang,\n                                          excludes=base_provider_formatters):\n                write_provider(fh, d, p, fs)\n\n    with open(os.path.join(DOCS_ROOT, 'locales.rst'), 'wb') as fh:\n        write(fh, 'Locales\\n')\n        write(fh, '=======\\n')\n        write(fh, '.. toctree::\\n')\n        write(fh, '   :maxdepth: 2\\n\\n')\n        [write(fh, '   locales/%s\\n' % lang) for lang in AVAILABLE_LOCALES]\n\n\n# wrappers for sphinx\ndef _main(app, *args, **kwargs):\n    return write_docs(*args, **kwargs)\n\n\ndef setup(app):\n    app.connect(str('builder-inited'), _main)\n\n\nif __name__ == \"__main__\":\n    write_docs(*sys.argv[1:])\n", "path": "faker/build_docs.py"}], "after_files": [{"content": "# coding=utf-8\n\nfrom __future__ import print_function\nfrom __future__ import unicode_literals\n\nimport os\nimport sys\n\n\nif sys.version < '3':\n    text_type = unicode\n    binary_type = str\nelse:\n    text_type = str\n    binary_type = bytes\n\n\nDOCS_ROOT = os.path.abspath(os.path.join('..', 'docs'))\n\n\ndef write(fh, s):\n    return fh.write(s.encode('utf-8'))\n\n\ndef write_provider(fh, doc, provider, formatters, excludes=None):\n\n    if excludes is None:\n        excludes = []\n\n    write(fh, '\\n')\n    title = \"``{0}``\".format(doc.get_provider_name(provider))\n    write(fh, '%s\\n' % title)\n    write(fh, \"-\" * len(title))\n    write(fh, '\\n\\n::\\n')\n\n    for signature, example in formatters.items():\n        if signature in excludes:\n            continue\n        try:\n            lines = text_type(example).expandtabs().splitlines()\n        except UnicodeEncodeError:\n            msg = 'error on \"{0}\" with value \"{1}\"'.format(signature, example)\n            raise Exception(msg)\n        write(fh, '\\n')\n        write(fh, \"\\t{fake}\\n{example}\\n\".format(\n            fake=signature,\n            example='\\n'.join(['\\t# ' + line for line in lines]),\n        ))\n\n\ndef write_docs(*args, **kwargs):\n    from faker import Faker, documentor\n    from faker.config import DEFAULT_LOCALE, AVAILABLE_LOCALES\n\n    fake = Faker(locale=DEFAULT_LOCALE)\n\n    from faker.providers import BaseProvider\n    base_provider_formatters = [f for f in dir(BaseProvider)]\n\n    doc = documentor.Documentor(fake)\n\n    formatters = doc.get_formatters(with_args=True, with_defaults=True)\n\n    for provider, fakers in formatters:\n        provider_name = doc.get_provider_name(provider)\n        fname = os.path.join(DOCS_ROOT, 'providers', '%s.rst' % provider_name)\n        with open(fname, 'wb') as fh:\n            write_provider(fh, doc, provider, fakers)\n\n    with open(os.path.join(DOCS_ROOT, 'providers.rst'), 'wb') as fh:\n        write(fh, 'Providers\\n')\n        write(fh, '=========\\n')\n        write(fh, '.. toctree::\\n')\n        write(fh, '   :maxdepth: 2\\n\\n')\n        [write(fh, '   providers/%s\\n' % doc.get_provider_name(provider))\n         for provider, fakers in formatters]\n\n    AVAILABLE_LOCALES = list(AVAILABLE_LOCALES)\n    AVAILABLE_LOCALES.sort()\n    for lang in AVAILABLE_LOCALES:\n        fname = os.path.join(DOCS_ROOT, 'locales', '%s.rst' % lang)\n        with open(fname, 'wb') as fh:\n            write(fh, '\\n')\n            title = 'Language {0}\\n'.format(lang)\n            write(fh, title)\n            write(fh, '=' * len(title))\n            write(fh, '\\n')\n            fake = Faker(locale=lang)\n            d = documentor.Documentor(fake)\n\n            for p, fs in d.get_formatters(with_args=True, with_defaults=True,\n                                          locale=lang,\n                                          excludes=base_provider_formatters):\n                write_provider(fh, d, p, fs)\n\n    with open(os.path.join(DOCS_ROOT, 'locales.rst'), 'wb') as fh:\n        write(fh, 'Locales\\n')\n        write(fh, '=======\\n')\n        write(fh, '.. toctree::\\n')\n        write(fh, '   :maxdepth: 2\\n\\n')\n        [write(fh, '   locales/%s\\n' % lang) for lang in AVAILABLE_LOCALES]\n\n\n# wrappers for sphinx\ndef _main(app, *args, **kwargs):\n    return write_docs(*args, **kwargs)\n\n\ndef setup(app):\n    app.connect(str('builder-inited'), _main)\n\n\nif __name__ == \"__main__\":\n    write_docs(*sys.argv[1:])\n", "path": "faker/build_docs.py"}]}