Add common core Sphinx configurations to the state.

def _insert_common_sphinx_configs(c, *, project_name):
    """Add common core Sphinx configurations to the state.
    """
    c['project'] = project_name

    # The suffix(es) of source filenames.
    # You can specify multiple suffix as a list of string:
    c['source_suffix'] = '.rst'

    # The encoding of source files.
    c['source_encoding'] = 'utf-8-sig'

    # The master toctree document.
    c['master_doc'] = 'index'

    # Configure figure numbering
    c['numfig'] = True
    c['numfig_format'] = {'figure': 'Figure %s',
                          'table': 'Table %s',
                          'code-block': 'Listing %s'}

    # The reST default role (used for this markup: `text`)
    c['default_role'] = 'obj'

    # This is added to the end of RST files - a good place to put substitutions
    # to be used globally.
    c['rst_epilog'] = """
.. _Astropy: http://astropy.org
    """

    # A list of warning types to suppress arbitrary warning messages. We mean
    # to override directives in
    # astropy_helpers.sphinx.ext.autodoc_enhancements, thus need to ignore
    # those warning. This can be removed once the patch gets released in
    # upstream Sphinx (https://github.com/sphinx-doc/sphinx/pull/1843).
    # Suppress the warnings requires Sphinx v1.4.2
    c['suppress_warnings'] = ['app.add_directive', ]

    return c