How to use lua-filter with gitbook output?

AFAIK, no reason not to do that if it's getting the results you want! If this works, please mark the solution for the benefit of those to follow.