aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 18:46:46 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-03-19 19:20:23 +0000
commitbaa832efda41087bab4f0723cded67baeaddb3b8 (patch)
tree46bb948482080f0ff518cecf80e73b8336ff3a81
parent61253f69646be10c92840db52ca50695231b605c (diff)
downloadpaludis-baa832efda41087bab4f0723cded67baeaddb3b8.tar.gz
paludis-baa832efda41087bab4f0723cded67baeaddb3b8.tar.xz
Use asciidoc for accerso html
-rw-r--r--.gitignore1
-rw-r--r--doc/clients/Makefile.am10
-rw-r--r--src/clients/accerso/Makefile.am21
-rw-r--r--src/clients/accerso/man_accerso.cc19
4 files changed, 25 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore
index 124fb10..f51d05e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -493,6 +493,7 @@ paludis-*.*.*.tar.bz2
/src/clients/accerso/accerso
/src/clients/accerso/*.txt
/src/clients/accerso/*.xml
+/src/clients/accerso/*.html-man-fragment
/src/clients/appareo/appareo
/src/clients/appareo/*.txt
/src/clients/appareo/*.xml
diff --git a/doc/clients/Makefile.am b/doc/clients/Makefile.am
index dbda649..55de16b 100644
--- a/doc/clients/Makefile.am
+++ b/doc/clients/Makefile.am
@@ -99,13 +99,15 @@ index.html : header.html.part $(srcdir)/index.html.part footer.html.part
accerso.html : header.html.part footer.html.part
{ cat header.html.part && { \
- if test -x $(top_builddir)/src/clients/accerso/man-accerso ; then \
- $(top_builddir)/src/clients/accerso/man-accerso --html ; \
+ if test -f $(top_builddir)/src/clients/accerso/accerso.html-man-fragment ; then \
+ cat $(top_builddir)/src/clients/accerso/accerso.html-man-fragment ; \
+ elif test -f $(top_srcdir)/src/clients/accerso/accerso.html-man-fragment ; then \
+ cat $(top_srcdir)/src/clients/accerso/accerso.html-man-fragment ; \
else \
echo "<h1>accerso</h1>"; \
echo "<p>Sorry, documentation was generated without support for the accerso client.</p>" ; \
- fi ; } && \
- cat footer.html.part ; } > $@
+ fi ; } \
+ && cat footer.html.part ; } > $@
appareo.html : header.html.part footer.html.part
{ cat header.html.part && { \
diff --git a/src/clients/accerso/Makefile.am b/src/clients/accerso/Makefile.am
index 214a08f..792b8f0 100644
--- a/src/clients/accerso/Makefile.am
+++ b/src/clients/accerso/Makefile.am
@@ -14,13 +14,14 @@ bin_PROGRAMS = accerso
noinst_PROGRAMS = man-accerso
man_MANS = accerso.1
-SUFFIXES = .1 .txt .xml
+SUFFIXES = .1 .txt .xml .html-man-fragment
man_MANS_txts = accerso.txt
man_MANS_xmls = accerso.xml
+man_MANS_html_man_fragments = accerso.html-man-fragment
$(man_MANS_txts) : man-accerso
- if ! ./man-accerso --asciidoc `echo $@ | sed -e 's.^accerso-*..' -e 's,\.txt$$,,'` > $@ ; then rm -f $@ ; exit 1 ; fi
+ if ! ./man-accerso `echo $@ | sed -e 's.^accerso-*..' -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-accerso
.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_accerso_SOURCES = \
man_accerso.cc \
command_line.hh \
@@ -54,13 +64,16 @@ accerso_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/accerso/man_accerso.cc b/src/clients/accerso/man_accerso.cc
index 3002eba..710e223 100644
--- a/src/clients/accerso/man_accerso.cc
+++ b/src/clients/accerso/man_accerso.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());