aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2009-11-12 06:38:34 +0100
committerAvatar Ingmar Vanhassel <ingmar@exherbo.org> 2011-02-14 14:24:38 +0000
commit21e4ea2a1dd922dbab3e182b41aa0d4666b0057e (patch)
tree80c390609f167f346e069e01266df850d6c85146
parentab058c01e39001bc66963b054bbd8ad9ea3638c6 (diff)
downloadpaludis-21e4ea2a1dd922dbab3e182b41aa0d4666b0057e.tar.gz
paludis-21e4ea2a1dd922dbab3e182b41aa0d4666b0057e.tar.xz
cave: Generate man-pages using asciidoc
-rw-r--r--.gitignore2
-rw-r--r--src/clients/cave/Makefile.am26
-rw-r--r--src/clients/cave/man_cave.cc6
3 files changed, 25 insertions, 9 deletions
diff --git a/.gitignore b/.gitignore
index 151ed20..91c1079 100644
--- a/.gitignore
+++ b/.gitignore
@@ -493,6 +493,8 @@ paludis-*.*.*.tar.bz2
/src/clients/accerso/accerso
/src/clients/appareo/appareo
/src/clients/cave/cave
+/src/clients/cave/*.txt
+/src/clients/cave/*.xml
/src/clients/instruo/instruo
/stamp-h1
/test/test_fail_TEST
diff --git a/src/clients/cave/Makefile.am b/src/clients/cave/Makefile.am
index 55a4441..4400635 100644
--- a/src/clients/cave/Makefile.am
+++ b/src/clients/cave/Makefile.am
@@ -82,17 +82,23 @@ man_MANS = \
cave.1 \
$(command_MANS)
-cave.1 : man-cave
- env \
- CAVE_FORMATS_CONF="/dev/null" \
- CAVE_COMMANDS_PATH="" \
- ./man-cave > $@
+man_MANS_txts = $(man_MANS:.1=.txt)
+man_MANS_xmls = $(man_MANS_txts:.txt=.xml)
+
+SUFFIXES = .1 .txt .xml
-$(command_MANS) : man-cave
+$(man_MANS_txts) : man-cave
if ! env \
CAVE_FORMATS_CONF="/dev/null" \
CAVE_COMMANDS_PATH="" \
- ./man-cave `echo $@ | sed -e 's.^cave-..' -e 's,\.1$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
+ ./man-cave --asciidoc `echo $@ | sed -e 's.^cave-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
+
+.txt.xml :
+ asciidoc --doctype=manpage --backend=docbook --out-file=$@ $<
+
+.xml.1 :
+ xmlto man $<
+ @: $@
cave_SOURCES = \
cave.cc
@@ -209,7 +215,11 @@ EXTRA_DIST = \
continue_on_failure_TEST_setup.sh continue_on_failure_TEST_cleanup.sh \
moo
-DISTCLEANFILES = $(man_MANS) $(noinst_DATA)
+DISTCLEANFILES = \
+ $(man_MANS) \
+ $(noinst_DATA) \
+ $(man_MANS_txts) \
+ $(man_MANS_xmls)
lib_LTLIBRARIES =
diff --git a/src/clients/cave/man_cave.cc b/src/clients/cave/man_cave.cc
index a7a43d5..db2106d 100644
--- a/src/clients/cave/man_cave.cc
+++ b/src/clients/cave/man_cave.cc
@@ -36,10 +36,12 @@ namespace
paludis::args::ArgsHandler
{
paludis::args::ArgsGroup group;
+ paludis::args::SwitchArg a_asciidoc;
paludis::args::SwitchArg a_html;
ManCommandLine() :
group(main_options_section(), "", ""),
+ a_asciidoc(&group, "asciidoc", '\0', "", false),
a_html(&group, "html", '\0', "", false)
{
}
@@ -68,7 +70,9 @@ main(int argc, char * argv[])
cmdline.run(argc, argv, "", "", "");
std::shared_ptr<paludis::args::DocWriter> w;
- if (cmdline.a_html.specified())
+ if (cmdline.a_asciidoc.specified())
+ w = std::make_shared<paludis::args::AsciidocWriter>(cout);
+ else if (cmdline.a_html.specified())
w = std::make_shared<paludis::args::HtmlWriter>(cout);
else
w = std::make_shared<paludis::args::ManWriter>(cout);