From nobody Sun Feb 8 05:07:28 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 205.139.110.61 as permitted sender) client-ip=205.139.110.61; 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 205.139.110.61 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=1574434051; cv=none; d=zohomail.com; s=zohoarc; b=PPh6ABkz+AhrU9K63WqzrUc8pJjWUCUM3IkPYn73bzoIRvx8B2cSAk7Kr5fMFqmtqYa//+kKOmVFpa8qF+l5F1QloIxjn8q7tJiV7JnWFySPWQ/he9rSxLBVM8qioiieuByHt9H9ZCZebVYdl4a9+809rQWxxau/iqTkBiyCFXg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1574434051; 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=Ix9YVtjPSWAlqmKH0BRfZrvVMRXgIKnoj1vxeYVvHvc=; b=NT9hirtxTj+gBi9qo9Abylab0thx8viHm4xaJads8Wpl0gQ3dx3xhFhvQ67Qe9xTQQWmykO6QHKq6YGsZkrr0vPA4FK9lnBfj6mM98YnqGDCo7zVvxzBpFccbsoih9FeJYLgjKEADb+iPq+/Ca3mShEo4wV0NWpB0MlDfMhjywg= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 205.139.110.61 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 [205.139.110.61]) by mx.zohomail.com with SMTPS id 1574434051908930.6182812284491; Fri, 22 Nov 2019 06:47:31 -0800 (PST) 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-428-XW4MuxBIMzeCarZBatqh6w-1; Fri, 22 Nov 2019 09:47:26 -0500 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id A9509107ACCA; Fri, 22 Nov 2019 14:47:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 7132F2AAB1; Fri, 22 Nov 2019 14:47:20 +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 E27AE4E562; Fri, 22 Nov 2019 14:47:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id xAMElHlZ017864 for ; Fri, 22 Nov 2019 09:47:17 -0500 Received: by smtp.corp.redhat.com (Postfix) id B63831036C83; Fri, 22 Nov 2019 14:47:17 +0000 (UTC) Received: from localhost.localdomain.com (ovpn-112-49.ams2.redhat.com [10.36.112.49]) by smtp.corp.redhat.com (Postfix) with ESMTP id 084BF1036C7E; Fri, 22 Nov 2019 14:47:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574434050; 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=Ix9YVtjPSWAlqmKH0BRfZrvVMRXgIKnoj1vxeYVvHvc=; b=MfuVXQv9F5jTAS+J4y5NEvlcul2CjN9+IPkpLxua4GHM4CtUK8iodWrY+i8wdl1vSGxXkk VTTLpZCVdG2Wwu27FF02fB7r782geloXHk2oUMpdpaHmc0SM3YCZly3epQCk73tTSNewAA 7SXfWjPnpKlrkvugtPkWeIntT9rsnBE= From: =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= To: libvir-list@redhat.com Date: Fri, 22 Nov 2019 14:46:50 +0000 Message-Id: <20191122144702.3780548-4-berrange@redhat.com> In-Reply-To: <20191122144702.3780548-1-berrange@redhat.com> References: <20191122144702.3780548-1-berrange@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH v2 03/15] docs: introduce rst2html as a mandatory tool for building docs 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.84 on 10.5.11.23 X-MC-Unique: XW4MuxBIMzeCarZBatqh6w-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) The rst2html tool is provided by python docutils, and as the name suggests, it converts RST documents into HTML. Basic rules are added for integrating RST docs into the website build process. This enables us to start writing docs on our website in RST format instead of HTML, without changing the rest of our website templating system away from XSLT yet. Signed-off-by: Daniel P. Berrang=C3=A9 --- docs/Makefile.am | 33 +++++++++++++++++++++++++++------ libvirt.spec.in | 2 ++ m4/virt-external-programs.m4 | 5 +++++ mingw-libvirt.spec.in | 1 + 4 files changed, 35 insertions(+), 6 deletions(-) diff --git a/docs/Makefile.am b/docs/Makefile.am index 2a104bc837..7a8adbde2b 100644 --- a/docs/Makefile.am +++ b/docs/Makefile.am @@ -173,14 +173,26 @@ gif =3D \ =20 internals_html_in =3D \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/internals/*.html.in)) -internals_html =3D $(internals_html_in:%.html.in=3D%.html) +kbase_rst =3D \ + $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.rst)) +kbase_rst_html_in =3D \ + $(kbase_rst:%.rst=3D%.html.in) +internals_html =3D \ + $(internals_html_in:%.html.in=3D%.html) \ + $(internals_rst_html_in:%.html.in=3D%.html) =20 internalsdir =3D $(HTML_DIR)/internals internals_DATA =3D $(internals_html) =20 kbase_html_in =3D \ $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.html.in)) -kbase_html =3D $(kbase_html_in:%.html.in=3D%.html) +kbase_rst =3D \ + $(patsubst $(srcdir)/%,%,$(wildcard $(srcdir)/kbase/*.rst)) +kbase_rst_html_in =3D \ + $(kbase_rst:%.rst=3D%.html.in) +kbase_html =3D \ + $(kbase_html_in:%.html.in=3D%.html) \ + $(kbase_rst_html_in:%.html.in=3D%.html) =20 kbasedir =3D $(HTML_DIR)/kbase kbase_DATA =3D $(kbase_html) @@ -191,9 +203,14 @@ dot_html_generated_in =3D \ news.html.in dot_html_in =3D \ $(notdir $(wildcard $(srcdir)/*.html.in)) +dot_rst =3D \ + $(notdir $(wildcard $(srcdir)/*.rst)) +dot_rst_html_in =3D \ + $(dot_rst:%.rst=3D%.html) dot_html =3D \ $(dot_html_generated_in:%.html.in=3D%.html) \ - $(dot_html_in:%.html.in=3D%.html) + $(dot_html_in:%.html.in=3D%.html) \ + $(dot_rst_html_in:%.html.in=3D%.html) =20 htmldir =3D $(HTML_DIR) html_DATA =3D $(css) $(png) $(gif) $(dot_html) @@ -222,11 +239,11 @@ EXTRA_DIST=3D \ apibuild.py genaclperms.pl \ site.xsl subsite.xsl newapi.xsl page.xsl \ wrapstring.xsl \ - $(dot_html_in) $(gif) $(apipng) \ + $(dot_html_in) $(dot_rst) $(gif) $(apipng) \ $(fig) $(png) $(css) \ $(javascript) $(logofiles) \ - $(internals_html_in) $(fonts) \ - $(kbase_html_in) \ + $(internals_html_in) $(internals_rst) $(fonts) \ + $(kbase_html_in) $(kbase_rst) \ aclperms.htmlinc \ hvsupport.pl \ $(schema_DATA) @@ -281,6 +298,10 @@ EXTRA_DIST +=3D \ %.png: %.fig convert -rotate 90 $< $@ =20 +%.html.in: %.rst + $(AM_V_GEN)$(MKDIR_P) `dirname $@` && \ + $(RST2HTML) $< > $@ + %.html.tmp: %.html.in site.xsl subsite.xsl page.xsl \ $(acl_generated) $(AM_V_GEN)name=3D`echo $@ | sed -e 's/.tmp//'`; \ diff --git a/libvirt.spec.in b/libvirt.spec.in index a6219da604..5c47dd3d7c 100644 --- a/libvirt.spec.in +++ b/libvirt.spec.in @@ -265,6 +265,8 @@ BuildRequires: automake BuildRequires: gettext-devel BuildRequires: libtool BuildRequires: /usr/bin/pod2man +# Replace with python3-docutils when we drop py2 support +BuildRequires: /usr/bin/rst2html %endif BuildRequires: gcc BuildRequires: git diff --git a/m4/virt-external-programs.m4 b/m4/virt-external-programs.m4 index 0f995998c3..ed634a4c73 100644 --- a/m4/virt-external-programs.m4 +++ b/m4/virt-external-programs.m4 @@ -33,6 +33,11 @@ AC_DEFUN([LIBVIRT_CHECK_EXTERNAL_PROGRAMS], [ then AC_MSG_ERROR("xsltproc is required to build libvirt") fi + AC_PATH_PROGS([RST2HTML], [rst2html rst2html.py rst2html-3], []) + if test -z "$RST2HTML" + then + AC_MSG_ERROR("rst2html is required to build libvirt") + fi AC_PATH_PROG([AUGPARSE], [augparse], [/usr/bin/augparse]) AC_PROG_MKDIR_P AC_PROG_LN_S diff --git a/mingw-libvirt.spec.in b/mingw-libvirt.spec.in index c29f3eeed2..35f1abc13d 100644 --- a/mingw-libvirt.spec.in +++ b/mingw-libvirt.spec.in @@ -82,6 +82,7 @@ BuildRequires: automake BuildRequires: gettext-devel BuildRequires: libtool %endif +BuildRequires: python3-docutils =20 BuildRequires: mingw32-libssh2 BuildRequires: mingw64-libssh2 --=20 2.23.0 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list