From nobody Mon May 6 07:14:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1596466026; cv=none; d=zohomail.com; s=zohoarc; b=En7kKqKZ2PkxJBl1mnlIelm4oCLeBIxwyodweUeE23k2r4oaHdoCV5WEC59oBoBEQKsY3GSVZrwJ2d9ro8VyeVxQbG0nK3IwUYUzJOJe/D6tADee0E9qdD0a7pkJMyl2ebAQH3aVj8/JDJAt2HFGeemQZssAKhVBUozLzyAqFfA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596466026; 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=9UJYq5zxrZnaR+/Y2NbGPnAvPA/hud49AoMNXD6fucQ=; b=LxmgczaTMobMY6AMvryc+A8/V1EZcaf6XuAvkiXvnkNbS5vhewPq9l0aJHiCFaDV3qc9Mmhi387mJH5RNW2chZ8DhGOdMHYstUqqfl2H+u2lhp5EsHu8hZNCIxZIhMBeXxwd/Gj2o45q1t5POA3tWHpXEada7p+Y61+xbU6TbCE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-2.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 159646602699020.53093331798084; Mon, 3 Aug 2020 07:47:06 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-239-xavt1GryNhamQyE9t3RsOw-1; Mon, 03 Aug 2020 10:47:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5EB46100AA21; Mon, 3 Aug 2020 14:46:55 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1DEA95DA6A; Mon, 3 Aug 2020 14:46:55 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 06D881809554; Mon, 3 Aug 2020 14:46:54 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 073Eka4r024328 for ; Mon, 3 Aug 2020 10:46:36 -0400 Received: by smtp.corp.redhat.com (Postfix) id 77DA48BED8; Mon, 3 Aug 2020 14:46:36 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id D46688BED5 for ; Mon, 3 Aug 2020 14:46:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596466025; 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=9UJYq5zxrZnaR+/Y2NbGPnAvPA/hud49AoMNXD6fucQ=; b=iGDL8CJIZjgfMcqs1xejC0oRB928dY/8sVrcQLMaPqduDBSJG2SMypid2Jj+/DFd9QQhFw 1BLiKJbwrG+xbqBbz8hUB4aRivmgGwTByw1dyl12y0UTDPZjtxgRGEsI/V6S/eFjvpG4Fs 8hPJUFCniZNLDjmkGDRe1u7PejWl1eY= X-MC-Unique: xavt1GryNhamQyE9t3RsOw-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 1/2] docs: meson: Simplify generation of html files Date: Mon, 3 Aug 2020 16:46:29 +0200 Message-Id: <22c4e7c817370ddc1833b03a0a68777bda66e3b4.1596465830.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" Just convert 'docs_html_in_files' into 'docs_html_in_gen'. The target definitions for those were almost the same. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/meson.build | 47 ++++++++++++++--------------------------------- 1 file changed, 14 insertions(+), 33 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index 2f06e8eace..e81251f29d 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -192,49 +192,29 @@ docs_rst2html_gen =3D generator( capture: true, ) -foreach name : docs_html_in_files - html_in_file =3D '@0@.html.in'.format(name) - html_file =3D '@0@.html'.format(name) - - out_file =3D custom_target( - html_file, - input: html_in_file, - output: html_file, - command: [ - meson_python_prog, - python3_prog.path(), - meson_html_gen_prog.path(), - xsltproc_prog.path(), - xmllint_prog.path(), - meson.build_root(), - docs_timestamp, - site_xsl, - '@INPUT@', - '@OUTPUT@', - html_in_file, - ], - depends: [ aclperms_gen ], - depend_files: [ page_xsl ], - install: true, - install_dir: docs_html_dir, - ) - - install_web_deps +=3D out_file - install_web_files +=3D '@0@:@1@'.format(out_file.full_path(), docs_html_= dir) -endforeach - # docs_html_in_gen: # each entry is a dictionary with following items: # name - base file name (required) # file - generated file (required) +# source - source filename (required) docs_html_in_gen =3D [] +foreach name : docs_html_in_files + html_in_file =3D '@0@.html.in'.format(name) + docs_html_in_gen +=3D { + 'name': name, + 'file': html_in_file, + 'source': html_in_file, + } +endforeach + foreach name : docs_rst_files rst_file =3D '@0@.rst'.format(name) docs_html_in_gen +=3D { 'name': name, 'file': docs_rst2html_gen.process(rst_file), + 'source': rst_file, } endforeach @@ -262,17 +242,18 @@ hvsupport_html_in =3D custom_target( docs_html_in_gen +=3D { 'name': 'hvsupport', 'file': hvsupport_html_in, + 'source': 'hvsupport.html.in', } news_html_in =3D docs_rst2html_gen.process(meson.source_root() / 'NEWS.rst= ') docs_html_in_gen +=3D { 'name': 'news', 'file': news_html_in, + 'source': 'NEWS.rst', } foreach data : docs_html_in_gen html_file =3D '@0@.html'.format(data['name']) - rst_in_file =3D '@0@.rst'.format(data['name']) out_file =3D custom_target( html_file, @@ -289,7 +270,7 @@ foreach data : docs_html_in_gen site_xsl, '@INPUT@', '@OUTPUT@', - rst_in_file, + data['source'], ], depends: [ aclperms_gen ], depend_files: [ page_xsl ], --=20 2.26.2 From nobody Mon May 6 07:14:35 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) client-ip=207.211.31.81; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-1.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 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=1596466028; cv=none; d=zohomail.com; s=zohoarc; b=BoFxUXObog+TEfvaiTZWdSYqaPU8u0NYp54dlTEllYZkaxrWXluVI5g59KLF1oCNawsPP8LD9jX8BYWsWUqlIjF8u7OfrQiZQQrnLg8RiZ3h0gTGu69bzY597k/jRy8CCHMkOj6dmqoUZsyFqPmDtbrQekhTWR/6Ix5KMRXFNSc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1596466028; 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=bz6UsTVlcDz78hI2vUAfJUBgEp8+tjobL7VZrmJUuBc=; b=d6QfPHyjoqzh3dIoLHCdsU5piPlLA0C25YcL4DuZJHGyUxXSUxL2N+ioMPS+Tws0w0j21Lg1doYvZjgUeCrtxTZFTs68JqnlfVXI1LocWVEKrR5X/pYWZgwdNrzrgPycVRZ78ryVOt5C4WyAkMxpZ+POC298SNqiTmj4bPHY+qU= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 207.211.31.81 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.81]) by mx.zohomail.com with SMTPS id 1596466028258357.6269867978567; Mon, 3 Aug 2020 07:47:08 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-23-2J2klH43PBGyFzAFHOfxYQ-1; Mon, 03 Aug 2020 10:47:04 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id DB8D1100AA22; Mon, 3 Aug 2020 14:46:58 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BDCF25F9DC; Mon, 3 Aug 2020 14:46:58 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 842141809563; Mon, 3 Aug 2020 14:46:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 073Ekbs3024334 for ; Mon, 3 Aug 2020 10:46:37 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8A38F8BED8; Mon, 3 Aug 2020 14:46:37 +0000 (UTC) Received: from speedmetal.redhat.com (unknown [10.40.208.38]) by smtp.corp.redhat.com (Postfix) with ESMTP id D8D3C8BED5 for ; Mon, 3 Aug 2020 14:46:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1596466027; 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=bz6UsTVlcDz78hI2vUAfJUBgEp8+tjobL7VZrmJUuBc=; b=Yoo50KFOqXGGlexgD6MJ/KODYt3cVtU7GGKlMRQ5a5PPcScloiaBWcq/RbEZlCG9qbipKM 8gRwGhVEPDvq4QDF2525WIVF3dRpevb5vLlMsm5MMDYxp37oPWzHgU83sNU4JZ0mmSWZV2 HHo4RGJnBG29CPm9Ii20xFoXXWq3B24= X-MC-Unique: 2J2klH43PBGyFzAFHOfxYQ-1 From: Peter Krempa To: libvir-list@redhat.com Subject: [PATCH 2/2] docs: build: Use proper path to file in 'contribute' link Date: Mon, 3 Aug 2020 16:46:30 +0200 Message-Id: <9944fb013cafa985c00c998cde143a390ffe9ecb.1596465830.git.pkrempa@redhat.com> In-Reply-To: References: MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) Content-Type: text/plain; charset="utf-8" NEWS.xsl is based in the root of the repository and 'hvsupport.html' doesn't have a backing file which can be edited since it's fully generated. Our 'contribute -> edit this page' link on the bottom of the page is wrong in those cases. Fix it by adding the contribute section only when there's a source and base the 'source' of a html file in the root of the repository. Along with that we need to modify the scripts/meson-html-gen.py script to accept optional 'pagesrc' and the XSL template to skip the 'contribute' section when we don't have a source. Signed-off-by: Peter Krempa Reviewed-by: J=C3=A1n Tomko --- docs/meson.build | 9 ++++----- docs/page.xsl | 14 ++++++++------ scripts/meson-html-gen.py | 2 +- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/meson.build b/docs/meson.build index e81251f29d..aaa3040598 100644 --- a/docs/meson.build +++ b/docs/meson.build @@ -197,7 +197,7 @@ docs_rst2html_gen =3D generator( # each entry is a dictionary with following items: # name - base file name (required) # file - generated file (required) -# source - source filename (required) +# source - source filename relative to repository root (optional, if there= is no source) docs_html_in_gen =3D [] foreach name : docs_html_in_files @@ -205,7 +205,7 @@ foreach name : docs_html_in_files docs_html_in_gen +=3D { 'name': name, 'file': html_in_file, - 'source': html_in_file, + 'source': 'docs' / html_in_file, } endforeach @@ -214,7 +214,7 @@ foreach name : docs_rst_files docs_html_in_gen +=3D { 'name': name, 'file': docs_rst2html_gen.process(rst_file), - 'source': rst_file, + 'source': 'docs' / rst_file, } endforeach @@ -242,7 +242,6 @@ hvsupport_html_in =3D custom_target( docs_html_in_gen +=3D { 'name': 'hvsupport', 'file': hvsupport_html_in, - 'source': 'hvsupport.html.in', } news_html_in =3D docs_rst2html_gen.process(meson.source_root() / 'NEWS.rst= ') @@ -270,7 +269,7 @@ foreach data : docs_html_in_gen site_xsl, '@INPUT@', '@OUTPUT@', - data['source'], + data.get('source', []), ], depends: [ aclperms_gen ], depend_files: [ page_xsl ], diff --git a/docs/page.xsl b/docs/page.xsl index 6923871400..bdd57ba2e0 100644 --- a/docs/page.xsl +++ b/docs/page.xsl @@ -166,12 +166,14 @@
  • serverfault
  • -
    -

    Contribute

    - -
    + +
    +

    Contribute

    + +
    +
    Participants in the libvirt project agree to abide by the project code of conduct<= /a>
    diff --git a/scripts/meson-html-gen.py b/scripts/meson-html-gen.py index 08041f14ec..dbf238de54 100755 --- a/scripts/meson-html-gen.py +++ b/scripts/meson-html-gen.py @@ -12,7 +12,7 @@ parser.add_argument("timestamp", type=3Dstr, help=3D"docs= timestamp") parser.add_argument("style", type=3Dstr, help=3D"XSL stile file") parser.add_argument("infile", type=3Dstr, help=3D"path to source HTML file= ") parser.add_argument("htmlfile", type=3Dstr, help=3D"path to generated HTML= file") -parser.add_argument("pagesrc", type=3Dstr, help=3D"path to source file use= d for edit this page") +parser.add_argument("pagesrc", type=3Dstr, default=3D"", nargs=3D'?', help= =3D"(optional) path to source file used for edit this page") args =3D parser.parse_args() name =3D os.path.basename(args.htmlfile).replace('.html', '') --=20 2.26.2