def href_id(self): if self.parent: parent_id = str(self.parent.href_id) if FormatMode.format_mode == FormatMode.LATEX_MODE: if parent_id.startswith('IT::'): return '{}::{}'.format(parent_id[4:], TexList.name_mode(self.name)) return '{}::{}'.format(parent_id, TexList.name_mode(self.name)) return '{self.parent.href_id}-{self.name}'.format(self=self) return self.name
def href_id(self): if self.parent: parent_id = str(self.parent.href_id) if FormatMode.format_mode == FormatMode.LATEX_MODE: if parent_id.startswith('IT::'): return '{}::{}'.format(parent_id[4:], TexList.name_mode(self.name)) return '{}::{}'.format(parent_id, TexList.name_mode(self.name)) return '{self.parent.href_id}:{self.name}'.format(self=self) return self.name
def href_id(self): """ Method will return unique id of this item if link_name was specified in attributes, it will be used :return: """ if getattr(self, 'attributes', None) and self.attributes.link_name: value = self.attributes.link_name else: value = self.get('unique_name', 'name', 'id') if FormatMode.format_mode == FormatMode.LATEX_MODE: return 'IT::{}'.format(TexList.name_mode(value)) return htmltree.secure(value)
def href_id(self): """ Method will return unique id of this item if link_name was specified in attributes, it will be used :return: """ if getattr(self, 'attributes', None) and self.attributes.link_name: value = self.attributes.link_name else: value = self.get('unique_name', 'name', 'id') if FormatMode.format_mode == FormatMode.LATEX_MODE: return 'IT::{}'.format(TexList.name_mode(value)) return htmltree.secure(value)