예제 #1
0
    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