Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using a custom theme inside a zip file

I have my sphinx documentation set up and want to use a custom theme. I have read the theme instructions on the sphinx website: http://www.sphinx-doc.org/en/stable/theming.html, but it doesn't work.

I have my theme name the same as it is in the conf.py file and it is in a zip folder in the same directory, but i keep getting the following error:

Theme error:
no theme named 'tera' found (missing theme.conf?)
make: *** [html] Error 2

My conf.py code is:

html_theme = "tera"

html_theme_options = {

}

html_theme_path = ['.']

As per the instructions, I have got a theme.conf file in the .zip file along with everything else I need. Not sure how to fix.

In my theme.conf file I have:

[theme] 
inherit = basic 
stylesheet = css/Terra.css 
pygments_style = default 

File structure is as follows: Documents > Documentation >_themes. Inside themes I have a 'tera' folder and a 'tera.zip' file.

I've also tried just putting the tera.zip file in my documentation folder directly, so its in the same directory as the conf.py file and still no luck

like image 990
Hallam Curry Avatar asked Dec 20 '25 04:12

Hallam Curry


1 Answers

I currently had the same problem. My issue was that zip creates by default a directory inside the zip file, thus theme.conf is not in its root.

Doing

$ zip -r tera.zip tera/*

gives the following:

$ less tera.zip
... Name
... ----
... tera/theme.conf

where I truncated the uninteresting output (...). If you do however

$ cd tera
$ zip -r tera.zip *

the configuration file will be at the root and sphinx works.

like image 173
DerWeh Avatar answered Dec 21 '25 17:12

DerWeh



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!