예제 #1
0
    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
예제 #2
0
    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
예제 #3
0
    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)
예제 #4
0
파일: base.py 프로젝트: jbrezmorf/flow123d
    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)