I am using Sphinx to build a documentation project. I have created this script to watch the directory and trigger a Sphinx build when changes occur:
import os
import sys
from livereload import Server, shell
wd = os.path.dirname(sys.argv[0])
server = Server()
server.watch(wd, shell('make.bat clean && make.bat html', cwd=wd), delay=1)
server.serve(root='../_build/html', port=8000, host='localhost')
This works great, but all web fonts in the theme (ReadTheDocs) are being transferred with Content-Type: text/html
and the Chrome developer console shows:
Failed to decode downloaded font: http://localhost:8000/_static/fonts/Lato-Regular.ttf
Failed to decode downloaded font: http://localhost:8000/_static/fonts/fontawesome-webfont.woff?v=4.2.0
Failed to decode downloaded font: http://localhost:8000/_static/fonts/Lato-Bold.ttf
Failed to decode downloaded font: http://localhost:8000/_static/fonts/RobotoSlab-Bold.ttf
Failed to decode downloaded font: http://localhost:8000/_static/fonts/RobotoSlab-Regular.ttf
Failed to decode downloaded font: http://localhost:8000/_static/fonts/fontawesome-webfont.ttf?v=4.2.0
However, a local IIS website pointing to the same directory works just fine. I'm assuming it's an issue with TornadoServer - probably defaulting unknown MIME types to text/html
. Does anyone have a solution for this?
I used the ASP.NET Docs as a starting point: https://github.com/aspnet/Docs/. This has the same issue when following their contribution guidelines (using sphinx-autobuild
).