aboutsummaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/appareo/Makefile.am20
-rw-r--r--src/clients/appareo/man_appareo.cc19
2 files changed, 18 insertions, 21 deletions
diff --git a/src/clients/appareo/Makefile.am b/src/clients/appareo/Makefile.am
index ee9da66dc..5c99d4fd9 100644
--- a/src/clients/appareo/Makefile.am
+++ b/src/clients/appareo/Makefile.am
@@ -14,13 +14,14 @@ bin_PROGRAMS = appareo
noinst_PROGRAMS = man-appareo
man_MANS = appareo.1
-SUFFIXES = .1 .txt .xml
+SUFFIXES = .1 .txt .xml .html-man-fragment
man_MANS_txts = appareo.txt
man_MANS_xmls = appareo.xml
+man_MANS_html_man_fragments = appareo.html-man-fragment
$(man_MANS_txts) : man-appareo
- if ! ./man-appareo --asciidoc `echo $@ | sed -e 's.^appareo-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
+ if ! ./man-appareo `echo $@ | sed -e 's.^appareo-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
.txt.xml : $(man_MANS_txts)
asciidoc --doctype=manpage --backend=docbook --out-file=$@ $<
@@ -28,6 +29,15 @@ $(man_MANS_txts) : man-appareo
.xml.1 : $(man_MANS_xmls)
xmlto man $<
+.xml.html-man-fragment : $(man_MANS_xmls)
+ xmlto html $< -o $@-dir
+ sed \
+ -e '1s,^.*\(<div class="refnamediv">\),\1,' \
+ -e '$$s,</body>.*,,' -e '$$s,</div><div class="navfooter"><hr></div>,,' \
+ -e 's,<a name="[^"]*"></a>,,g' \
+ $@-dir/index.html > $@
+ rm -fr $@-dir
+
man_appareo_SOURCES = \
man_appareo.cc \
command_line.hh \
@@ -54,13 +64,17 @@ appareo_LDADD = \
TESTS = version_TEST \
help_TEST
+noinst_DATA = $(man_MANS_html_man_fragments)
+
EXTRA_DIST = \
$(man_MANS) \
+ $(man_MAN_html_man_fragments) \
$(TESTS)
DISTCLEANFILES = \
$(man_MANS) \
$(noinst_DATA) \
$(man_MANS_txts) \
- $(man_MANS_xmls)
+ $(man_MANS_xmls) \
+ $(man_MAN_html_man_fragments)
diff --git a/src/clients/appareo/man_appareo.cc b/src/clients/appareo/man_appareo.cc
index 702a70a1b..036157082 100644
--- a/src/clients/appareo/man_appareo.cc
+++ b/src/clients/appareo/man_appareo.cc
@@ -32,17 +32,6 @@ namespace
struct ManCommandLine :
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)
- {
- }
-
virtual std::string app_name() const
{
return "";
@@ -66,13 +55,7 @@ main(int argc, char * argv[])
ManCommandLine cmdline;
cmdline.run(argc, argv, "", "", "");
- std::shared_ptr<paludis::args::DocWriter> w;
- 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
- throw paludis::args::DoHelp("No format specified");
+ auto w(std::make_shared<paludis::args::AsciidocWriter>(cout));
paludis::args::generate_doc(*w, CommandLine::get_instance());