Mark
Mark

Reputation: 5038

Use Sphinx to generate standalone HTML files

I'm quite new to Sphinx and I'm trying to create the docs for my application. It would be nice to generate a "standalone" HTML file for each topic.

I mean: Sphinx creates a useful navigation panel on the left, with some modules (toc, next topic, search, etc..). But this is placed in every HTML!

I would like to add a contextual help inside my application: whenever the user set the focus on a (relevant) widget, the related HTML is shown in a box. Of course I don't want to show the navigation panel here!

Is is possible to configure Sphinx to generate HTML files that contains ONLY the topic's content, then use a main html (index.html) to display them in a frame?

Upvotes: 1

Views: 1345

Answers (2)

Wes
Wes

Reputation: 1840

This is what worked for me: https://stackoverflow.com/a/53212488/2636544, i.e. add following to conf.py:

html_theme_options = {
    # Disable showing the sidebar. Defaults to 'false'
    'nosidebar': True,
}

Works for alabaster theme.

Upvotes: 2

mzjn
mzjn

Reputation: 50947

The default HTML output (when using the html builder) includes a sidebar (navigation pane) for most themes, usually on the left hand side.

There are other output formats, such as HTML Help and Qt Help, with builders that produce HTML files without the sidebar. Use one of those.

The documentation for these builders says "this builder produces the same output as the standalone HTML builder...", but that is misleading IMHO. The output is not the same.

Upvotes: 2

Related Questions