I think you are looking for `:class:` which lets you add a custom css class.
On Mon, Apr 30, 2018 at 4:56 PM Chris Hughes < christopher.michael.hug...@gmail.com> wrote: > I'd like to start by thanking the team for sphinx, I find it a really > helpful tool. > > Is there a way to style codeblocks and literalinclude on a per-instance > basis? For example, given the following > > > .. literalinclude:: myfile > :caption: ``fileExtensionPreference`` > :name: lst:fileExtensionPreference > > is there a way to append this with something that would, for example, > change the background colour for certain instances? Perhaps something like: > > > .. literalinclude:: myfile > :caption: ``fileExtensionPreference`` > :name: lst:fileExtensionPreference > :style:mystyle > > > Similarly, for codeblocks, is there a way to style codeblocks such as the > following? > > > :: > > mycommand goes here > > > Note that I'd like to be able to do this for certain instances of > literalinclude and ::, not on a global basis. > > -- > You received this message because you are subscribed to the Google Groups > "sphinx-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to sphinx-users+unsubscr...@googlegroups.com. > To post to this group, send email to sphinx-users@googlegroups.com. > Visit this group at https://groups.google.com/group/sphinx-users. > For more options, visit https://groups.google.com/d/optout. > -- Aaron Carlisle -- You received this message because you are subscribed to the Google Groups "sphinx-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to sphinx-users+unsubscr...@googlegroups.com. To post to this group, send email to sphinx-users@googlegroups.com. Visit this group at https://groups.google.com/group/sphinx-users. For more options, visit https://groups.google.com/d/optout.