The documentation rules are almost exactly the similar as for Scripts "Documenting scripts". Although from a technical point of view it is feasible to place measures in libraries it is not common to do that. Functions are a better alternative as they accept parameter passing.