From nobody Tue Jan 7 08:33:51 2025 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=1684337410; cv=none; d=zohomail.com; s=zohoarc; b=IEP/kv2aHE8Owxpwy6m4cDf+rWJI4lcMylsrIlt5fFA2TVl8ZOLz9PoUZnzdXpr+2RI6soS3RlzSkKCgpHeiQgy1ihleQso7ZxF01PCDPJFLSFeRPBpAZ60BjuWt1TqIICNShruyhSM0IzY7qdcqdLQtCtceuRIpJtEVLPKusP8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684337410; 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=g3jlnjKjYfFORCbQpfuGRyoKk+X1SQb1LSZrKxWDY70=; b=KhHNZ/Vv1mhikO/wtlBSaeZAtapnWfQY43zVnt20A2C3sjvfU3GDAcE7uJ2dk9ZV2O961WTM6Z58jSqDbIhO3K3QMsAwg6iXnD7gbYhq4UrOrSqHsi1OnqzIxtUxmUKC8mCSNBrALModQdUipGeF14KY6lR2tLNK82wNGmVnhSE= 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=<pkrempa@redhat.com> (p=none dis=none) Return-Path: <libvir-list-bounces@redhat.com> 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 1684337410055275.99402550687887; Wed, 17 May 2023 08:30:10 -0700 (PDT) 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-553-X3YajDxjPwKYXa8VFNPZ0w-1; Wed, 17 May 2023 11:28:51 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7B84D2814260; Wed, 17 May 2023 15:28: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 2AE1C1121318; Wed, 17 May 2023 15:28: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 EF36419465A8; Wed, 17 May 2023 15:28:29 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id BBBBB19465B2 for <libvir-list@listman.corp.redhat.com>; Wed, 17 May 2023 15:28:28 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id B0A25C15BA0; Wed, 17 May 2023 15:28:28 +0000 (UTC) Received: from speedmetal.lan (unknown [10.45.242.22]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2DF2EC16044 for <libvir-list@redhat.com>; Wed, 17 May 2023 15:28:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684337409; 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=g3jlnjKjYfFORCbQpfuGRyoKk+X1SQb1LSZrKxWDY70=; b=W63/dcbTK+q18fuKR8HKoqaXFH7VveTcEs0z+BCq2LXapMU9iA4pM8IXVdYH1dnOam+IqE wpdHggNaQNv3mrH4HNpS/QuTiiB6nJwqdag4hcJ5MwnVqQv2d3hya+aa3CKK3ws0xW6k2+ kFlWU/q/V6LIvXqTLbguIvvF9mS3YOA= X-MC-Unique: X3YajDxjPwKYXa8VFNPZ0w-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Peter Krempa <pkrempa@redhat.com> To: libvir-list@redhat.com Subject: [PATCH 7/7] docs: xsl: Simplify templating XSL Date: Wed, 17 May 2023 17:28:21 +0200 Message-Id: <2b25d6bf46f3ea3c7b0c2a1981df2b2770831759.1684336381.git.pkrempa@redhat.com> In-Reply-To: <cover.1684336381.git.pkrempa@redhat.com> References: <cover.1684336381.git.pkrempa@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools <libvir-list.redhat.com> List-Unsubscribe: <https://listman.redhat.com/mailman/options/libvir-list>, <mailto:libvir-list-request@redhat.com?subject=unsubscribe> List-Archive: <http://listman.redhat.com/archives/libvir-list/> List-Post: <mailto:libvir-list@redhat.com> List-Help: <mailto:libvir-list-request@redhat.com?subject=help> List-Subscribe: <https://listman.redhat.com/mailman/listinfo/libvir-list>, <mailto:libvir-list-request@redhat.com?subject=subscribe> Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" <libvir-list-bounces@redhat.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 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: 1684337410797100001 Content-Type: text/plain; charset="utf-8" Wrap the auto-generated pages (API ref and hvsupport.html) in the proper top level element similarly to what the pages generated from RST have to remove the extra case when templating our web. (Best viewed with 'git show -w') Signed-off-by: Peter Krempa <pkrempa@redhat.com> --- docs/newapi.xsl | 86 ++++++++++++++++++++++---------------------- docs/page.xsl | 11 ------ scripts/hvsupport.py | 5 +-- 3 files changed, 47 insertions(+), 55 deletions(-) diff --git a/docs/newapi.xsl b/docs/newapi.xsl index cc683707cf..a8797f800d 100644 --- a/docs/newapi.xsl +++ b/docs/newapi.xsl @@ -733,54 +733,56 @@ </xsl:text> <html> <body> - <h1><xsl:value-of select=3D"$title"/></h1> - <xsl:call-template name=3D"description"/> - <h2>Table of Contents</h2> - <xsl:if test=3D"count(exports[@type=3D'macro']) > 0"> - <h3><a href=3D"#macros">Macros</a></h3> - <pre class=3D"api"> - <xsl:apply-templates select=3D"exports[@type=3D'macro']" mode= =3D"toc"> + <div class=3D"document"> + <h1><xsl:value-of select=3D"$title"/></h1> + <xsl:call-template name=3D"description"/> + <h2>Table of Contents</h2> + <xsl:if test=3D"count(exports[@type=3D'macro']) > 0"> + <h3><a href=3D"#macros">Macros</a></h3> + <pre class=3D"api"> + <xsl:apply-templates select=3D"exports[@type=3D'macro']" mod= e=3D"toc"> + <xsl:sort select=3D'@symbol'/> + </xsl:apply-templates> + </pre> + </xsl:if> + <xsl:if test=3D"count(exports[@type=3D'typedef']) > 0"> + <h3><a href=3D"#types">Types</a></h3> + <pre class=3D"api"> + <xsl:apply-templates select=3D"exports[@type=3D'typedef']" m= ode=3D"toc"> + <xsl:sort select=3D'@symbol'/> + </xsl:apply-templates> + </pre> + </xsl:if> + <xsl:if test=3D"count(exports[@type=3D'function']) > 0"> + <h3><a href=3D"#functions">Functions</a></h3> + <pre class=3D"api"> + <xsl:apply-templates select=3D"exports[@type=3D'function']" = mode=3D"toc"> + <xsl:sort select=3D'@symbol'/> + </xsl:apply-templates> + </pre> + </xsl:if> + + <h2>Description</h2> + + <xsl:if test=3D"count(exports[@type=3D'macro']) > 0"> + <h3><a id=3D"macros">Macros</a></h3> + <xsl:apply-templates select=3D"exports[@type=3D'macro']"> <xsl:sort select=3D'@symbol'/> </xsl:apply-templates> - </pre> - </xsl:if> - <xsl:if test=3D"count(exports[@type=3D'typedef']) > 0"> - <h3><a href=3D"#types">Types</a></h3> - <pre class=3D"api"> - <xsl:apply-templates select=3D"exports[@type=3D'typedef']" mod= e=3D"toc"> + </xsl:if> + <xsl:if test=3D"count(exports[@type=3D'typedef']) > 0"> + <h3><a id=3D"types">Types</a></h3> + <xsl:apply-templates select=3D"exports[@type=3D'typedef']"> <xsl:sort select=3D'@symbol'/> </xsl:apply-templates> - </pre> - </xsl:if> - <xsl:if test=3D"count(exports[@type=3D'function']) > 0"> - <h3><a href=3D"#functions">Functions</a></h3> - <pre class=3D"api"> - <xsl:apply-templates select=3D"exports[@type=3D'function']" mo= de=3D"toc"> + </xsl:if> + <xsl:if test=3D"count(exports[@type=3D'function']) > 0"> + <h3><a id=3D"functions">Functions</a></h3> + <xsl:apply-templates select=3D"exports[@type=3D'function']"> <xsl:sort select=3D'@symbol'/> </xsl:apply-templates> - </pre> - </xsl:if> - - <h2>Description</h2> - - <xsl:if test=3D"count(exports[@type=3D'macro']) > 0"> - <h3><a id=3D"macros">Macros</a></h3> - <xsl:apply-templates select=3D"exports[@type=3D'macro']"> - <xsl:sort select=3D'@symbol'/> - </xsl:apply-templates> - </xsl:if> - <xsl:if test=3D"count(exports[@type=3D'typedef']) > 0"> - <h3><a id=3D"types">Types</a></h3> - <xsl:apply-templates select=3D"exports[@type=3D'typedef']"> - <xsl:sort select=3D'@symbol'/> - </xsl:apply-templates> - </xsl:if> - <xsl:if test=3D"count(exports[@type=3D'function']) > 0"> - <h3><a id=3D"functions">Functions</a></h3> - <xsl:apply-templates select=3D"exports[@type=3D'function']"> - <xsl:sort select=3D'@symbol'/> - </xsl:apply-templates> - </xsl:if> + </xsl:if> + </div> </body> </html> </xsl:template> diff --git a/docs/page.xsl b/docs/page.xsl index a93f24fb09..c92ceffec7 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -73,17 +73,6 @@ <xsl:when test=3D"html:html/html:body/html:main"> <xsl:apply-templates select=3D"/html:html/html:body/*" mode= =3D"content"/> </xsl:when> - <!-- for our older html-only files --> - <xsl:otherwise> - <div class=3D"document"> - <xsl:if test=3D"html:html/html:body/@id"> - <xsl:attribute name=3D"id"> - <xsl:value-of select=3D"html:html/html:body/@id"/> - </xsl:attribute> - </xsl:if> - <xsl:apply-templates select=3D"/html:html/html:body/*" mod= e=3D"content"/> - </div> - </xsl:otherwise> </xsl:choose> </div> <div id=3D"nav"> diff --git a/scripts/hvsupport.py b/scripts/hvsupport.py index df1122e123..be6bf7b0d2 100755 --- a/scripts/hvsupport.py +++ b/scripts/hvsupport.py @@ -450,7 +450,8 @@ for drv in list(drivers.keys()): print('''<?xml version=3D"1.0" encoding=3D"UTF-8"?> <!DOCTYPE html> <html xmlns=3D"http://www.w3.org/1999/xhtml"> -<body id=3D"hvsupport"> +<body> +<div id=3D"hvsupport" class=3D"document"> <h1>libvirt API support matrix</h1> <nav class=3D"contents" id=3D"contents"> @@ -536,4 +537,4 @@ for grp in sorted(groups.keys()): print("</tbody>\n</table>") -print("</body>\n</html>") +print("</div>\n</body>\n</html>") --=20 2.40.1