Creation of mini-galleries with backreferences_dir and doc_module generates an empty rst file if you use a function in an example like this:
import package.module
package.module.my_fun()
It works if you directly import the function in the example:
from package.module import my_fun
my_fun()
or if you import the function in the __init__.py file of the package (i.e.:
from .module import (
my_fun,
)
Note that this is only for functions. Classes work fine in all cases.
Refer to sphinx-gallery/sample-project#1 (comment) for suggestion on how to fix.