Skip to content

Expose interface for changing html_theme in quickstart's conf.py template when auto-generating #11560

@vkottler

Description

@vkottler

Is your feature request related to a problem? Please describe.

With sphinx-apidoc, it's possible to generate a conf.py with the -F, --full option.

There are some command-line options for controlling data that is passed to the conf.py template.

It's not possible to change the theme because it's hard-coded in the template:

html_theme = 'alabaster'

This is one of the most impactful configuration options and shouldn't require user-provided templates just to change that to something else.

Describe the solution you'd like

Use alabaster as a default when rendering the template, but expose a command-line option (for e.g. sphinx-apidoc) or an interactive prompt for sphinx-quickstart to set the theme.

Describe alternatives you've considered

Expose a simpler, non-code configuration interface some other way. It seems like there's discussion about this in some other issues:

Additional context

Here is the template I use and how I'm invoking the command-line tools.

It's possible to use sphinx-apidoc and sphinx-build for a truly zero-configuration documentation-generation experience, except for being able to set the theme (in my case, sphinx_book_theme).

Activity

picnixz

picnixz commented on Aug 10, 2023

@picnixz
Member

+1 because I'm usually usiung sphinx-rtd-theme for deployment and I prefer its layout over alabaster. I think it's a reasonable feature.

added this to the some future version milestone on Aug 11, 2023
atkinsg

atkinsg commented on Jul 15, 2025

@atkinsg

This is how I have solved this.

Copy the conf.py.jinja2 template from site-packages/quickstart to ~/.templates_sphinx/quickstart.

Modify the ~/.templates_sphinx/quickstart/conf.py.jinja2 file with the required html_theme

quickstart -p ( b a s e n a m e " (pwd)")
-t=~/.templates_sphinx/quickstart
docs

Use documentation as normal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @AA-Turner@atkinsg@picnixz@vkottler

        Issue actions

          Expose interface for changing `html_theme` in `quickstart`'s `conf.py` template when auto-generating · Issue #11560 · sphinx-doc/sphinx