I want to change the default font in sphinx documentation. I'm using the sphinx_bootstrap_theme 'journal'
How do I do this?
Create your own "_templates
" directory and "layout.html
" file (assuming you build from a "source" directory):
$ mkdir source/_templates
$ touch source/_templates/layout.html
Configure your "conf.py":
templates_path = ['_templates']
html_static_path = ['_static']
Override file "source/_templates/layout.html
":
{# Import the theme's layout. #}
{% extends "!layout.html" %}
{# Custom CSS overrides #}
{% set bootswatch_css_custom = ['_static/my-styles.css'] %}
In _static/my-styles.css
:
body{
font-family:"Arial", Helvetica, sans-serif;
}
This link should further be useful
I found a simpler way to do the same thing.
_static/css-style.css
## conf.py
html_css_files = [
'css/css-style.css',
]
In _static/css-style.css:
body{
font-family:"Arial", Helvetica, sans-serif;
}
Reference: https://docs.readthedocs.io/en/stable/guides/adding-custom-css.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With