public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* style of code examples in changes.html
@ 2018-04-17 10:39 Martin Sebor
  2018-04-23 18:35 ` David Malcolm
  0 siblings, 1 reply; 3+ messages in thread
From: Martin Sebor @ 2018-04-17 10:39 UTC (permalink / raw)
  To: David Malcolm, Gerald Pfeifer, GCC Mailing List

Hi David & Gerald,

I noticed that the coding examples in the updates I committed
to changes.html use a different formatting style than David's.
I just copied mine from GCC 7 changes.html, and those I copied
from David's for that version :)  Should we make an effort to
make them all look the same?

FWIW, I didn't notice the difference until my changes published.
I'm guessing that's because the style sheet the page uses isn't
referenced from the original document and the reference is only
added by Gerald's script.  Is there a simple way to set things
up so we can see our changes as they will appear when published?

Thanks
Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: style of code examples in changes.html
  2018-04-17 10:39 style of code examples in changes.html Martin Sebor
@ 2018-04-23 18:35 ` David Malcolm
  2018-05-08 22:24   ` Martin Sebor
  0 siblings, 1 reply; 3+ messages in thread
From: David Malcolm @ 2018-04-23 18:35 UTC (permalink / raw)
  To: Martin Sebor, Gerald Pfeifer, GCC Mailing List

On Mon, 2018-04-16 at 20:34 -0600, Martin Sebor wrote:
> Hi David & Gerald,

(sorry for the late response; I was offline on vacation last week)

> I noticed that the coding examples in the updates I committed
> to changes.html use a different formatting style than David's.
> I just copied mine from GCC 7 changes.html, and those I copied
> from David's for that version :)  

There are at least two kinds of example in the website:
(a) source code examples, and
(b) "screenshots" of gcc output, which can themselves contain code
output as part of a diagnostic.

I got sick of hand-converting (b) to our HTML tags, so I wrote a script
to do it, which I used for my gcc-8/changes.html.

The script is in the website's CVS repository as:
  bin/gcc-color-to-html.py
and can be run like this:

LANG=C \
  gcc $@ \
    -fdiagnostics-color=always 2>&1 \
| ./bin/gcc-color-to-html.py

See
  https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00186.html

I also added a
  <pre class="blackbg">
  </pre>
around the output, though this isn't done by the above script.

I actually had a fair bit more scripting than this, based on the
scripting I did for my blogpost here:
  https://github.com/davidmalcolm/gcc-8-blogpost/blob/master/blog.html.in
where lines like:

INVOKE_GCC unclosed.c

in a foo.html.in get turned into a "screenshot" of the pertinent gcc
invocation in the foo.html.  But given that we don't want to require
running gcc itself to build the website (and indeed, specific gcc
versions), I just used this to generate the patch.

> Should we make an effort to
> make them all look the same?

Naturally, for (b), I favor the new style I used :)  (using the black
background, which may be enough to get the same look).

I'm not sure if we want to use it for (a).

> FWIW, I didn't notice the difference until my changes published.
> I'm guessing that's because the style sheet the page uses isn't
> referenced from the original document and the reference is only
> added by Gerald's script.  Is there a simple way to set things
> up so we can see our changes as they will appear when published?

I've been adding these lines to the <head> of the page:
  <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  <link rel="stylesheet" type="text/css" href="../gcc.css" />
while testing the content.

Hope this is helpful
Dave

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: style of code examples in changes.html
  2018-04-23 18:35 ` David Malcolm
@ 2018-05-08 22:24   ` Martin Sebor
  0 siblings, 0 replies; 3+ messages in thread
From: Martin Sebor @ 2018-05-08 22:24 UTC (permalink / raw)
  To: David Malcolm, Gerald Pfeifer, GCC Mailing List

On 04/23/2018 10:55 AM, David Malcolm wrote:
> On Mon, 2018-04-16 at 20:34 -0600, Martin Sebor wrote:
>> Hi David & Gerald,
>
> (sorry for the late response; I was offline on vacation last week)
>
>> I noticed that the coding examples in the updates I committed
>> to changes.html use a different formatting style than David's.
>> I just copied mine from GCC 7 changes.html, and those I copied
>> from David's for that version :)
>
> There are at least two kinds of example in the website:
> (a) source code examples, and
> (b) "screenshots" of gcc output, which can themselves contain code
> output as part of a diagnostic.
>
> I got sick of hand-converting (b) to our HTML tags, so I wrote a script
> to do it, which I used for my gcc-8/changes.html.
>
> The script is in the website's CVS repository as:
>   bin/gcc-color-to-html.py
> and can be run like this:
>
> LANG=C \
>   gcc $@ \
>     -fdiagnostics-color=always 2>&1 \
> | ./bin/gcc-color-to-html.py
>
> See
>   https://gcc.gnu.org/ml/gcc-patches/2018-04/msg00186.html
>
> I also added a
>   <pre class="blackbg">
>   </pre>
> around the output, though this isn't done by the above script.
>
> I actually had a fair bit more scripting than this, based on the
> scripting I did for my blogpost here:
>   https://github.com/davidmalcolm/gcc-8-blogpost/blob/master/blog.html.in
> where lines like:
>
> INVOKE_GCC unclosed.c
>
> in a foo.html.in get turned into a "screenshot" of the pertinent gcc
> invocation in the foo.html.  But given that we don't want to require
> running gcc itself to build the website (and indeed, specific gcc
> versions), I just used this to generate the patch.
>
>> Should we make an effort to
>> make them all look the same?
>
> Naturally, for (b), I favor the new style I used :)  (using the black
> background, which may be enough to get the same look).
>
> I'm not sure if we want to use it for (a).
>
>> FWIW, I didn't notice the difference until my changes published.
>> I'm guessing that's because the style sheet the page uses isn't
>> referenced from the original document and the reference is only
>> added by Gerald's script.  Is there a simple way to set things
>> up so we can see our changes as they will appear when published?
>
> I've been adding these lines to the <head> of the page:
>   <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
>   <link rel="stylesheet" type="text/css" href="../gcc.css" />
> while testing the content.

Thanks.  I've changed my coding examples to match yours.  I did
it quickly, by hand, and not by running your scripts.

Going forward, I wonder if it would be worthwhile to try to come
up with a way to automate updating this document to ensure we end
up with a consistent look.  The automation could also take care
of validating the document.  The last time I tried to fix
the errors and warnings I got from https://validator.w3.org
I ended up breaking things because my changes conflicted with
those inserted by the post-processing done by Gerald's scripts
on the server side.

Martin

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-05-08 22:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-17 10:39 style of code examples in changes.html Martin Sebor
2018-04-23 18:35 ` David Malcolm
2018-05-08 22:24   ` Martin Sebor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).