Fixes to doc function

Adding more metadata, now works with all kinds of inputs