Re: background color experimentation...

Guenter Milde <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
On 2017-02-13, Paul Flint wrote:
> On Mon, 13 Feb 2017, David Goodger wrote:
...
>>> On Sun, 12 Feb 2017, David Goodger wrote:
>>>> On Fri, Feb 10, 2017 at 6:53 AM, Paul Flint <[email protected]> wrote:


>>>>> 1. Easy one - make the background color of your choice:

>>>>> .. raw:: html

>>>>>    <body style="background-color:#E6E6FA;">

>>>> You don't need to use the "raw" directive for this. This can be done
>>>> easily via a stylesheet:
>>>> http://docutils.sourceforge.net/docs/howto/html-stylesheets.html

...

>>> That said, my use case is that I have about 100 DVDs (Source Linux Format)
>>> that I am putting up on the web. Each DVD has a page that shows the original
>>> front and back cover.  What I wanted was that each of these pages display in
>>> a color of the season.  My idea was to put together these DVD "base pages"
>>> using a bash script (I am a registered bashist.  See http://visualbash.org
>>> :^) and cycling through some seasonally appropriate pastel colors to help
>>> the user differentiate between the various DVDs.

>>> The ".. raw" directive was wildly successful in allowing this page-by-page
>>> transition.  Could I advantage myself with the css approach?

>> You'd have to change the CSS for each page.

> Actually what I got to thinking about was a way to add a 
> reStructuredText element which would query the css for the appropriate 
> background shade...

> For example:

>    SEASON   BACKGROUND
>    spring = a warming color
>    summer = a warm color
>    fall   = a cooling color
>    winter = a cool colr

Use classes: 

The custom CSS sheet defines rules like::

  .figure.spring { background-color:#E6E6FA; }

(adapt the selector to the element you want to give the background).
and in bash script don't insert raw HTML but class values.

Günter


------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.