Tweaked build process to be compatible with readthedocs.org

[ci skip]