[libvirt] [PATCH 16/17] docs: convert virkeycode*/virkeyname* man pages from pod to rst

Daniel P. Berrangé posted 17 patches 4 years, 11 months ago
[libvirt] [PATCH 16/17] docs: convert virkeycode*/virkeyname* man pages from pod to rst
Posted by Daniel P. Berrangé 4 years, 11 months ago
The keycodemap tool is told to generate docs in rst format now
instead of pod.

Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
 docs/Makefile.am         | 30 ++++++++++++++++++++++++++++
 docs/manpages/index.rst  | 16 +++++++++++++++
 src/util/Makefile.inc.am | 43 +---------------------------------------
 3 files changed, 47 insertions(+), 42 deletions(-)

diff --git a/docs/Makefile.am b/docs/Makefile.am
index fad506539b..e1f8f7646d 100644
--- a/docs/Makefile.am
+++ b/docs/Makefile.am
@@ -197,6 +197,10 @@ kbase_html = \
 kbasedir = $(HTML_DIR)/kbase
 kbase_DATA = $(kbase_html)
 
+# Sync with src/util/
+KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum
+KEYNAMES = linux osx win32
+
 manpages_rst = \
   manpages/index.rst \
   $(NULL)
@@ -207,6 +211,8 @@ manpages1_rst = \
   manpages/virsh.rst \
   $(NULL)
 manpages7_rst = \
+  $(KEYCODES:%=manpages/virkeycode-%.rst) \
+  $(KEYNAMES:%=manpages/virkeyname-%.rst) \
   $(NULL)
 manpages8_rst = \
   manpages/virt-sanlock-cleanup.rst \
@@ -269,6 +275,29 @@ man8_MANS = $(manpages8_rst:%.rst=%.8)
 	       -e 's|RUNSTATEDIR|$(runstatedir)|g' | \
 	   $(RST2MAN) > $@
 
+manpages/virkeycode-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \
+		$(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am
+	$(AM_V_GEN)export NAME=`echo $@ | \
+		sed -e 's,manpages/virkeycode-,,' -e 's,\.rst,,'` && \
+		$(MKDIR_P) manpages/ && \
+		$(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \
+		code-docs \
+		--lang rst \
+		--title "virkeycode-$$NAME" \
+		--subtitle "Key code values for $$NAME" \
+		$(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@
+
+manpages/virkeyname-%.rst: $(top_srcdir)/src/keycodemapdb/data/keymaps.csv \
+		$(top_srcdir)/src/keycodemapdb/tools/keymap-gen Makefile.am
+	$(AM_V_GEN)export NAME=`echo $@ | \
+		sed -e 's,manpages/virkeyname-,,' -e 's,\.rst,,'` && \
+		$(MKDIR_P) manpages/ && \
+		$(RUNUTF8) $(PYTHON) $(top_srcdir)/src/keycodemapdb/tools/keymap-gen \
+		name-docs \
+		--lang rst \
+		--title "virkeyname-$$NAME" \
+		--subtitle "Key name values for $$NAME" \
+		$(top_srcdir)/src/keycodemapdb/data/keymaps.csv $$NAME > $@
 
 manpagesdir = $(HTML_DIR)/manpages
 manpages_DATA = $(manpages_html)
@@ -342,6 +371,7 @@ CLEANFILES = \
   $(manpages_html) \
   $(man1_MANS) \
   $(man7_MANS) \
+  $(manpages7_rst) \
   $(man8_MANS) \
   $(api_DATA) \
   $(dot_html_generated_in) \
diff --git a/docs/manpages/index.rst b/docs/manpages/index.rst
index 1041dbf8b4..4945ad59e2 100644
--- a/docs/manpages/index.rst
+++ b/docs/manpages/index.rst
@@ -19,3 +19,19 @@ Tools
 * `virt-login-shell(1) <virt-login-shell.html>`__ - tool to execute a shell within a container
 * `virt-admin(1) <virt-admin.html>`__ - daemon administration interface
 * `virsh(1) <virsh.html>`__ - management user interface
+
+Key codes
+=========
+
+* `virkeycode-atset1 <virkeycode-atset1.html>`__ - atset1 keycodes
+* `virkeycode-atset2 <virkeycode-atset2.html>`__ - atset2 keycodes
+* `virkeycode-atset3 <virkeycode-atset3.html>`__ - atset3 keycodes
+* `virkeycode-linux <virkeycode-linux.html>`__ - linux keycodes
+* `virkeycode-qnum <virkeycode-qnum.html>`__ - qnmum keycodes
+* `virkeycode-osx <virkeycode-osx.html>`__ - osx keycodes
+* `virkeycode-usb <virkeycode-usb.html>`__ - usb keycodes
+* `virkeycode-win32 <virkeycode-win32.html>`__ - win32 keycodes
+* `virkeycode-xtkbd <virkeycode-xtkbd.html>`__ - xtkbd keycodes
+* `virkeyname-linux <virkeyname-linux.html>`__ - keycodes
+* `virkeyname-osx <virkeyname-osx.html>`__ - osx keynames
+* `virkeyname-win32 <virkeyname-win32.html>`__ - win32 keynames
diff --git a/src/util/Makefile.inc.am b/src/util/Makefile.inc.am
index ec10e53606..459378b264 100644
--- a/src/util/Makefile.inc.am
+++ b/src/util/Makefile.inc.am
@@ -242,7 +242,7 @@ EXTRA_DIST += \
 	$(srcdir)/keycodemapdb/tools/keymap-gen \
 	$(NULL)
 
-
+# Sync with docs/
 KEYCODES = linux osx atset1 atset2 atset3 xtkbd usb win32 qnum
 KEYNAMES = linux osx win32
 
@@ -251,15 +251,8 @@ KEYTABLES = \
 	$(KEYNAMES:%=util/virkeynametable_%.h) \
 	$(NULL)
 
-KEYPODS = $(KEYCODES:%=util/virkeycode-%.pod) \
-	  $(KEYNAMES:%=util/virkeyname-%.pod)
-KEYMANS = $(KEYPODS:%.pod=%.7)
-
-man7_MANS += $(KEYMANS)
-
 BUILT_SOURCES += $(KEYTABLES)
 CLEANFILES += $(KEYTABLES)
-CLEANFILES += $(KEYMANS) $(KEYPODS)
 
 UTIL_IO_HELPER_SOURCES = util/iohelper.c
 
@@ -323,37 +316,3 @@ util/virkeynametable_%.h: $(srcdir)/keycodemapdb/data/keymaps.csv \
 			name-table --lang stdc --varname virKeyNameTable_$$NAME \
 			$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > $@-tmp && \
 		mv $@-tmp $@ || rm -f $@-tmp
-
-util/virkeycode-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
-			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
-	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeycode-,,' \
-					      -e 's,\.pod,,'` && \
-		$(MKDIR_P) util/ && \
-		$(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
-		code-docs --lang pod \
-		--title "virkeycode-$$NAME" \
-		--subtitle "Key code values for $$NAME" \
-		$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
-			$@-tmp && mv $@-tmp $@ || rm $@-tmp
-
-util/virkeyname-%.pod: $(srcdir)/keycodemapdb/data/keymaps.csv \
-			$(srcdir)/keycodemapdb/tools/keymap-gen Makefile.am
-	$(AM_V_GEN)export NAME=`echo $@ | sed -e 's,util/virkeyname-,,' \
-					      -e 's,\.pod,,'` && \
-		$(MKDIR_P) util/ && \
-		$(RUNUTF8) $(PYTHON) $(srcdir)/keycodemapdb/tools/keymap-gen \
-		name-docs --lang pod \
-		--title "virkeyname-$$NAME" \
-		--subtitle "Key name values for $$NAME" \
-		$(srcdir)/keycodemapdb/data/keymaps.csv $$NAME > \
-			$@-tmp && mv $@-tmp $@ || rm $@-tmp
-
-util/virkey%.7: util/virkey%.pod
-	$(AM_V_GEN)$(POD2MAN) --section=7 $< $@-t1 && \
-	if grep 'POD ERROR' $@-t1; then rm $@-t1; exit 1; fi && \
-	sed \
-		-e 's|SYSCONFDIR|\@sysconfdir\@|g' \
-		-e 's|LOCALSTATEDIR|\@localstatedir\@|g' \
-		< $@-t1 > $@-t2 && \
-	rm -f $@-t1 && \
-	mv $@-t2 $@
-- 
2.23.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list