I'm building docs for a python project using Sphinx and readthedocs. For some reason, the code blocks aren't rendering after building the docs, and inline code (marked with backticks) appears italic. I've checked the raw build, there was a warning that the exomagpy module couldn't be found which I resolved by changing ".." to "../" in the os.path.abspath() part of conf.py, this didn't appear to change anything in the docs. There was a similar question here on stackoverflow, I tried the solution but it didn't change.
The raw build can be found here: https://readthedocs.org/api/v2/build/17574729.txt
Here is the link to the github page: https://github.com/quasoph/exomagpy/tree/Develop
The repo is structured like so:
>.vscode
>build/lib/exomagpy
>docs
>conf.py
>rst files (.rst)
>makefile
>make.bat
>exomagpy.egg-info
>exomagpy
>__init__.py
>module files (.py)
>.readthedocs.yml
>requirements.txt
>setup.py
Here are my files:
conf.py
import os
import sys
sys.path.insert(0, os.path.abspath("../"))
# project info
project = "exomagpy"
root_doc = "index"
release = "1.3.0"
# general config
extensions = ["sphinx.ext.autodoc","sphinx.ext.napoleon","sphinx.ext.autosummary"
]
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# html options
html_theme = 'sphinx_rtd_theme'
html_static_path = []
.readthedocs.yml
version: 1
build:
os: ubuntu-20.04
tools:
python: "3.8"
sphinx:
configuration: docs/conf.py
python:
version: 3.8
install:
- method: setuptools
path: .
- requirements: requirements.txt
dependencies:
- python=3.8
requirements.txt
numpy
matplotlib
pandas
tensorflow
lightkurve
requests
sphinx==5.1.1
sphinx_rtd_theme==1.0.0
setup.py
from setuptools import setup, find_packages
setup(
name = "exomagpy",
version = "1.3.0",
author = "Sophie",
author_email = "email",
url = "link",
description = "description",
packages = find_packages()
)
Any help really appreciated, please let me know if more information is needed.
source https://stackoverflow.com/questions/73170578/python-code-blocks-not-rendering-with-readthedocs-and-sphinx
Comments
Post a Comment