Closed brybalicious closed 3 years ago
Ah.. I realised that some of that is already handled in the __init.py__
setup function. Hence why only this is required:
if not on_rtd: # only import and set the theme if we're building docs locally
import sphinx_material
# Required theme setup
html_theme = 'sphinx_material'
Then the question still stands... how to get this to build on readthedocs.io?
You need to add it to your requirements files that is used by RTF's builder. You can then trigger a build using the admin console. I don't there there is anything special about building on RTD.
See this conf.py
The produces these docs on RTD:
Is there any possibility to build this theme and host it on readthedocs without readthedocs defaulting to its own theme?
Some other custom themes provide a snippet in conf.py which apparently achieves this, e.g. this theme. Readthedocs also provides the same snippet in its documentation
When I tried to implement this,
html_theme_path = [sphinx_material.get_html_theme_path('sphinx_material')]
fails with AttributeError: module 'sphinx_material' has no attribute 'get_html_theme_path', so I directly referenced the theme directory.It's also unclear how the directory should be structured if just incorporating code into another project (i.e. where init.py and the rest of the sphinx_theme directory structure ought to sit relative to
conf.py
. In my case, I added an_themes
directory one level up from the docs. Inside that, are located the__init__.py
and_version.py
scripts, and a directorysphinx_materials
which housestheme.conf
, the static directory and the html pages. I deleted everything else. Is this correctly implemented? Thanks