Quote:
Originally Posted by kiwidude
I don't think there is a way in the current API of removing just one specific named marker once you have applied it - I am sure chaley can correct me on that if I am wrong. That would have been the quick change to the plugin I might have been willing to make.
|
There isn't a specific API but it is easy to do yourself. Here is an example that runs in the Template debugger so it is easy to see what it does. The work is in the function remove_val_from_marks().
Code:
python:
def evaluate(book, context):
db = context.db
new_marks = remove_val_from_marks(db, 'bbb')
db.data.set_marked_ids(new_marks)
return 'a string'
def remove_val_from_marks(db, val):
return {k:v for k,v in db.data.marked_ids.items() if v != val}