Commits

Hong Minhee committed f7ed716

httpdomain: Added :include-empty-docstring: flag option. (v1.1.2)

Comments (0)

Files changed (4)

httpdomain/doc/conf.py

 # The short X.Y version.
 version = '1.1'
 # The full version, including alpha/beta/rc tags.
-release = '1.1.1'
+release = '1.1.2'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.

httpdomain/doc/index.rst

       Excludes a view function that serves static files, which is included
       in Flask by default.
 
+   ``include-empty-docstring``
+      View functions that don't have docstring (:attr:`__doc__`) are excluded
+      by default. If this flag option has given, they become included also.
+
 .. _Flask: http://flask.pocoo.org/
 
 

httpdomain/setup.py

 
 setup(
     name='sphinxcontrib-httpdomain',
-    version='1.1.1',
+    version='1.1.2',
     url='http://bitbucket.org/birkenfeld/sphinx-contrib',
     download_url='http://pypi.python.org/pypi/sphinxcontrib-httpdomain',
     license='BSD',

httpdomain/sphinxcontrib/autohttp/flask.py

 
     has_content = True
     required_arguments = 1
-    option_spec = {'undoc-endpoints': str, 'undoc-static': str}
+    option_spec = {'undoc-endpoints': str,
+                   'undoc-static': str,
+                   'include-empty-docstring': str}
 
     @property
     def undoc_endpoints(self):
                 path == app.static_path + '/(path:filename)'):
                 continue
             view = app.view_functions[endpoint]
-            docstring = prepare_docstring(view.__doc__)
-            if not docstring:
+            docstring = view.__doc__ or ''
+            if not docstring and 'include-empty-docstring' not in self.options:
                 continue
+            docstring = prepare_docstring(docstring)
             for line in http_directive(method, path, docstring):
                 yield line