Thanks for this, that helps.

If I use, for example,
.. literalinclude:: myfile
     :class: myclass
     :caption: ``fileExtensionPreference``
     :name: lst:fileExtensionPreference

then the style *myclass* overwrites the settings setup in my conf.py. Is
there a way to have the settings of *myclass* appended to other settings?

On Mon, Apr 30, 2018 at 10:01 PM, Aaron Carlisle <carlisle.aaro...@gmail.com
> wrote:

> 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.hughes@
> 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.
>

-- 
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.

Reply via email to