Goal. Display a literalinclude block within a README.rst in GitHub.
Problem. I'm working on generating documentation for a Python project using Sphinx. The README.rst file has a literalinclude block (documentation here). The literalinclude block is displayed correctly in Sphinx documentation but not in the home page of the repo in GitHub.
Tested workarounds. The explanation could be that the literalinclude directive is understood by Sphinx, but not by Docutils (and therefore GitHub?) as discussed here, which includes a reproducible example. One workaround that I've explored is to use a .. only: block (link). However, once again, it works on Sphinx documentation but not on Github, so it's likely affected by the same curse of literalinclude.