diff options
author | 2011-03-19 18:53:22 +0000 | |
---|---|---|
committer | 2011-03-19 19:20:24 +0000 | |
commit | 6509d233883f44495f8601d0cb9d1302aa800c77 (patch) | |
tree | 5c34d16bf83b3d7153098962bacdec100b67e5e4 | |
parent | c3422ce17ce50a73427b5457e9ff4998b7fd401d (diff) | |
download | paludis-6509d233883f44495f8601d0cb9d1302aa800c77.tar.gz paludis-6509d233883f44495f8601d0cb9d1302aa800c77.tar.xz |
Use asciidoc for instruo html
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | doc/clients/Makefile.am | 10 | ||||
-rw-r--r-- | src/clients/instruo/Makefile.am | 19 | ||||
-rw-r--r-- | src/clients/instruo/man_instruo.cc | 21 |
4 files changed, 25 insertions, 26 deletions
diff --git a/.gitignore b/.gitignore index b89ad212e..5cb5ec4c9 100644 --- a/.gitignore +++ b/.gitignore @@ -506,6 +506,7 @@ paludis-*.*.*.tar.bz2 /src/clients/instruo/instruo /src/clients/instruo/*.txt /src/clients/instruo/*.xml +/src/clients/instruo/*.html-man-fragment /stamp-h1 /test/test_fail_TEST /test/test_pass_TEST diff --git a/doc/clients/Makefile.am b/doc/clients/Makefile.am index 8f7b55dcb..1cf579c71 100644 --- a/doc/clients/Makefile.am +++ b/doc/clients/Makefile.am @@ -149,13 +149,15 @@ $(CAVE_COMMANDS_HTML) : header.html.part footer.html.part instruo.html : header.html.part footer.html.part { cat header.html.part && { \ - if test -x $(top_builddir)/src/clients/instruo/man-instruo ; then \ - $(top_builddir)/src/clients/instruo/man-instruo --html ; \ + if test -f $(top_builddir)/src/clients/instruo/instruo.html-man-fragment ; then \ + cat $(top_builddir)/src/clients/instruo/instruo.html-man-fragment ; \ + elif test -f $(top_srcdir)/src/clients/instruo/instruo.html-man-fragment ; then \ + cat $(top_srcdir)/src/clients/instruo/instruo.html-man-fragment ; \ else \ echo "<h1>instruo</h1>"; \ echo "<p>Sorry, documentation was generated without support for the instruo client.</p>" ; \ - fi ; } && \ - cat footer.html.part ; } > $@ + fi ; } \ + && cat footer.html.part ; } > $@ header.html.part : $(srcdir)/../header.html.part.in toplinks.html.part sed \ 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()); |