def init_settings(self) -> None:
    elements = self.elements = self.default_elements.copy()
    elements.update({'title': self.settings.title, 'author': self.settings.author, 'filename': self.settings.texinfo_filename, 'release': self.escape(self.config.release), 'project': self.escape(self.config.project), 'copyright': self.escape(self.config.copyright), 'date': self.escape((self.config.today or format_date((self.config.today_fmt or _('%b %d, %Y')), language=self.config.language)))})
    title: str = self.settings.title
    if (not title):
        title_node = self.document.next_node(nodes.title)
        title = (title_node.astext() if title_node else '<untitled>')
    elements['title'] = (self.escape_id(title) or '<untitled>')
    if (not elements['filename']):
        elements['filename'] = (self.document.get('source') or 'untitled')
        if (elements['filename'][(- 4):] in ('.txt', '.rst')):
            elements['filename'] = elements['filename'][:(- 4)]
        elements['filename'] += '.info'
    if self.settings.texinfo_dir_entry:
        entry = self.format_menu_entry(self.escape_menu(self.settings.texinfo_dir_entry), ('(%s)' % elements['filename']), self.escape_arg(self.settings.texinfo_dir_description))
        elements['direntry'] = ('@dircategory %s\n@direntry\n%s@end direntry\n' % (self.escape_id(self.settings.texinfo_dir_category), entry))
    elements['copying'] = (COPYING % elements)
    elements.update(self.settings.texinfo_elements)
def init_settings(self) -> None:
    elements = self.elements = self.default_elements.copy()
    elements.update({'title': self.settings.title, 'author': self.settings.author, 'filename': self.settings.texinfo_filename, 'release': self.escape(self.config.release), 'project': self.escape(self.config.project), 'copyright': self.escape(self.config.copyright), 'date': self.escape((self.config.today or format_date((self.config.today_fmt or _('%b %d, %Y')), language=self.config.language)))})
    title: str = self.settings.title
    if (not title):
        title_node = self.document.next_node(nodes.title)
        title = (title_node.astext() if title_node else '<untitled>')
    elements['title'] = (self.escape_id(title) or '<untitled>')
    if (not elements['filename']):
        elements['filename'] = (self.document.get('source') or 'untitled')
        if (elements['filename'][(- 4):] in ('.txt', '.rst')):
            elements['filename'] = elements['filename'][:(- 4)]
        elements['filename'] += '.info'
    if self.settings.texinfo_dir_entry:
        entry = self.format_menu_entry(self.escape_menu(self.settings.texinfo_dir_entry), ('(%s)' % elements['filename']), self.escape_arg(self.settings.texinfo_dir_description))
        elements['direntry'] = ('@dircategory %s\n@direntry\n%s@end direntry\n' % (self.escape_id(self.settings.texinfo_dir_category), entry))
    elements['copying'] = (COPYING % elements)
    elements.update(self.settings.texinfo_elements)