Commits

Seth House committed 85b6759

Documented _cpconfig.Config.environments using comment markers for Sphinx

Comments (0)

Files changed (2)

cherrypy/_cpconfig.py

         return tool_decorator
 
 
+# Sphinx begin config.environments
 Config.environments = environments = {
     "staging": {
         'engine.autoreload.on': False,
         'log.screen': False,
         },
     }
+# Sphinx end config.environments
 
 
 def _server_namespace_handler(k, v):

sphinx/source/tutorial/config.rst

 ============
 
 The only key that does not exist in a namespace is the *"environment"* entry.
-This special entry *imports* other config entries from a template stored in
-``cherrypy._cpconfig.environments[environment]``. It only applies to the
-global config, and only when you use
-:func:`cherrypy.config.update <cherrypy._cpconfig.Config.update>`.
+It only applies to the global config, and only when you use
+:func:`cherrypy.config.update <cherrypy._cpconfig.Config.update>`. This special
+entry *imports* other config entries from the following template stored in
+``cherrypy._cpconfig.environments[environment]``.
+
+.. literalinclude:: ../../../cherrypy/_cpconfig.py
+    :start-after: Sphinx begin config.environments
+    :end-before: Sphinx end config.environments
 
 If you find the set of existing environments (production, staging, etc) too
 limiting or just plain wrong, feel free to extend them or add new environments::