From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411558; cv=none; d=zohomail.com; s=zohoarc; b=B/GEM56G7cV8YGkyfgB0yYnetbzBPjDKgI56doavloF1P0hv3DA1OuVUPNbLbv4B9wG+ix2aVrP7WIyuC3Uz8/kdWIOtqiOWoKxOCa4JGoLJiLIgpefAm+dQ2+Xp4R9V1ijGox2HLZRQAHcIoINOt3urQ/NbUIMxBEFUrbbg9fU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411558; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=1Sr/wTLrisjBtInY4Qg4UmUDcRoGWkzytLN3VD3D3Vk=; b=MNcmOjTwku3Hx+W0BkGiNkD3+jA/gFMLpvv6MhXq+qRmQgVZA8M57cmt/G/ZJW71k+tZ+uzWWVKwPGRyhjPbjED2ircDdm45XJ7gX3BWVSH9yz5m48czVpfb/6TiS/F4ZBRUe1rKy0MEl7Tnt+OuoUcZ8YJf/yd+6pIKyUy7u/I= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1676411558304249.32318096610868; Tue, 14 Feb 2023 13:52:38 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-224-XB1CLehKONOzJvZfDM2ZMA-1; Tue, 14 Feb 2023 16:51:32 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id BF94B196EFB9; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A6D412026D76; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 7587E1946A52; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 39774194658C for ; Tue, 14 Feb 2023 21:51:20 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F2E591121319; Tue, 14 Feb 2023 21:51:19 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 6956F1121314 for ; Tue, 14 Feb 2023 21:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411557; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=1Sr/wTLrisjBtInY4Qg4UmUDcRoGWkzytLN3VD3D3Vk=; b=VCmI23CDI1JDrj+Y7mMMunpwtU1V3VDHy07kCheQlI8XJc5n/89/ovD3ix1cf6vJF6H3sW F8n1disLNssQT25ZIUowF//xSyYZhO0dSzNiU4wi1x4PLJZ1+Cwr+VkEvImZOAzFr6KWva Ku0yxCoM0dCUQiWHsmybKAIi44OnCyI= X-MC-Unique: XB1CLehKONOzJvZfDM2ZMA-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/9] docs: XSL: Add source document name as custom data attribute for Date: Tue, 14 Feb 2023 22:51:09 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411558683100001 Content-Type: text/plain; charset="utf-8" The html standard allows custom data attributes on any element in the format of 'data-*' which are not interpreted. We can use it to embed the name of the source document used to generate the page so that our checker tools can use the friendly name. https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visibl= e-data-with-the-data-*-attributes Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/page.xsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/page.xsl b/docs/page.xsl index 548d5a11c4..20b49d1afd 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -80,7 +80,7 @@ <!DOCTYPE html> - + This file is autogenerated from Do not edit this file. Changes will be lost. --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411491; cv=none; d=zohomail.com; s=zohoarc; b=ecrF6nbqjvgbn9ljrnmYoHXzZIdJirkNxgxlTmf0zLxYDW+e7jSOvzQWMaRfgBPcfBb8wTPHNgcaUOCEDkylkWIQ5nshtaQFBFcNnHpj0bxuKhGSD5p6CuoM0n1zEEsGqRqov0NpRz4JmalglhNL9jjTE9ziP8+oHYxKjQlNJto= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411491; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=oR2g9x/SNqLQz3+6xy7UgOEpY5Xg2MTYoHIpE7zaw80=; b=nL6sz4oy02N7BqU3hZu3Yuc2mmMBQ0ZxcTOLakignXdEbTHOd7hcsknYsOlz8Vfh2AJ5quSy8ePTq9QoPhAY9k9LROxgNDgEfgYCklNNwm9cOzcR36VPpDedBkm++Babe3n+PBvEv7JtXO1M9oqPfEwg29pJIvVEBkn8vevRrvE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1676411491296661.0238036250747; Tue, 14 Feb 2023 13:51:31 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-WuZLaUg0Owmm41GQfsoYdw-1; Tue, 14 Feb 2023 16:51:28 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 25327100F907; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id C8B8840C1423; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 12DD9194658C; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 42C5A1946595 for ; Tue, 14 Feb 2023 21:51:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id F3CAC112131B; Tue, 14 Feb 2023 21:51:20 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 67E071121314 for ; Tue, 14 Feb 2023 21:51:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411490; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=oR2g9x/SNqLQz3+6xy7UgOEpY5Xg2MTYoHIpE7zaw80=; b=LGj0I0bx0vspASLw4Uwae8mY/AqGM0ixz8+cBBpjy9kXVPUyYvgCTDoLnw3gzUwE0Yzgl7 Yj7bYq3sf3BPwGkEhZdQ7CvIYe2eUxkVXpUgMovlZihX1T1iJxjjV84A1sUd3yyLMgDLiB 28GLjHSkzFkxrLf405vPWJuO/CkHQBE= X-MC-Unique: WuZLaUg0Owmm41GQfsoYdw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/9] scripts: check-html-references: Rename --prefix to --webroot and make it mandatory Date: Tue, 14 Feb 2023 22:51:10 +0100 Message-Id: <2e56dfeacfad81e4625eb3cd2e9ee4c2ece2735a.1676411136.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411492243100002 Content-Type: text/plain; charset="utf-8" Force users to pass the path to the root of the webpage the script should check. The script lives in a different subdirectory so the default of the current directory doesn't make much sense. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/meson.build | 2 +- scripts/check-html-references.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index 5c0c762db1..5ffd39c01b 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -359,7 +359,7 @@ test( python3_prog, args: [ check_html_references_prog.full_path(), - '--prefix', + '--webroot', meson.project_build_root() / 'docs' ], env: runutf8, diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index 95a61a6bb4..6d9116585e 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -127,14 +127,14 @@ def check_targets(targets, anchors): parser =3D argparse.ArgumentParser(description=3D'HTML reference checker') -parser.add_argument('--prefix', default=3D'.', - help=3D'build tree prefix') +parser.add_argument('--webroot', required=3DTrue, + help=3D'path to the web root') parser.add_argument('--external', action=3D"store_true", help=3D'print external references instead') args =3D parser.parse_args() -files =3D get_file_list(args.prefix) +files =3D get_file_list(args.webroot) targets, anchors =3D process_all(files) --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411523; cv=none; d=zohomail.com; s=zohoarc; b=UXK0FpP32yPe8KgPScJ+Z2lAjmQvQkgFL3DDRzH3kvz4xxz6CGEzdl9CwNfJoH4xARCxk/DyZ6kMZ3mCnJOEwtPNiWBEAaymT3r0YMJjbt5ibLQL6YeF42fhI5a2by6mR8sSzYanMHsBjMZr3RLRjMdghpa2IlGhwX95vWpqXiA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411523; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=p7QP/+lC0INrdVULdjzcBP4xxZt6cwpSNEk1+7KkjVo=; b=Qr7Y+FHEdg5Jqv0H8Kz5kwgiW1SrZmKnCNDLLy2lBKBeRlfS2cIx8tIGfVjXcQhV7JulXr9H0Y+XAZ+oKe3TREJFKar3ro2bOUWKlzZvkYfOCZtkpb2uDRAzMNjwyHqOX2Ff04lJrQpHL6zCYt8PrxCb05Kan1NL8ochqDH9vd0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411523957210.76386000869934; Tue, 14 Feb 2023 13:52:03 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-324-YMCuMZK6MDGZ7qnMj13TWg-1; Tue, 14 Feb 2023 16:51:28 -0500 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 26F4D100F908; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1374E1C55A; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3E9111946A43; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 455461946597 for ; Tue, 14 Feb 2023 21:51:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E959A1121314; Tue, 14 Feb 2023 21:51:21 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 61595112131E for ; Tue, 14 Feb 2023 21:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411522; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=p7QP/+lC0INrdVULdjzcBP4xxZt6cwpSNEk1+7KkjVo=; b=Hvxge6ePwXvZvjCh58mZVlmDyhiip9YvlDUU1sCE4jk2PUCx+QIKwTLMjDBdcpd3L5VzIu w5qNgHVuVH+J7Y18aIY/fekuu9XqbXFXlsi0gpZ2Fvhfy/OGKJx/A8d/N3V3bwJnmmH0g9 oDaLF6GgLZGbArzHIlBGBGh20EkModk= X-MC-Unique: YMCuMZK6MDGZ7qnMj13TWg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 3/9] scripts: check-html-references: Improve error messages and don't mess with relative paths Date: Tue, 14 Feb 2023 22:51:11 +0100 Message-Id: <84078964490d6482b68f6334871cee67ba2044d5.1676411136.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.5 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411524458100001 Content-Type: text/plain; charset="utf-8" Now that we have the source file name as a custom attribute we can use it to report which file actually needs to be edited to fix the error: ERROR: 'docs/uri.rst': broken link to: 'drvqemu.html#exaple' rather than: broken link targets: docs/uri.html broken link: drvqemu.html#exaple which pointed to file which does not exist in the source directory. This also allows us to delete all the relative path handling needed to report at least somewhat user-legible errors before. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/check-html-references.py | 46 +++++++++++++------------------- 1 file changed, 19 insertions(+), 27 deletions(-) diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index 6d9116585e..8e726928e0 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -30,13 +30,6 @@ def get_file_list(prefix): filelist =3D [] for root, dir, files in os.walk(prefix): - prefixbase =3D os.path.dirname(prefix) - - if root.startswith(prefixbase): - relroot =3D root[len(prefixbase):] - else: - relroot =3D root - for file in files: if not re.search('\\.html$', file): continue @@ -45,20 +38,21 @@ def get_file_list(prefix): if '404.html' in file: continue - fullfilename =3D os.path.join(root, file) - relfilename =3D os.path.join(relroot, file) - filelist.append((fullfilename, relfilename)) + filelist.append(os.path.join(root, file)) return filelist # loads an XHTML and extracts all anchors, local and remote links for the = one file -def process_file(filetuple): - filename, relfilename =3D filetuple +def process_file(filename): tree =3D ET.parse(filename) root =3D tree.getroot() + docname =3D root.get('data-sourcedoc') - anchors =3D [relfilename] + if not docname: + docname =3D filename + + anchors =3D [filename] targets =3D [] for elem in root.findall('.//html:a', ns): @@ -66,30 +60,30 @@ def process_file(filetuple): an =3D elem.get('id') if an: - anchors.append(relfilename + '#' + an) + anchors.append(filename + '#' + an) if target: if re.search('://', target): externallinks.append(target) elif target[0] !=3D '#' and 'mailto:' not in target: - dirname =3D os.path.dirname(relfilename) - targetname =3D os.path.normpath(os.path.join(dirname, targ= et)) + dirname =3D os.path.dirname(filename) + targetfull =3D os.path.normpath(os.path.join(dirname, targ= et)) - targets.append((targetname, filename, target)) + targets.append((filename, docname, targetfull, target)) # older docutils generate "
(p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411526404199.6059720715724; Tue, 14 Feb 2023 13:52:06 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-609-6Ngrqu2ZO8WQMqHhg44GXg-1; Tue, 14 Feb 2023 16:51:31 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3841D29A8AEC; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2208014171B8; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 51C2D19465A4; Tue, 14 Feb 2023 21:51:24 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F1669194658C for ; Tue, 14 Feb 2023 21:51:22 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E3F3E1121318; Tue, 14 Feb 2023 21:51:22 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 558D71121314 for ; Tue, 14 Feb 2023 21:51:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411525; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=mdFvZYJNpnSpj7rp/j46WZIdQSoPK2/1nLVggo39z9o=; b=ObKNNnxSW0pOcVQW+AYm/M43mOXSJVeC3J2YiBxNR3h5Ea9dIpibk1NrX07sJm7AAFfE6g Tog0sbCFObBGOyyjfYrmksWqVdUdP1XmoIXPYMrmwcPiZUx7yYI4nVtdp2+S/YNtKFibMX 8m9AN8fh0k0/Kyn69OkFnlniDZM/lnc= X-MC-Unique: 6Ngrqu2ZO8WQMqHhg44GXg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 4/9] docs: manpages: Add missing manpages to index Date: Tue, 14 Feb 2023 22:51:12 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411528448100001 Content-Type: text/plain; charset="utf-8" The manpages for 'virt-pki-query-dn', 'virt-qemu-qmp-proxy' and 'virt-ssh-helper.rst' were not referenced from the manpage index or any other place. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/manpages/index.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/manpages/index.rst b/docs/manpages/index.rst index 8fd0d90041..e28c8e2f54 100644 --- a/docs/manpages/index.rst +++ b/docs/manpages/index.rst @@ -42,6 +42,9 @@ Tools * `virsh(1) `__ - management user interface * `virt-qemu-run(1) `__ - run standalone QEMU instances * `libvirt-guests(8) `__ - suspend/resume running lib= virt guests +* `virt-pki-query-dn(1) `__ - extract Distinguishe= d Name from a PEM certificate +* `virt-ssh-helper(8) `__ - libvirt socket proxy (in= ternal helper tool) +* `virt-qemu-qmp-proxy(1) `__ - Expose a QMP pro= xy server for a libvirt QEMU guest Key codes =3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411497; cv=none; d=zohomail.com; s=zohoarc; b=YqHsujuhbphwM+8/pTu127f10NMQcXvA2yrDXLYPPCd0Aiyqv8kMeshWm1QhAV1uT1prL0bZls/h4L0TFpqjTY5Hd2GUBQB54/0liDDetSfEa/CpXk4kK0HYpSOFaTcA+SQUTzA1id5Z2Q50x9NYZVBygk/1C7ybln1jjX0MGO0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411497; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=4nUeKgsbUwEGEkdrx8DqQqvH8C+8X5nTCgSMP9LH0kg=; b=NGwmTORb/srfHo0vpU2AbW+gG9yQ9SJKTqze/qnkRbdSEcrBEqfO93rqEwDfc8ZxmxoFGI9HyFBRfd8HjnHA31XgI5/zG0qo10FzYjZxCajBvhItEmSybfT56HDoxuivMwWhyfMzakNfG0MQStKma7p1TAKdBg0QmeptI8NUNqs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411497832772.969104648852; Tue, 14 Feb 2023 13:51:37 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-671-PNUoZAWyMcSL63vXAey5qw-1; Tue, 14 Feb 2023 16:51:32 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A0F97857A94; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 890B114171B8; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id ADD55194658C; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F238B19465A4 for ; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E7EC71121318; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5C6BC1121314 for ; Tue, 14 Feb 2023 21:51:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411493; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=4nUeKgsbUwEGEkdrx8DqQqvH8C+8X5nTCgSMP9LH0kg=; b=e+BCkJA7degXBO1hNMXRCYAWGFySD5kYIqkiinPdFq6s37KjzjCZG7c8I5EJVvRBciuANp TZdLXfXzkR2kIkSeJeRh46OhYd1i91Tu2QOkELPb1qaQoadcX1GE7cmpuMp7a8vSNAqr0U AWGdmGAO7PT51Mag7xgfNdq/sDyiO6E= X-MC-Unique: PNUoZAWyMcSL63vXAey5qw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 5/9] docs: Add sub-page for all golang modules Date: Tue, 14 Feb 2023 22:51:13 +0100 Message-Id: <26963dd31ac30cadf80b5e9d8a01ad2a2d68a5b4.1676411136.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411498342100001 Content-Type: text/plain; charset="utf-8" Our documentation has pages for 4 go modules, 2 current and 2 obsolete ones, but points only to one of them and directly to golang's docs page. Add a sub-page where all 4 sub-pages for the modules are linked. Signed-off-by: Peter Krempa --- docs/docs.rst | 2 +- docs/golang.rst | 21 +++++++++++++++++++++ docs/meson.build | 1 + 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 docs/golang.rst diff --git a/docs/docs.rst b/docs/docs.rst index a826bd128c..855ce6a069 100644 --- a/docs/docs.rst +++ b/docs/docs.rst @@ -79,7 +79,7 @@ Application development `Language bindings and API modules `__ Bindings of the libvirt API for `c# `__, - `go `__, + `go `__ (`all go modules `__), `java `__, `ocaml `__, `perl `__, diff --git a/docs/golang.rst b/docs/golang.rst new file mode 100644 index 0000000000..77821cee24 --- /dev/null +++ b/docs/golang.rst @@ -0,0 +1,21 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Go Language bindings +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +Modern libvirt API bindings with Go modules +------------------------------------------- + +The libvirt API bindings package and module for XML manipulation: + + - `libvirt.org/go/libvirt `__ package https://pkg.go.dev= /libvirt.org/go/libvirt + - `libvirt.org/go/libvirtxml `__ package https://pkg.= go.dev/libvirt.org/go/libvirtxml + + +Obsolete libvirt language bindings +---------------------------------- + +The following two go packages were superseded, but software currently usin= g them +No further development will take place. + + - `libvirt.org/libvirt-go `__ - CGo binding to the nativ= e API + - `libvirt.org/libvirt-go-xml `)) - annotated Go str= uct definitions for XML handling diff --git a/docs/meson.build b/docs/meson.build index 5ffd39c01b..a90c59866a 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -80,6 +80,7 @@ docs_rst_files =3D [ 'formatstorageencryption', 'glib-adoption', 'goals', + 'golang', 'governance', 'hacking', 'hooks', --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411538; cv=none; d=zohomail.com; s=zohoarc; b=BdshzzODv0ntwK9xGciX1rPzAJP3HJTVhclf+rvmeyoLzSDAaxFzdDcgGKNEeJUTkptkb1y2c62B4J3KOv6V+u46U+pB2Ge+535UOa69K5/K8EekumRtp53g71RXw6Rs+xqNB4mjLfcHedZajyBaeFeTVOR9ZXdRWz0ZvNceMYQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411538; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=7DeuaCAHDs1upCwhzpopd5EJPz8+fRWHcKM2llTT5Vc=; b=WuK66HyMiU6TzVeN/U7TvAQtQsH1+ZIgmyJ0ICNwxOvL8sW8FrWK08J7WKYKMtwjG1opxXA69Hlw/Bc/5kFXTiYtFor1VbfPiiol6tgJJeVo8ysH2Mnuqw1PXGOXjKXeVHYH8E+FvNSTlkzGU/+AYNm3RE9aTNEyBp0L6xSj1AE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1676411538731413.97040178327325; Tue, 14 Feb 2023 13:52:18 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-20-umML90-dPPiVJKJkE5m0qw-1; Tue, 14 Feb 2023 16:51:32 -0500 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com [10.11.54.1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 06244800DAA; Tue, 14 Feb 2023 21:51:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E22F54051E47; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id E5F961946A41; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F31E019465B1 for ; Tue, 14 Feb 2023 21:51:24 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E87CC1121319; Tue, 14 Feb 2023 21:51:24 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5313B1121318 for ; Tue, 14 Feb 2023 21:51:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411537; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=7DeuaCAHDs1upCwhzpopd5EJPz8+fRWHcKM2llTT5Vc=; b=LZfxEmFUfBL978AmAo/Vi9R9zl5uKlwNKjSlY383Q1BnLffpwgT8cad6K7LseCqzOPpOn0 YMmlqpHuNEdk3U3Lz9Sc1faJcAfXdQATPFlhFtEDID1BD/CxjGiO5ktTPde6t3RMKHM8XR GvaJYRYUUXPP5uxoAOuQoHFHA1CAebM= X-MC-Unique: umML90-dPPiVJKJkE5m0qw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 6/9] scripts: check-html-references: Detect pages that are not linked to Date: Tue, 14 Feb 2023 22:51:14 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411540571100001 Content-Type: text/plain; charset="utf-8" Prevent sub-pages without a way to reach them. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/check-html-references.py | 57 ++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index 8e726928e0..4f08feab59 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -40,6 +40,8 @@ def get_file_list(prefix): filelist.append(os.path.join(root, file)) + filelist.sort() + return filelist @@ -118,9 +120,54 @@ def check_targets(targets, anchors): return False +def check_usage_crawl(page, targets, visited): + visited.append(page) + + tocrawl =3D [] + + for filename, docname, target, _ in targets: + if page !=3D filename: + continue + + targetpage =3D target.split("#", 1)[0] + + if targetpage not in visited and targetpage not in tocrawl: + tocrawl.append(targetpage) + + for crawl in tocrawl: + check_usage_crawl(crawl, targets, visited) + + +# crawls the document references starting from entrypoint and tries to find +# unreachable pages +def check_usage(targets, files, entrypoint): + visited =3D [] + fail =3D False + + check_usage_crawl(entrypoint, targets, visited) + + for file in files: + if file not in visited: + brokendoc =3D file + + for filename, docname, _, _ in targets: + if filename !=3D file: + continue + if docname: + brokendoc =3D docname + break + + print(f'ERROR: \'{brokendoc}\': is not referenced from anywher= e') + fail =3D True + + return fail + + parser =3D argparse.ArgumentParser(description=3D'HTML reference checker') parser.add_argument('--webroot', required=3DTrue, help=3D'path to the web root') +parser.add_argument('--entrypoint', default=3D"index.html", + help=3D'file name of web entry point relative to --web= root') parser.add_argument('--external', action=3D"store_true", help=3D'print external references instead') @@ -128,8 +175,12 @@ args =3D parser.parse_args() files =3D get_file_list(os.path.abspath(args.webroot)) +entrypoint =3D os.path.join(os.path.abspath(args.webroot), args.entrypoint) + targets, anchors =3D process_all(files) +fail =3D False + if args.external: prev =3D None externallinks.sort() @@ -140,6 +191,12 @@ if args.external: prev =3D ext else: if check_targets(targets, anchors): + fail =3D True + + if check_usage(targets, files, entrypoint): + fail =3D True + + if fail: sys.exit(1) sys.exit(0) --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411532; cv=none; d=zohomail.com; s=zohoarc; b=IvIJ3gRA5a8dSXJR0hls0Q/SOJAtL2qQXT2uHI91uAw1Q3oEh8XPSUEbZ62rsCQ1Tqb1H/oIg4Tpd8w2GNwhIYSS8NaSazRTu9aJNANASLa6ntb6IWPF2FoUVhDeNMssCr6otA2Ah6Jou6aVg1GIzTSRuNDk7nV1bZbsUMulZT4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411532; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=JMwUQjSfkzBaEQQbGYSgsbVkpp8/KECA4A3SxfNKMl8=; b=chOS8XXp11j7lwOdNnorNPz6vx5tTG6r56115wiAmzQny+mxJX0RLw/mI1JbBvGre0GVWnP5XZYdCGaGGZroFYAEhy8cgZfautBsRBSJ/xs+S2GBL5ZXj4DJmvkCJs5A1LrXQxDS4SQUBF7C1kkHVNznNOHUpqhWK5LH80p8VLo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411532237430.75388568508504; Tue, 14 Feb 2023 13:52:12 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-562-so-8opYeOx2aCrqdPmGY2w-1; Tue, 14 Feb 2023 16:51:32 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7CA8F3C02B8D; Tue, 14 Feb 2023 21:51:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 513734014D03; Tue, 14 Feb 2023 21:51:27 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8A44B1946595; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id EA4F31946A43 for ; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E0B771121314; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 540811121318 for ; Tue, 14 Feb 2023 21:51:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411531; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=JMwUQjSfkzBaEQQbGYSgsbVkpp8/KECA4A3SxfNKMl8=; b=JNegFYYWeh6cX8yxYofJbSFtKJDcJUHYgd/sK+E9FEmBEpWyFx8Yz91hR1kX+1+6XYgieM XsRkt5GnaWdjllj7dNTPKDWXv2R0YU6SQyVa1w90HF9AklEwqHSdYOlWvF4uygzPeoFqaU ATegfOC2oGvswtss2nqgwYGakNKxF3M= X-MC-Unique: so-8opYeOx2aCrqdPmGY2w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 7/9] kbase: eventloop: Fix path to referenced images Date: Tue, 14 Feb 2023 22:51:15 +0100 Message-Id: <2fba5da26c94618cb687c56d42a027362dc826e8.1676411136.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411532506100001 Content-Type: text/plain; charset="utf-8" The images are referenced from '../images/' but the document is two layers deep thus '../../images' needs to be used Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/kbase/internals/eventloop.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/kbase/internals/eventloop.rst b/docs/kbase/internals/even= tloop.rst index 856cabc85f..c7770614a1 100644 --- a/docs/kbase/internals/eventloop.rst +++ b/docs/kbase/internals/eventloop.rst @@ -23,7 +23,7 @@ desired function. If generalized, this is how many long r= unning programs (daemons) work. Even those who are not waiting for direct user input and h= ave no graphical interface. Such as Libvirt. -.. image:: ../images/event_loop_simple.png +.. image:: ../../images/event_loop_simple.png :alt: event loop In Libvirt this approach is used in combination with ``poll(2)`` as all the @@ -57,7 +57,7 @@ a message event loop is blocked and for an outside observ= er unresponsive. This is not acceptable for Libvirt. Therefore we have came up with the following solution. -.. image:: ../images/event_loop_worker.png +.. image:: ../../images/event_loop_worker.png :alt: event loop The event loop does only necessary minimum and hand over message processin= g to --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411524; cv=none; d=zohomail.com; s=zohoarc; b=jVyHBRG/dHgLxWAxBCsQ6RAR3KIEz5fPXlUwvHoVOjBrdSn9//lZA5HWWhJjT74Il8i6SS3HsbmmHj10IhU7plrM9lS39JF1dFXblLbUtpdH9N9K2NO1yCZOu/DqWDJgE3bMTd/pbQhB56HKzD2gbhtWTAVen3Q5NJ1fx//tXC0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411524; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=sUTLIKlCLZSdH1KCXKGElDVULIwqYv4DhawqCUqhwZw=; b=CZBqaWLEGZAOpyJSexxM7LPhqegEMnACirDvOSWYHrXe9vkuAC/Q2xmEIa5f4sDD+eGYo871Qccr71+AGoXufuNmi72B+V+FNe9aKmzXadM83a7EPxToF7LmQKhas0b2ZAOOJzT57WrRVOpi80pmQqnZls9xg3MLi86fhl6BI8Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411524027425.22935359595726; Tue, 14 Feb 2023 13:52:04 -0800 (PST) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-590-Qy86f4NYM1isWRJCzl0d-Q-1; Tue, 14 Feb 2023 16:51:33 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 01F9A1C02CA6; Tue, 14 Feb 2023 21:51:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id E0D79492B03; Tue, 14 Feb 2023 21:51:29 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id C32FB1946588; Tue, 14 Feb 2023 21:51:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id F164E19465A8 for ; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id E51521121318; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 5976C1121314 for ; Tue, 14 Feb 2023 21:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411523; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=sUTLIKlCLZSdH1KCXKGElDVULIwqYv4DhawqCUqhwZw=; b=bb943C8zkzjoJLzeFQBbomb+VEs/NBbD6bUxhttH64RD+jZUY0hbSi+v0hbRoqikcdWZsU TE6SfDaxZxacXDWDFve1/KF8TPU5eJZGIpv7JmoUseLfO40pxuWEYJShwuI01Q/DLVBY3J 7l9s40LfZ3uEv48/crVz0rtbMmQ0CyM= X-MC-Unique: Qy86f4NYM1isWRJCzl0d-Q-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 8/9] docs: logos: Turn 'README' into rST, generate an index and link to images Date: Tue, 14 Feb 2023 22:51:16 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411524472100002 Content-Type: text/plain; charset="utf-8" The logo directory wasn't really referenced from anywhere. Additionally there wasn't any reasonable index for all the image files which we have. Turn the README file into rST and display the images it references. Link to the new index file from the docs page. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/docs.rst | 3 + docs/logos/README | 98 ------------------------ docs/logos/README.rst | 166 +++++++++++++++++++++++++++++++++++++++++ docs/logos/meson.build | 47 ++++++++++++ 4 files changed, 216 insertions(+), 98 deletions(-) delete mode 100644 docs/logos/README create mode 100644 docs/logos/README.rst diff --git a/docs/docs.rst b/docs/docs.rst index 855ce6a069..ea14555575 100644 --- a/docs/docs.rst +++ b/docs/docs.rst @@ -163,3 +163,6 @@ Project development `New repo setup `__ Procedure for configuring new git repositories for libvirt + +`Libvirt logos `__ + Libvirt logo files and guideline how to use them diff --git a/docs/logos/README b/docs/logos/README deleted file mode 100644 index 64dee41ec8..0000000000 --- a/docs/logos/README +++ /dev/null @@ -1,98 +0,0 @@ - Libvirt Logo README - =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -The master SVG files were created in InkScape, using the Overpass font fro= m Red -Hat: - - https://overpassfont.org/ - - -Logo formats -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -The following SVG files are provided, along with standard bitmap sizes in = PNG -format: - - - logo-base.svg - - The basic "sardine tin" graphic used to create the other forms of the - libvirt logo. - - The tin is rotated by 20 degrees, so its angle matches the angle of the= left - side of the letter "v" in the Overpass font - - Never use this logo file directly. It exists merely as a base for build= ing - the other logos - - - - logo-square.svg - - The minimal square format logo for libvirt. Simply embeds the word "lib= virt" - into the basic logo graphic. - - This is intended for use where a compact, square format representation = of - the logo is required. - - Bitmap sizes: 64, 128, 192, 256 px square - - - - logo-square-powered.svg - - A variant of the square logo for use by 3rd party applications, to adve= rtise - their use of libvirt. - - Bitmap sizes: 64, 128, 192, 256 px square - - - - logo-banner-light.svg - - A wide banner format of the logo. Embeds the words "libvirt virtualizat= ion - API" into the basic logo graphic. The text is rendered in a light color= , so - suitable for placement over a dark background. - - Bitmap sizes: 257x92, 800x286 px - - - - logo-banner-dark.svg - - A wide banner format of the logo. Embeds the words "libvirt virtualizat= ion - API" into the basic logo graphic. The text is rendered in a dark color,= so - suitable for placement over a light background. - - Bitmap sizes: 257x92, 800x286 px - - - - logo-sticker-square.svg - - A logo formatted into a square shape with outline, suitable for printing - as a sticker. See https://github.com/terinjokes/StickerConstructorSpec - - - - logo-sticker-hexagon.svg - - A logo formatted into a hexagon shape with outline, suitable for printi= ng - as a sticker. See https://github.com/terinjokes/StickerConstructorSpec - - -PNG file creation -=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D - -The bitmap images should not be created in Inkscape, since its anti-aliasi= ng of -the rendered bitmaps is too aggressive, resulting in fuzzy images. Instead= the -GIMP is used to create bitmaps as follows: - - - File -> Open, select the SVG file - - When prompted for the image size, enter 1024 as the width and allow hei= ght - to be auto-set based on aspect ratio - - - Image -> Scale Image - - Enter desired final bitmap size and use "Cubic" as scaling method. - - - File -> Export As - - -It is important to let GIMP render initially at 1024 and then scale down, = rather -than rendering directly at the target size, since this the manual scaling = step -produces better quality diff --git a/docs/logos/README.rst b/docs/logos/README.rst new file mode 100644 index 0000000000..4b03d3aad1 --- /dev/null +++ b/docs/logos/README.rst @@ -0,0 +1,166 @@ +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D +Libvirt Logo README +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The master SVG files were created in InkScape, using the Overpass font fro= m Red +Hat: + + https://overpassfont.org/ + + +.. contents:: + + +Logo formats +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The following SVG files are provided, along with standard bitmap sizes in = PNG +format: + +``logo-base.svg`` +----------------- + +.. image:: logo-base.svg + +The basic "sardine tin" graphic used to create the other forms of the +libvirt logo. + +The tin is rotated by 20 degrees, so its angle matches the angle of the le= ft +side of the letter "v" in the Overpass font + +Never use this logo file directly. It exists merely as a base for building +the other logos + +``logo-square.svg`` +------------------- + +.. image:: logo-square.svg + +The minimal square format logo for libvirt. Simply embeds the word "libvir= t" +into the basic logo graphic. + +This is intended for use where a compact, square format representation of +the logo is required. + +Bitmap sizes: 96, 128, 192, 256 px square + +- 96px: + +.. image:: logo-square-96.png + +- 128px: + +.. image:: logo-square-128.png + +- 192px: + +.. image:: logo-square-192.png + +- 256px: + +.. image:: logo-square-256.png + + + +``logo-square-powered.svg`` +--------------------------- + +.. image:: logo-square-powered.svg + +A variant of the square logo for use by 3rd party applications, to adverti= se +their use of libvirt. + +Bitmap sizes: 96, 128, 192, 256 px square + +- 96px: + +.. image:: logo-square-powered-96.png + +- 128px: + +.. image:: logo-square-powered-128.png + +- 192px: + +.. image:: logo-square-powered-192.png + +- 256px: + +.. image:: logo-square-powered-256.png + +``logo-banner-light.svg`` +------------------------- + +.. image:: logo-banner-light.svg + +A wide banner format of the logo. Embeds the words "libvirt virtualization +API" into the basic logo graphic. The text is rendered in a light color, so +suitable for placement over a dark background. + +Bitmap sizes: 256x92, 800x286 px + +- 256x92px: + +.. image:: logo-banner-light-256.png + +- 800x286px: + +.. image:: logo-banner-light-800.png + +``logo-banner-dark.svg`` +------------------------ + +.. image:: logo-banner-dark.svg + +A wide banner format of the logo. Embeds the words "libvirt virtualization +API" into the basic logo graphic. The text is rendered in a dark color, so +suitable for placement over a light background. + +Bitmap sizes: 256x92, 800x286 px + +- 256x92px: + +.. image:: logo-banner-dark-256.png + +- 800x286px: + +.. image:: logo-banner-dark-800.png + +``logo-sticker-square.svg`` +--------------------------- + +.. image:: logo-sticker-square.svg + +A logo formatted into a square shape with outline, suitable for printing +as a sticker. See https://github.com/terinjokes/StickerConstructorSpec + +``logo-sticker-hexagon.svg`` +---------------------------- + +.. image:: logo-sticker-hexagon.svg + +A logo formatted into a hexagon shape with outline, suitable for printing +as a sticker. See https://github.com/terinjokes/StickerConstructorSpec + +PNG file creation +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D + +The bitmap images should not be created in Inkscape, since its anti-aliasi= ng of +the rendered bitmaps is too aggressive, resulting in fuzzy images. Instead= the +GIMP is used to create bitmaps as follows: + + - File -> Open, select the SVG file + + When prompted for the image size, enter 1024 as the width and allow hei= ght + to be auto-set based on aspect ratio + + - Image -> Scale Image + + Enter desired final bitmap size and use "Cubic" as scaling method. + + - File -> Export As + + +It is important to let GIMP render initially at 1024 and then scale down, = rather +than rendering directly at the target size, since this the manual scaling = step +produces better quality diff --git a/docs/logos/meson.build b/docs/logos/meson.build index 70ba67d71c..c65fcdd8ed 100644 --- a/docs/logos/meson.build +++ b/docs/logos/meson.build @@ -29,3 +29,50 @@ foreach file : docs_logo_files install_web_files +=3D '@0@:@1@'.format(meson.current_source_dir() / fil= e, docs_html_dir / 'logos') endforeach + + +html_xslt_gen_install_dir =3D docs_html_dir / 'logos' +html_xslt_gen =3D [] + +# README.rst is formatted as index.html for viewing +html_xslt_gen +=3D { + 'name': 'index', + 'file': docs_rst2html5_gen.process('README.rst'), + 'source': 'docs' / 'logos' / 'README.rst', + 'href_base': '../', +} + + +# --- begin of XSLT processing --- + +foreach data : html_xslt_gen + html_filename =3D data['name'] + '.html' + + html_file =3D custom_target( + html_filename, + input: data.get('file', data['name'] + '.html.in'), + output: html_filename, + command: [ + xsltproc_prog, + '--stringparam', 'pagesrc', data.get('source', ''), + '--stringparam', 'builddir', meson.project_build_root(), + '--stringparam', 'timestamp', docs_timestamp, + '--stringparam', 'href_base', data.get('href_base', ''), + '--nonet', + site_xsl, + '@INPUT@', + ], + depends: data.get('depends', []), + depend_files: [ page_xsl ], + capture: true, + install: true, + install_dir: html_xslt_gen_install_dir, + ) + + install_web_deps +=3D html_file + install_web_files +=3D html_file.full_path() + ':' + html_xslt_gen_insta= ll_dir +endforeach + +html_xslt_gen =3D [] + +# --- end of XSLT processing --- --=20 2.39.1 From nobody Tue Apr 30 17:29:33 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) client-ip=170.10.129.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1676411546; cv=none; d=zohomail.com; s=zohoarc; b=mWLtm05TqU0l8sEmmAmmqpk49mXx4KQeC+ELO0ZXC/n6nNPQDayNWeVal4N/mqW81rmgNyfKRAGGh1n0sHWL0YHJ93zXCmyU6cxN15Cx7o1FfmUeoq4ANF6YvFmZhJwlDKz6vc3F3mwR30RpGwtwNxe9PeONP+vOtIF6/bKIY+4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1676411546; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=fSdS08q2mZPx5NkN18FfX6RoTIi9C7b7dz+kinZot4s=; b=DmKtsYqqQ9EmO9KNafDRfwvANAf7KIXbi7L947GUGMfCgDSDDVzy2YHHr8GsLYokXlow/VGeL/PFcXm0UU/zZ76SFmoEhtDUS/JkjZ02hKGPKBXROLVHI6Ji9J6fccbp1D9IRFdlYDZVnQlQVgBn5GyURCBFZvNpsX9HbWhUbmo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.129.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by mx.zohomail.com with SMTPS id 1676411546745276.6054414937479; Tue, 14 Feb 2023 13:52:26 -0800 (PST) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-593-thDbMb6sNUma6N3ZNTAGGg-1; Tue, 14 Feb 2023 16:51:36 -0500 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8E26C803D7C; Tue, 14 Feb 2023 21:51:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72530492B04; Tue, 14 Feb 2023 21:51:30 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 04FB219465B5; Tue, 14 Feb 2023 21:51:30 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 0EC991946586 for ; Tue, 14 Feb 2023 21:51:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 035EA1121314; Tue, 14 Feb 2023 21:51:28 +0000 (UTC) Received: from speedmetal.redhat.com (ovpn-208-8.brq.redhat.com [10.40.208.8]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4DC051121318 for ; Tue, 14 Feb 2023 21:51:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1676411545; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=fSdS08q2mZPx5NkN18FfX6RoTIi9C7b7dz+kinZot4s=; b=EXbyeyrFYfFkadoBv0Q90BCJ+OUK2QbxMNJxv+FEkgW1/1c+Y+vFTIQ0DBRcVbjI+NS7ut vwV9vMT8EviEICxzSzMN1ENsPiOyE8E1lNWsGVFfnB/HI0brCTkKqn5/MNCSaynuAjR5fx 77kmImJzQ7YPD0zQKnlbXjKA8LafZxk= X-MC-Unique: thDbMb6sNUma6N3ZNTAGGg-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 9/9] scripts: check-html-refernces: Add checking for image file usage Date: Tue, 14 Feb 2023 22:51:17 +0100 Message-Id: In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1676411548587100001 Content-Type: text/plain; charset="utf-8" Check both that a file is referenced from our pages and also that pages reference existing images. The mode for dumping external references now also dumps images. '--ignore-image' can be used repeatedly to suppress errors for specific images. Signed-off-by: Peter Krempa Reviewed-by: Daniel P. Berrang=C3=A9 --- scripts/check-html-references.py | 101 ++++++++++++++++++++++++++----- 1 file changed, 87 insertions(+), 14 deletions(-) diff --git a/scripts/check-html-references.py b/scripts/check-html-referenc= es.py index 4f08feab59..788622a2d0 100755 --- a/scripts/check-html-references.py +++ b/scripts/check-html-references.py @@ -24,25 +24,32 @@ import xml.etree.ElementTree as ET ns =3D {'html': 'http://www.w3.org/1999/xhtml'} externallinks =3D [] +externalimages =3D [] def get_file_list(prefix): filelist =3D [] + imagelist =3D [] + imageformats =3D ['.jpg', '.svg', '.png'] for root, dir, files in os.walk(prefix): for file in files: - if not re.search('\\.html$', file): - continue + ext =3D os.path.splitext(file)[1] - # the 404 page doesn't play well - if '404.html' in file: - continue + if ext =3D=3D '.html': + # the 404 page doesn't play well + if '404.html' in file: + continue + + filelist.append(os.path.join(root, file)) - filelist.append(os.path.join(root, file)) + elif ext in imageformats: + imagelist.append(os.path.join(root, file)) filelist.sort() + imagelist.sort() - return filelist + return filelist, imagelist # loads an XHTML and extracts all anchors, local and remote links for the = one file @@ -50,12 +57,14 @@ def process_file(filename): tree =3D ET.parse(filename) root =3D tree.getroot() docname =3D root.get('data-sourcedoc') + dirname =3D os.path.dirname(filename) if not docname: docname =3D filename anchors =3D [filename] targets =3D [] + images =3D [] for elem in root.findall('.//html:a', ns): target =3D elem.get('href') @@ -68,7 +77,6 @@ def process_file(filename): if re.search('://', target): externallinks.append(target) elif target[0] !=3D '#' and 'mailto:' not in target: - dirname =3D os.path.dirname(filename) targetfull =3D os.path.normpath(os.path.join(dirname, targ= et)) targets.append((filename, docname, targetfull, target)) @@ -87,20 +95,33 @@ def process_file(filename): if an: anchors.append(filename + '#' + an) - return (anchors, targets) + # find local images + for elem in root.findall('.//html:img', ns): + src =3D elem.get('src') + + if src: + if re.search('://', src): + externalimages.append(src) + else: + imagefull =3D os.path.normpath(os.path.join(dirname, src)) + images.append((imagefull, docname)) + + return (anchors, targets, images) def process_all(filelist): anchors =3D [] targets =3D [] + images =3D [] for file in filelist: - anchor, target =3D process_file(file) + anchor, target, image =3D process_file(file) targets =3D targets + target anchors =3D anchors + anchor + images =3D images + image - return (targets, anchors) + return (targets, anchors, images) def check_targets(targets, anchors): @@ -163,6 +184,46 @@ def check_usage(targets, files, entrypoint): return fail +# checks that images present in the directory are being used and also that +# pages link to existing images. For favicons, which are not referenced fr= om +# the '.html' files there's a builtin set of exceptions. +def check_images(usedimages, imagefiles, ignoreimages): + favicons =3D [ + 'android-chrome-192x192.png', + 'android-chrome-256x256.png', + 'apple-touch-icon.png', + 'favicon-16x16.png', + 'favicon-32x32.png', + 'mstile-150x150.png', + ] + fail =3D False + + if ignoreimages: + favicons =3D favicons + ignoreimages + + for usedimage, docname in usedimages: + if usedimage not in imagefiles: + print(f'ERROR: \'{docname}\' references image \'{usedimage}\' = not among images') + fail =3D True + + for imagefile in imagefiles: + used =3D False + + if imagefile in (usedimage[0] for usedimage in usedimages): + used =3D True + else: + for favicon in favicons: + if favicon in imagefile: + used =3D True + break + + if not used: + print(f'ERROR: Image \'{imagefile}\' is not used by any page') + fail =3D True + + return fail + + parser =3D argparse.ArgumentParser(description=3D'HTML reference checker') parser.add_argument('--webroot', required=3DTrue, help=3D'path to the web root') @@ -170,14 +231,16 @@ parser.add_argument('--entrypoint', default=3D"index.= html", help=3D'file name of web entry point relative to --web= root') parser.add_argument('--external', action=3D"store_true", help=3D'print external references instead') +parser.add_argument('--ignore-images', action=3D'append', + help=3D'paths to images that should be considered as u= sed') args =3D parser.parse_args() -files =3D get_file_list(os.path.abspath(args.webroot)) +files, imagefiles =3D get_file_list(os.path.abspath(args.webroot)) entrypoint =3D os.path.join(os.path.abspath(args.webroot), args.entrypoint) -targets, anchors =3D process_all(files) +targets, anchors, usedimages =3D process_all(files) fail =3D False @@ -186,7 +249,14 @@ if args.external: externallinks.sort() for ext in externallinks: if ext !=3D prev: - print(ext) + print(f'link: {ext}') + + prev =3D ext + + externalimages.sort() + for ext in externalimages: + if ext !=3D prev: + print(f'image: {ext}') prev =3D ext else: @@ -196,6 +266,9 @@ else: if check_usage(targets, files, entrypoint): fail =3D True + if check_images(usedimages, imagefiles, args.ignore_images): + fail =3D True + if fail: sys.exit(1) --=20 2.39.1