I'd like to include a code example in my sphinx documentation. I don't, however, want to refer to the file by its path, but would rather specify it by its module name.
That is, instead of doing it the way indicated here Showing code examples
.. literalinclude example.py
or
.. literalinclude ../../example.py
I'd rather do (for example)
.. includemodule mymodule.example
Is this possible to do without writing a custom extension? Or, what is the simplest way to write such an extension?