python sphinx - How can I include images in my master toc? -




i'm creating documentation website using sphinx , make master toc fancy use of images. i'd display icon next to, or above, each entry in main table of contents. how can this?

i have managed customize appearance of toc because noticed in chrome's inspector main content on index page has div wrapper id seems come name of project, allows me write css that's specific section. example, have this:

#welcome-to-the-redacted-documentation-site.section ul li { display: block; padding: 16px; } 

what i'd each of li elements in toc display unique image.

i have tried using substitution in document headers, mentioned in this answer. image appears fine in document itself, gets stripped out of toc.

i have considered ways of doing css, every entry in toc uses same style, can't target individual toc entries in unordered list. maybe there way assign id toc entries?

i use nth child pseudoselector, feels hacky since relies on toc entries being in order. seems css shouldn't dependent on content. if ever decided change order of toc, images wrong until fix css. tried doing anyway, , didn't work (no images in toc):

#welcome-to-the-redacted-documentation-site.section ul li:nth-child(1) {     background: url(images/image1.jpg) no-repeat top center; } #welcome-to-the-redacted-documentation-site.section ul li:nth-child(2) {     background: url(images/image2.jpg) no-repeat top center; } 

another possibility i've thought of create custom page or template customized html create toc, little beyond me right now, , hoping don't have drastic. if that's best route, pointers have on how accomplish appreciated.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -