code: def generate_cfg_example(config_name, cfgpath='examples/configs', **kwargs):
      
      cfgname = config_name + '.cfg'
  
      try:
          cfgfile = _find_pkg_data_path(os.path.join(cfgpath, cfgname), **kwargs)
          with open(cfgfile) as f:
              cfgdata = f.readlines()
      except Exception as e:
          warnings.warn(str(e), AstropyUserWarning)
          return ''
  
      homepath = '~'  # Symbol for HOME for doc only, not actual code
      userfile = os.path.join(homepath, '.ginga', cfgname)
  
      docstring = io.StringIO()
      docstring.write("""It is customizable using ``{0}``, where ``{1}``
  is your HOME directory:
  
  .. code-block:: Python
  
  """.format(userfile, homepath))
  
      for line in cfgdata:
          line = line.strip()
  
          if len(line) == 0:
              docstring.write('\n')  # Prevent trailing spaces
          else:
              docstring.write('  {0}\n'.format(line))
  
      return docstring.getvalue()
docs: Generate config file documentation for a given config name.
  
      If found, it will be a Python code block of the contents.
      If not found, it will have a generic message that the config
      is not available.
  
      Parameters
      ----------
      config_name : str
          Config name that is attached to the configuration file.
          This is the same as input for ``prefs.createCategory()``.
          For example, ``'general'``, ``'channel_Image'``, or
          ``'plugin_Zoom'``.
  
      cfgpath : str
          Where it is within package data.
  
      kwargs : dict
          Optional keywords for :func:`~astropy.utils.data.get_pkg_data_contents`.
  
      Returns
      -------
      docstr : str
          Docstring to be inserted into documentation.