aboutsummaryrefslogtreecommitdiff
path: root/src/clients
diff options
context:
space:
mode:
Diffstat (limited to 'src/clients')
-rw-r--r--src/clients/instruo/Makefile.am19
-rw-r--r--src/clients/instruo/man_instruo.cc21
2 files changed, 18 insertions, 22 deletions
diff --git a/src/clients/instruo/Makefile.am b/src/clients/instruo/Makefile.am
index 4d920356e..4c565f6ee 100644
--- a/src/clients/instruo/Makefile.am
+++ b/src/clients/instruo/Makefile.am
@@ -18,9 +18,10 @@ SUFFIXES = .1 .txt .xml
man_MANS_txts = instruo.txt
man_MANS_xmls = instruo.xml
+man_MANS_html_man_fragments = instruo.html-man-fragment
$(man_MANS_txts) : man-instruo
- if ! ./man-instruo --asciidoc `echo $@ | sed -e 's.^instruo-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
+ if ! ./man-instruo `echo $@ | sed -e 's.^instruo-*..' -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-instruo
.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_instruo_SOURCES = \
man_instruo.cc \
command_line.hh \
@@ -54,13 +64,16 @@ instruo_LDADD = \
TESTS = version_TEST \
help_TEST
+noinst_DATA = $(man_MANS_html_man_fragments)
+
EXTRA_DIST = \
$(man_MANS) \
+ $(man_MANS_html_man_fragments) \
$(TESTS)
DISTCLEANFILES = \
$(man_MANS) \
- $(noinst_DATA) \
$(man_MANS_txts) \
- $(man_MANS_xmls)
+ $(man_MANS_xmls) \
+ $(man_MANS_html_man_fragments)
diff --git a/src/clients/instruo/man_instruo.cc b/src/clients/instruo/man_instruo.cc
index 6903075e6..2216facca 100644
--- a/src/clients/instruo/man_instruo.cc
+++ b/src/clients/instruo/man_instruo.cc
@@ -1,7 +1,7 @@
/* vim: set sw=4 sts=4 et foldmethod=syntax : */
/*
- * Copyright (c) 2006, 2007, 2009 Ciaran McCreesh
+ * Copyright (c) 2006, 2007, 2009, 2011 Ciaran McCreesh
*
* This file is part of the Paludis package manager. Paludis is free software;
* you can redistribute it and/or modify it under the terms of the GNU General
@@ -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());