I am trying to accomplish something with reStructured Text that might not be possible, but that is why I am asking here.

I have an application (a Django application that is), that we use internally to take the minutes of our meetings. In those meetings, we agree on quite some todo's. At the moment those todo's will have to be entered into our todo application by hand, while they are in the minutes as well. 

What I would like to do, is write an interpreted text role and a directive, that would enter these todo's into the database. This should not be too hard. However, reparsing the source would cause the todo to be entered again. Therefore, I would like to replace the rst source with the id of the todo. That way the link to the todo is still there, but it won't be parsed again.

So my question is: Is it possible to extend docutils so that it modifies the rst source after some processing? i.e. replace :todo:`fix the app > tino < tomorrow` with :todo_id:`6`?