Re: background color experimentation...

David Goodger <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <CABiJP=Jsmuvik4J8UiSApEJtn5z3hrkwVN1DokfJxTTmeojJhQ@mail.gmail.com>
On Mon, Feb 13, 2017 at 8:12 AM, Paul Flint <[email protected]> wrote:
> Greetings David Goodger,
>
> First, thanks for the response.  Up here in the North Country one of our
> hobbies is staying under-the-radar, and thus we live in cold, dark,
> ignorance most of the time...
>
> In your kind response, you make some interesting points.  I will respond
> below.
>
> 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
>>
>
> Very cool.  For openers, I did not know about rst2html.py - Thanks.  BTW
> nice style in the python code!  I could learn a thing or two from you.
>
> 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.

I'm not sure how your raw hack works, since you should end up with
multiple <body> elements in your output HTML, unless you also changed
the template. This might render in browsers but it's not valid HTML.

> This experience has led me to the very disturbing conclusion that you could
> (and maybe should) write all web pages in reStructuredText.  Should I seek
> professional help?

No, I don't think so. :-) That's what I do as well, and what many of us do.

>>> 2. Less easy one - Postprocessing the html to get the image to open in a
>>> new
>>> tab:
>>
>>
>> This has been on the to-do list for a long time, but (a) it's not a
>> high-frequency request (yours is the first I can recall), and (b) no
>> obviously correct solution has been proposed. The to-do list has a
>> proposal to emulate the MoinMoin wiki's use of "^" as a prefix for
>> this purpose.
>>
>
> Interesting bit of extended notation.  I need to think if this would work...
>
>> If you want this for every image in all of some subset of your
>> documents, you could create a custom Writer deriving from the HTML
>> Writer you already use (or its Sphinx equivalent).
>>
>
> My fix for this was to go directly to the resultant html and patch it there:
>
> <start code>
> sphinx-build -b html ./ test ;
> sed -i 's/><img/ target="_blank" ><img/g' test/index.html
> <end code>

That's very risky. It's adding “ target="_blank"” to any tag
immediately before an <img> tag. Are you sure that they are all <a>
tags, and always will be?

> (Note what we bashists lack in finesse we make up with gusto... :^)

Reminds me of:

    Some people, when confronted with a problem, think "I know, I'll
use regular expressions." Now they have two problems.

    — Jamie Zawinski

The same could be said about sed & awk.

> Obviously the "MoinMoin" notation would go a step towards a standard wiki
> markup language, and why not extend ourselves into this maelstrom?

I'm not following you, and I'm a native English speaker. Many on this
list are not. Repeat in plainer language please?

>>> Note sphinx is a lot of fun...
>>
>>
>> Maybe tell the Sphinx folks that? This is Docutils/reStructuredText,
>> which Sphinx does use, but they aren't the same thing :-)
>>
>
> Gotcha.  The most fun was getting the reStructuredText editor "enki" to run
> under Ubuntu 16.04.  I need to figure out how to communicate my zaniness to
> the Sphinx community...
>
>> David Goodger
>> <http://python.net/~goodger>
>>
>
> Finally thanks for the Venn diagram, and I expect we should get together in
> Portland to rub antennae...  Are you up in Montreal?  I love that city!

I used to live near Montreal, now I live in a suburb of the Twin
Cities of Minnesota. It's only slightly warmer here.

David Goodger
<http://python.net/~goodger>

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