I'm using the alabaster theme in sphinx but still can't get the standard font look like Falcon and Celery.
Looking at falcon's conf.py I couldn't find any font related html_theme_options so I wonder how those two libraries keep a unified font style which is not the default.
I also tried using falcon's custom.css - But that didn't work either.
What should I set in conf.py in order to get this exact font look?
Falcon used a non-standard method of overriding the default theme's style sheet. I don't recommend this method.
You can either override the theme's default CSS or the theme's template files. Details of how to do so are answered in this SO post.
Related
I'm already using a custom css to override some of the styles of the theme using
def setup(app):
app.add_css_file('custom.css')
This works fine. What other app. functions are available?
I can't find any documentation.
I'm looking for the function to override the favicon.
Thanks to #StevePiercy I found this documentation: https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_favicon
conf.py
html_favicon = 'favicon.ico'
I put favicon.ico in my source folder, next to my .rst-files and it is working as expected:
https://global-coffee-data-standard.readthedocs.io/en/latest/index.html
In addition to Sphinx's native favicon support (https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_favicon), you can also use this Sphinx extension I created: https://pypi.org/project/sphinx-favicon/ With this extension, you can add multiple favicons, including apple-touch-icon and icons of different sizes. You can also use PNG or other supported file types.
I've created documentation using Sphinx and the read the docs theme, but the arrows are missing from the buttons
Can anyone help?
Make sure the css files of sphinx theme are located in the right place
Your Sphinx document probably uses CSS that specifies a font, in which these unicode "codepoint boxes" are arrows.
Either the CSS is external, but not shipped alongside with the HTML, or so is the font.
How do I override the default Search html that comes with the Sphinx RTD theme. I am on Sphinx 1.5 and the theme is always imported and not static.
See Templating in the Sphinx documentation.
To customize the output of your documentation you can override all the templates (both the layout templates and the child templates) by adding files with the same name as the original filename into the template directory of the structure the Sphinx quickstart generated for you.
Sphinx will look for templates in the folders of templates_path first, and if it can’t find the template it’s looking for there, it falls back to the selected theme’s templates.
In your case, copy the RTD Sphinx theme's search.html from your installed package into your template directory, and modify it to your liking. Then set the value of templates_path in your conf.py to its location.
Is there a way to set the html logo to the centre of the sidebar?
I have looked around, but cannot find this option, does it exist?
To change the style of the HTML of your Sphinx project, you need to adjust the CSS of your theme.
You can do this by setting the html_style variable in your project's conf.py file to reference a custom style sheet, as described here in the Sphinx documentation.
The exact CSS rules you need to apply depend on the HTML theme you are using.
I just started using Docfx and set up some basic conceptual documentation. Now I want to make some adjustments to the theme (company logo, perhaps some font changes, etc.) Minor stuff.
The official documentation only gives a high-level description of how to create a new template. I've never used a templating language before, so I'd like to avoid that for now if possible.
My question is: how can I make small adjustments to the default theme, like some CSS changes and perhaps adding external resources (like font awesome)?
Do I have to create an entire template (or a part of it) or can I include a CSS file somehow? The documentation mentions a theme option but so far I've found no examples or existing themes to learn from.
A mere link to a project that uses a custom theme or template would already be very helpful. The docfx repo has a docfx.website.themes folder and the default template is also in there I believe, but I couldn't really figure out which files I would have to provide to roll my own.
Export template:
Run docfx template export default, then you'll see default template in _exported_templates\default
Change themes in default template, e.g:
Adding external resource: modify styles\head.tmpl.partial
CSS change: modify styles\docfx.css or styles\main.css
Use customized template:
Run docfx -t _exported_templates\default, which will use your customized template!
NOTE: It is possible that DocFX updates its embedded templates when releasing new version. So please make sure to re-export the template if you overwrite or dependent on that template in your custom template.