You will look into the documentation of dlvhex most likely to implement a plugin. In this case, please continue with the Plugin Interface Module, which contains all necessary information.