DiBa
DiBa

Reputation: 31

Sphinx without sidebars, header, footer,

We want to create a sphinx documentation for our MATLAB code. Usually the themes (alabaster, readthedocs, ...) provide a sidebar, a header, a footer, a search engine and so on.

If we integrate the sphinx documentation in MATLAB this does not look so well, because the MATLAB documentation already has theses things, so the sphinx pendants are redundand.

Is there a way to create HTML pages with sphinx without all this additional stuff?

I already looked for the topics 'sidebars' here https://www.sphinx-doc.org/en/master/theming.html for instance and here on stack overflow. But nearly all questions concerned how to add MORE bars, not to remove them.

Upvotes: 1

Views: 1264

Answers (1)

DiBa
DiBa

Reputation: 31

I guessed i solved the problem at least for our needs.

To remove the breadcrumbs, the sidebar and the footer in the rdt theme one must really customize the css file, where theses things are defined. Unfolded, the css file is about 6000 lines of code, which we don't want to touch.

Instead i deformed the qthelp profile a little bit. The qthelp allows to specify an alternative theme with all the options needed for it:

qthelp_theme = 'classic'
qthelp_theme_options = {
    # Basic
    'nosidebar': True,
    'body_max_width': 'None',
    'rightsidebar': False,
    'stickysidebar': False, 
    'collapsiblesidebar': False,
    'externalrefs': False,
    # Styling
    'footerbgcolor': '#FFFFFF', 
    'footertextcolor': '#1A1A1A',
    ...
}

This results also in a 'naked' html page without the sidebar at least, which we can customize to look more like the rtd theme.

When building the documentation we can do it twice. The first run runs with

$ make html

and the second one with

$ make qthelp

The first is for the web representation of our documentation and the second one for the MATLAB help.

I guess we can live with this solution.

Upvotes: 2

Related Questions