def generateSingleNamespace(self, nspace):
        '''
        Helper method for :func:`~exhale.graph.ExhaleRoot.generateNamespaceNodeDocuments`.
        Writes the reStructuredText file for the given namespace.

        :Parameters:
            ``nspace`` (ExhaleNode)
                The namespace node to create the reStructuredText document for.
        '''
        try:
            with codecs.open(nspace.file_name, "w", "utf-8") as gen_file:
                # Add the metadata if they requested it
                if configs.pageLevelConfigMeta:
                    gen_file.write("{0}\n\n".format(configs.pageLevelConfigMeta))

                nspace.title = "{0} {1}".format(utils.qualifyKind(nspace.kind), nspace.name)

                # generate a link label for every generated file
                gen_file.write(textwrap.dedent('''
                    .. _{link}:

                    {heading}
                    {heading_mark}

                '''.format(
                    link=nspace.link_name,
                    heading=nspace.title,
                    heading_mark=utils.heading_mark(nspace.title, configs.SECTION_HEADING_CHAR)
                )))

                brief, detailed = parse.getBriefAndDetailedRST(self, nspace)
                if brief:
                    gen_file.write("{0}\n\n".format(brief))

                # include the contents directive if requested
                contents = utils.contentsDirectiveOrNone(nspace.kind)
                if contents:
                    gen_file.write("{0}\n\n".format(contents))

                if detailed:
                    gen_file.write("{0}\n\n".format(detailed))

                # generate the headings and links for the children
                children_string = self.generateNamespaceChildrenString(nspace)
                gen_file.write(children_string)
        except:
            utils.fancyError(
                "Critical error while generating the file for [{0}]".format(nspace.file_name)
            )
Helper method for :func:`~exhale.graph.ExhaleRoot.generateNamespaceNodeDocuments`.
        Writes the reStructuredText file for the given namespace.

        :Parameters:
            ``nspace`` (ExhaleNode)
                The namespace node to create the reStructuredText document for.