def run(self):
        """
        Handle Zotero in-line reference items

        @return: a list of items handled
        """
        tei_manipulator = TeiManipulate(self.gv)
        object_list = tei_manipulator.get_object_list('//tei:ref[@rend="ref"]', ' ADDIN EN.CITE', u'zoterobiblio')
        object_list += tei_manipulator.get_object_list('//tei:ref', ' ADDIN ZOTERO_ITEM CSL_CITATION', u'zoterobiblio')

        tei_manipulator.drop_addin('//tei:ref[@rend="ref"]', ' ADDIN EN.CITE', 'EndNote',
                                   'hi', 'reference_to_link', self, u'zoterobiblio', True)

        tei_manipulator.drop_addin_json('//tei:ref', ' ADDIN ZOTERO_ITEM CSL_CITATION',
                                        'hi', 'reference_to_link', self)

        tei_manipulator.drop_addin_json('//tei:ref', ' ADDIN ZOTERO_ITEM',
                                        'hi', 'reference_to_link', self)

        # handle bibliography
        self.handle_bibliography(tei_manipulator)

        if len(object_list) > 0:
            self.debug.print_debug(self, u'Stashed {0} references for bibliography parsing'.format(len(object_list)))

        return object_list
示例#2
0
    def run(self):
        """
        Handle Mendeley reference tags, replacing them with NLM-spec references

        @return: a list of processed tags
        """
        tei_manipulator = TeiManipulate(self.gv)
        object_list = tei_manipulator.get_object_list('//tei:ref[@rend="ref"]', 'ADDIN CSL_CITATION', u'zoterobiblio')

        tei_manipulator.drop_addin_json('//tei:ref', 'ADDIN CSL_CITATION',
                                        'hi', 'reference_to_link', self)

        self.handle_bibliography(tei_manipulator)

        if len(object_list) > 0:
            self.debug.print_debug(self, u'Stashed {0} references for bibliography parsing'.format(len(object_list)))

        return object_list
示例#3
0
    def run(self):
        """
        Handle all unknown types of addin, stripping them from the output

        @return: a list of tags that were removed
        """
        tei_manipulator = TeiManipulate(self.gv)
        object_list = tei_manipulator.get_object_list('//*', ' ADDIN', u'addin')

        drop = self.gv.setting('drop-unknown-addins')

        tei_manipulator.drop_addin('//*', ' ADDIN', 'EndNote',
                                   'hi', 'unknown_addin_text', self, u'addin',
                                   drop == 'True')

        if len(object_list) > 0:
            self.debug.print_debug(self, u'Handled {0} unknown addin tags'.format(len(object_list)))

        return object_list