From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-0.0 required=5.0 tests=T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 21422 invoked from network); 4 Jul 2022 16:37:52 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 4 Jul 2022 16:37:52 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id bae6a2a6 for ; Mon, 4 Jul 2022 11:37:51 -0500 (EST) Received: from scc-mailout-kit-02.scc.kit.edu (scc-mailout-kit-02.scc.kit.edu [129.13.231.82]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 56a44518 for ; Mon, 4 Jul 2022 11:37:50 -0500 (EST) Received: from hekate.asta.kit.edu ([2a00:1398:5:f401::77]) by scc-mailout-kit-02.scc.kit.edu with esmtps (TLS1.3:ECDHE_SECP256R1__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (envelope-from ) id 1o8P53-00BLM9-FC; Mon, 04 Jul 2022 18:37:49 +0200 Received: from login-1.asta.kit.edu ([2a00:1398:5:f400::72]) by hekate.asta.kit.edu with esmtp (Exim 4.94.2) (envelope-from ) id 1o8P52-006ITg-7s; Mon, 04 Jul 2022 18:37:48 +0200 Received: from schwarze by login-1.asta.kit.edu with local (Exim 4.92) (envelope-from ) id 1o8P52-0007tN-Jz; Mon, 04 Jul 2022 18:37:48 +0200 Date: Mon, 4 Jul 2022 18:37:48 +0200 From: Ingo Schwarze To: Anna Cc: tech@mandoc.bsd.lv Subject: Re: [PATCH 5/8] man.cgi: add ARIA roles and semantics Message-ID: References: <20220621122749.11417-1-cyber@sysrq.in> <20220621122749.11417-6-cyber@sysrq.in> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220621122749.11417-6-cyber@sysrq.in> Hello Anna, Anna wrote on Tue, Jun 21, 2022 at 05:27:46PM +0500: > cgi.c | 61 ++++++++++++++++++++++++++++++++++++++++++----------------- > 1 file changed, 44 insertions(+), 17 deletions(-) While i did a lot of nitpicking on your other patches, i decided to commit this one almost unchanged with only tiny tweaks, see the commit appended below. Even in the existing code before your patch, there are likely some ways how the structure of both the C and the HTML code can be improved, and this patch clearly moves into the right direction, so just moving ahead seemed better than excessive scrutiny in this case. We can polish it further in the tree when we see the need. There is one exception. I did not yet merge the part you marked with FIXME: > puts(""); > for (i = 0; i < sz; i++) { > + // FIXME: there has to be a way to do this without > + // truncating > + name = mandoc_strdup(r[i].names); > + name[strlen(name)-3] = '\0'; > + mandoc_asprintf(&label, "%s, section %d", > + name, r[i].sec); > + > printf(" \n" > "
" > - " + " + label); > if (*scriptname != '\0') > printf("%s/", scriptname); While i agree with your intention, i think it's better to consider in detail how to best do this before committing. Yours, Ingo Log Message: ----------- Improve accessibility of man.cgi(8) in various respects, in particular adding
,
, and
"); } static int @@ -557,13 +560,17 @@ pg_index(const struct req *req) resp_begin_html(200, NULL, NULL); resp_searchform(req, FOCUS_QUERY); - printf("

\n" + printf("

\n" + "

\n" "This web interface is documented in the\n" - "man.cgi(8)\n" + "man.cgi(8)\n" "manual, and the\n" - "apropos(1)\n" + "apropos(1)\n" "manual explains the query syntax.\n" - "

\n", + "

\n" + "
\n", scriptname, *scriptname == '\0' ? "" : "/", scriptname, *scriptname == '\0' ? "" : "/"); resp_end_html(); @@ -575,9 +582,11 @@ pg_noresult(const struct req *req, int c { resp_begin_html(code, http_msg, NULL); resp_searchform(req, FOCUS_QUERY); - puts("

"); + puts("

"); + puts("

"); puts(user_msg); puts("

"); + puts("
"); resp_end_html(); } @@ -586,12 +595,14 @@ pg_error_badrequest(const char *msg) { resp_begin_html(400, "Bad Request", NULL); - puts("

Bad Request

\n" - "

\n"); + puts("

\n" + "

Bad Request

\n" + "

"); puts(msg); printf("Try again from the\n" "main page.\n" - "

", scriptname); + "

\n" + "
", scriptname); resp_end_html(); } @@ -599,7 +610,7 @@ static void pg_error_internal(void) { resp_begin_html(500, "Internal Server Error", NULL); - puts("

Internal Server Error

"); + puts("

Internal Server Error

"); resp_end_html(); } @@ -704,6 +715,7 @@ pg_searchres(const struct req *req, stru req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { + puts(""); } if (req->q.equal || sz == 1) { @@ -743,7 +756,9 @@ resp_catman(const struct req *req, const int italic, bold; if ((f = fopen(file, "r")) == NULL) { - puts("

You specified an invalid manual file.

"); + puts("

\n" + " You specified an invalid manual file.\n" + "

"); return; } @@ -880,7 +895,9 @@ resp_format(const struct req *req, const int usepath; if (-1 == (fd = open(file, O_RDONLY))) { - puts("

You specified an invalid manual file.

"); + puts("

\n" + " You specified an invalid manual file.\n" + "

"); return; } -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv