def onDefinitionsAnchorClicked(self, url): command, index = unicode(url.toString()).split(":") definition = self.state.definitions[int(index)] if command == "addFactExpression": markup = reader_util.buildFactMarkupExpression( definition.expression, definition.reading, definition.glossary, definition.sentence ) self.ankiAddFact(markup) if command == "addFactReading": markup = reader_util.buildFactMarkupReading(definition.reading, definition.glossary, definition.sentence) self.ankiAddFact(markup) elif command == "copyDefinition": reader_util.copyDefinitions([definition])
def onActionCopyAllDefinitions(self): reader_util.copyDefinitions(self.state.definitions)