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.2 required=5.0 tests=DKIM_INVALID,DKIM_SIGNED, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.4 Received: (qmail 4326 invoked from network); 21 Jun 2022 12:28:09 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 21 Jun 2022 12:28:09 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id f4826857 for ; Tue, 21 Jun 2022 07:28:08 -0500 (EST) Received: from sysrq.in (sysrq.in [37.79.202.136]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id d172a1a7 for ; Tue, 21 Jun 2022 07:28:02 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sysrq.in; s=sysrq.in; t=1655814473; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zHqBzS2I9i+wVmr1mBpR2HsqBYjAVIybHzC4iNaHF0s=; b=OX+CCIZFeFL2YOPwUTIOvizjRWPcx8B8a7oW4EH5HSeswNHmzjkyHRObcQef32r6HM4p+I 1dULlNhCTGVIPm2Soz4uJA/HIx4a77G/n501Cn/ApsxWPxs4u/3T2puc8/xWlXaNv7Bvn4 mMiWMdA8Dpzr/Jt46sNCC1lzlyjwmcnXMi2qZ51kMpRrlIAbxLbZ9myGLIKUFsqt3YelUM TNMtHTy3UkZV09hBQLaiJk13IbPj/yYGvnVWThiEkyX6wyN4FOiK7c/YoAK/wSLN4PZSZw HKp7x5jmn02R2K/urcCoGuhqMmh8zPzXozVNpdg9axytUJD2TqOUryCRXaN9Tw== Received: from sysrq.in (localhost [127.0.0.1]) by sysrq.in (OpenSMTPD) with ESMTPSA id bfedb812 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Tue, 21 Jun 2022 12:27:53 +0000 (UTC) From: =?UTF-8?q?Anna=20=E2=80=9CCyberTailor=E2=80=9D?= To: tech@mandoc.bsd.lv Subject: [PATCH 5/8] man.cgi: add ARIA roles and semantics Date: Tue, 21 Jun 2022 17:27:46 +0500 Message-Id: <20220621122749.11417-6-cyber@sysrq.in> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220621122749.11417-1-cyber@sysrq.in> References: <20220621122749.11417-1-cyber@sysrq.in> X-Mailinglist: mandoc-tech Reply-To: tech@mandoc.bsd.lv MIME-Version: 1.0 Content-Transfer-Encoding: 8bit --- cgi.c | 61 ++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/cgi.c b/cgi.c index da9e408d..71f9a8ac 100644 --- a/cgi.c +++ b/cgi.c @@ -431,7 +431,8 @@ resp_searchform(const struct req *req, enum focus focus) { int i; - printf("
\n" + "\n" "
\n" " Manual Page Search Parameters\n", @@ -457,7 +458,7 @@ resp_searchform(const struct req *req, enum focus focus) /* Write section selector. */ - puts(" "); for (i = 0; i < sec_MAX; i++) { printf("
\n" - "
"); + "\n" + ""); } static int @@ -557,13 +559,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 +581,11 @@ pg_noresult(const struct req *req, int code, const char *http_msg, { 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 +594,14 @@ pg_error_badrequest(const char *msg) { resp_begin_html(400, "Bad Request", NULL); - puts("

Bad Request

\n" - "

\n"); + puts("

" + "

Bad Request

\n" + "

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

", scriptname); + "

\n" + "
", scriptname); resp_end_html(); } @@ -599,7 +609,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(); } @@ -625,7 +635,7 @@ pg_redirect(const struct req *req, const char *name) static void pg_searchres(const struct req *req, struct manpage *r, size_t sz) { - char *arch, *archend; + char *arch, *archend, *name = NULL, *label = NULL; const char *sec; size_t i, iuse; int archprio, archpriouse; @@ -704,11 +714,20 @@ pg_searchres(const struct req *req, struct manpage *r, size_t sz) req->q.equal || sz == 1 ? FOCUS_NONE : FOCUS_QUERY); if (sz > 1) { + puts(""); } if (req->q.equal || sz == 1) { @@ -743,7 +764,9 @@ resp_catman(const struct req *req, const char *file) 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 +903,9 @@ resp_format(const struct req *req, const char *file) 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; } @@ -900,10 +925,12 @@ resp_format(const struct req *req, const char *file) usepath ? req->q.manpath : "", usepath ? "/" : ""); vp = html_alloc(&conf); + puts("
"); if (meta->macroset == MACROSET_MDOC) html_mdoc(vp, meta); else html_man(vp, meta); + puts("
"); html_free(vp); mparse_free(mp); -- 2.35.1 -- To unsubscribe send an email to tech+unsubscribe@mandoc.bsd.lv