Re: Specifying Sphinx configuration overrides when invoking sphinx-build

36 views
Skip to first unread message

Guenter Milde

unread,
Sep 8, 2012, 4:00:20 PM9/8/12
to sphin...@googlegroups.com
On 2012-09-03, Simon Holywell wrote:

> I am writing a custom build script for a set of projects documented with
> Sphinx. I want to be able to override the html_theme and html_theme_path
> using -D arguments, but seem to be having an issue setting html_theme_path.

> The command I am running per project is the following (I have chopped the
> file path lengths down for a little more readability):

> sphinx-build -b html -D html_theme=treffynnon -D
> html_theme_path=/home/user/_themes /home/user/sphinx/src
> /home/user/output/docs

> The error I am getting back when I execute the command is:

> Theme error:
> no theme named u'treffynnon' found (missing theme.conf?)

Wild guess: did you try specifying html_theme_path before html_theme?

Günter

Simon Holywell

unread,
Oct 1, 2012, 8:05:58 AM10/1/12
to sphin...@googlegroups.com, mi...@users.sf.net
Hi Günter,

I sure did, but I gave up after I found out that this is actually know issue in Sphinx: https://bitbucket.org/birkenfeld/sphinx/issue/925/allow-html_theme_path-to-be-provided-to

So I just used sed in my build bash script to work around the problem:

sed -i "s|#*html_theme = '.*'|html_theme = 'simonholywell'|g" conf.py                
sed -i "s|#*html_theme_path = .*$|html_theme_path = ['$BASE_DIR/sphinx/_themes']|g" conf.py

Thanks for your suggestion though.

Cheers,
Simon
Reply all
Reply to author
Forward
0 new messages