Sync document with code