From: Claudio Jeker Subject: Re: bgplg: modernize html To: Clemens Gößnitzer Cc: "Anthony J. Bentley" , tech@openbsd.org Date: Mon, 5 Feb 2024 10:03:44 +0100 On Mon, Feb 05, 2024 at 09:57:26AM +0100, Clemens Gößnitzer wrote: > On Sun, 2024-02-04 at 15:24 -0700, Anthony J. Bentley wrote: > > Clemens Gößnitzer writes: > > > The attached diff modernizes the html output from bgplg(8): > > > > > > * Switch to html 5 > > > * Unify usage of " vs ' in html tags > > > * Drop trailing / for single tags, type=text/css and > > > for > > > css - not needed in html 5 > > > * Move style definitions from bgplg.head to bgplg.css > > > > I see no point in unifying " vs ', they are entirely equivalent > > in this case, and unlike ', " needs escaping in C strings. > > > > > * Make screen scaling more friendly for mobile devices > > > > Can't comment on this one. But I suggest leaving it out for now, > > as unlike the other changes it makes the page render differently. > > > > Everything else looks good to me. > > Thank you for your feedback. Attached, you find a diff that just > converts everything to valid html 5. I also left out moving the style > definition from the elements to the css file, since that can be done by > the admin if he wishes to do so. I would not include the lang attribute on the html node. While some text on those pages are indeed in english it is not required and the output of bgpctl may include non-english text. This is unlike an article where there is a lot of text. Apart from that this is OK claudio@ > Index: bgplg.c > =================================================================== > RCS file: /cvs/src/usr.bin/bgplg/bgplg.c,v > retrieving revision 1.19 > diff -u -p -u -r1.19 bgplg.c > --- bgplg.c 5 Mar 2018 10:53:37 -0000 1.19 > +++ bgplg.c 5 Feb 2024 08:51:46 -0000 > @@ -260,17 +260,15 @@ main(void) > > printf("Content-Type: %s\n" > "Cache-Control: no-cache\n\n" > - "\n" > - " - "\"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">\n" > - "\n" > + "\n" > + "\n" > "\n" > "%s\n", > CONTENT_TYPE, myname); > if (stat(INC_STYLE, &st) == 0) { > - printf("\n"); > + printf("\n"); > } > if (stat(INC_HEAD, &st) != 0 || lg_incl(INC_HEAD) != 0) { > printf("\n" > @@ -308,8 +306,8 @@ main(void) > } > > printf("\n" > - "\n" > - "\n" > + "\n" > + "\n" > "\n" > "\n" > "
\n", req ? req : "");
> Index: bgplg.foot
> ===================================================================
> RCS file: /cvs/src/usr.bin/bgplg/bgplg.foot,v
> retrieving revision 1.1
> diff -u -p -u -r1.1 bgplg.foot
> --- bgplg.foot	11 Dec 2006 23:10:10 -0000	1.1
> +++ bgplg.foot	5 Feb 2024 08:51:46 -0000
> @@ -1,2 +1,2 @@
>  
> -
> +
> Index: bgplg.head > =================================================================== > RCS file: /cvs/src/usr.bin/bgplg/bgplg.head,v > retrieving revision 1.3 > diff -u -p -u -r1.3 bgplg.head > --- bgplg.head 30 Mar 2012 14:31:18 -0000 1.3 > +++ bgplg.head 5 Feb 2024 08:51:46 -0000 > @@ -2,5 +2,5 @@ > >
> > -OpenBGPD > +OpenBGPD > > -- :wq Claudio