aboutsummaryrefslogtreecommitdiff
path: root/paludis/args/man.cc
diff options
context:
space:
mode:
Diffstat (limited to 'paludis/args/man.cc')
-rw-r--r--paludis/args/man.cc467
1 files changed, 0 insertions, 467 deletions
diff --git a/paludis/args/man.cc b/paludis/args/man.cc
index 7245d24a9..421655ef0 100644
--- a/paludis/args/man.cc
+++ b/paludis/args/man.cc
@@ -492,470 +492,3 @@ AsciidocWriter::end_see_alsos()
_os << endl;
}
-
-HtmlWriter::HtmlWriter(std::ostream & os) :
- _os(os)
-{
-}
-
-HtmlWriter::~HtmlWriter()
-{
-}
-
-void
-HtmlWriter::heading(const std::string & name, const std::string & section_, const std::string & synopsis)
-{
- _os << "<h1>" << name << "(" << section_ << ")" << "</h1>" << endl;
- _os << "<h2>Name</h2>" << endl;
- _os << "<p>" << name << " - " << synopsis << "</p>" << endl;
-}
-
-void
-HtmlWriter::start_usage_lines()
-{
- _os << "<h2>Synopsis</h2>" << endl;
-}
-
-void
-HtmlWriter::usage_line(const std::string & name, const std::string & line)
-{
- _os << "<p>" << name << " " << line << "</p>" << endl;
-}
-
-void
-HtmlWriter::start_description(const std::string & description)
-{
- _os << "<h2>Description</h2>" << endl;
- _os << "<p>" << description << "</p>" << endl;
-}
-
-void
-HtmlWriter::start_options(const std::string & s)
-{
- _os << "<h2>" << s << "</h2>" << endl;
-}
-
-void
-HtmlWriter::start_arg_group(const std::string & name, const std::string & description)
-{
- _os << "<h3>" << name << "</h3>" << endl;
- _os << "<p>" << description << "</p>" << endl;
- _os << "<dl>";
-}
-
-void
-HtmlWriter::arg_group_item(const char & short_name, const std::string & long_name,
- const std::string & negated_long_name, const std::string & description)
-{
- _os << "<dt>";
- if (short_name)
- _os << "-" << escape_html_char(short_name) << ", ";
- _os << "--" << long_name;
- if (! negated_long_name.empty())
- _os << " (" << "--" << negated_long_name << ")";
- _os << "</dt>" << endl;
- _os << "<dd>" << description << endl;
-}
-
-void
-HtmlWriter::start_extra_arg()
-{
- _os << "<dl>" << endl;
-}
-
-void
-HtmlWriter::extra_arg_enum(const AllowedEnumArg & e, const std::string & default_arg)
-{
- std::string default_string;
- if (e.long_name() == default_arg)
- default_string = " (default)";
-
- _os << "<dt>" << e.long_name();
- if (e.short_name())
- _os << " (" << escape_html_char(e.short_name()) << ")";
- _os << "</dt>" << endl;
- _os << "<dd>" << e.description() << default_string << "</dd>" << endl;
-}
-
-void
-HtmlWriter::extra_arg_string_set(const std::string & first, const std::string & second)
-{
- _os << "<dt>" << first << "</dt>" << endl;
- _os << "<dd>" << second << "</dd>" << endl;
-}
-
-void
-HtmlWriter::end_extra_arg()
-{
- _os << "</dl>" << endl;
-}
-
-void
-HtmlWriter::end_arg_group()
-{
- _os << "</dl>" << endl;
-}
-
-void
-HtmlWriter::extra_description(const std::string & s)
-{
- _os << "<p>" << s << "</p>" << endl;
-}
-
-void
-HtmlWriter::end_description()
-{
-}
-
-void
-HtmlWriter::end_options()
-{
-}
-
-void
-HtmlWriter::start_environment()
-{
- _os << "<h2>Environment</h2>" << endl;
- _os << "<dl>" << endl;
-}
-
-void
-HtmlWriter::environment_line(const std::string & first, const std::string & second)
-{
- _os << "<dt>" << first << "</dt>" << endl;
- _os << "<dd>" << second << "</dd>" << endl;
-}
-
-void
-HtmlWriter::end_environment()
-{
- _os << "</dl>" << endl;
-}
-
-void
-HtmlWriter::start_notes()
-{
- _os << "<h2>Notes</h2>" << endl;
- _os << "<ul>" << endl;
-}
-
-void
-HtmlWriter::end_notes()
-{
- _os << "</ul>" << endl;
-}
-
-void
-HtmlWriter::note(const std::string & s)
-{
- _os << "<li>" << s << "</li>" << endl;
-}
-
-void
-HtmlWriter::start_examples()
-{
- _os << "<h2>Examples</h2>" << endl;
-}
-
-void
-HtmlWriter::example(const std::string & first, const std::string & second)
-{
- _os << "<pre>" << first << "</pre>" << endl;
- _os << "<p>" << second << "</p>" << endl;
-}
-
-void
-HtmlWriter::end_examples()
-{
-}
-
-void
-HtmlWriter::start_see_alsos()
-{
- _os << "<h2>See Also</h2>" << endl;
- _os << "<ul>" << endl;
-}
-
-void
-HtmlWriter::see_also(const std::string & page, const int s, const bool)
-{
- _os << "<li><strong>" << page << "</strong> (" << s << ")</li>" << endl;
-}
-
-void
-HtmlWriter::end_see_alsos()
-{
- _os << "</ul>" << endl;
-}
-
-void
-HtmlWriter::section(const std::string & title)
-{
- _os << "<h2>" << title << "</h2>" << endl;
-}
-
-void
-HtmlWriter::subsection(const std::string & title)
-{
- _os << "<h3>" << title << "</h3>" << endl;
-}
-
-void
-HtmlWriter::paragraph(const std::string & text)
-{
- _os << "<p>" << text << "</p>" << endl;
-}
-
-
-ManWriter::ManWriter(std::ostream & os) :
- _os(os)
-{
-}
-
-ManWriter::~ManWriter()
-{
-}
-
-void
-ManWriter::heading(const std::string & name, const std::string & section_, const std::string & synopsis)
-{
- _os << ".TH \"" << name << "\" " << section_ << endl;
- _os << ".SH NAME" << endl;
- _os << name << " \\- " << synopsis << endl;
-}
-
-void
-ManWriter::start_usage_lines()
-{
- _os << ".SH SYNOPSIS" << endl;
-}
-
-void
-ManWriter::usage_line(const std::string & name, const std::string & line)
-{
- _os << ".B " << name << " " << line << endl << endl;
-}
-
-void
-ManWriter::start_description(const std::string & description)
-{
- _os << ".SH DESCRIPTION" << endl;
- _os << description << endl;
-}
-
-void
-ManWriter::start_options(const std::string & s)
-{
- std::string upper_s;
- std::transform(s.begin(), s.end(), std::back_inserter(upper_s), &::toupper);
- _os << ".SH " << upper_s << endl;
-}
-
-void
-ManWriter::start_arg_group(const std::string & name, const std::string & description)
-{
- _os << ".SS \"" << name << "\"" << endl;
- _os << description << endl;
-}
-
-namespace
-{
- void escape(std::ostream & stream, const std::string & s)
- {
- auto t(s.begin()), t_end(s.end());
-
- if (t != t_end && *t == '\'')
- {
- stream << "\\'";
- ++t;
- }
-
- for ( ; t != t_end ; ++t)
- {
- if ('\\' == *t)
- stream << '\\';
- stream << *t;
- }
- }
-}
-
-void
-ManWriter::arg_group_item(const char & short_name, const std::string & long_name,
- const std::string & negated_long_name, const std::string & description)
-{
- _os << ".TP" << endl;
- _os << ".B \"";
- if (short_name)
- _os << "\\-" << short_name << " , ";
- _os << "\\-\\-" << long_name;
- if (! negated_long_name.empty())
- _os << " (\\-\\-" << negated_long_name << ")\"";
- _os << endl;
- escape(_os, description);
- _os << endl;
-}
-
-void
-ManWriter::start_extra_arg()
-{
-}
-
-void
-ManWriter::extra_arg_enum(const AllowedEnumArg & e, const std::string & default_arg)
-{
- std::string default_string;
- if (e.long_name() == default_arg)
- default_string = " (default)";
-
- _os << ".RS" << endl;
- _os << ".TP" << endl;
- _os << ".B \"" << e.long_name();
- if (e.short_name())
- _os << " (" << std::string(1, e.short_name()) << ")";
- _os << "\"" << endl;
- _os << e.description() << default_string << endl;
- _os << ".RE" << endl;
-}
-
-void
-ManWriter::extra_arg_string_set(const std::string & first, const std::string & second)
-{
- _os << ".RS" << endl;
- _os << ".TP" << endl;
- _os << ".B \"" << first << "\"" << endl;
- _os << second << endl;
- _os << ".RE" << endl;
-}
-
-void
-ManWriter::end_extra_arg()
-{
-}
-
-void
-ManWriter::end_arg_group()
-{
-}
-
-void
-ManWriter::end_description()
-{
-}
-
-void
-ManWriter::end_options()
-{
-}
-
-void
-ManWriter::start_environment()
-{
- _os << ".SH ENVIRONMENT" << endl;
-}
-
-void
-ManWriter::environment_line(const std::string & first, const std::string & second)
-{
- _os << ".TP" << endl;
- _os << ".B \"" << first << "\"" << endl;
- _os << second << endl;
-}
-
-void
-ManWriter::end_environment()
-{
-}
-
-void
-ManWriter::start_examples()
-{
- _os << ".SH EXAMPLES" << endl;
-}
-
-namespace
-{
- std::string ungroff(const std::string & s)
- {
- if ((! s.empty() && ('.' == s.at(0))))
- return " " + s;
- else
- return s;
- }
-}
-
-void
-ManWriter::example(const std::string & first, const std::string & second)
-{
- _os << ".TP" << endl;
- escape(_os, first);
- _os << endl;
- _os << ungroff(second) << endl << endl;
-}
-
-void
-ManWriter::extra_description(const std::string & s)
-{
- _os << endl << ungroff(s) << endl;
-}
-
-void
-ManWriter::end_examples()
-{
-}
-
-void
-ManWriter::start_see_alsos()
-{
- _os << ".SH SEE ALSO" << endl;
- _os << ".sp" << endl;
-}
-
-void
-ManWriter::see_also(const std::string & m, const int s, const bool first)
-{
- if (! first)
- _os << ", ";
- _os << "\\fB" << m << "\\fR(" << s << ")";
-}
-
-void
-ManWriter::end_see_alsos()
-{
-}
-
-void
-ManWriter::start_notes()
-{
- _os << ".SH NOTES" << endl;
-}
-
-void
-ManWriter::note(const std::string & s)
-{
- escape(_os, s);
- _os << endl << endl;
-}
-
-void
-ManWriter::end_notes()
-{
-}
-
-void
-ManWriter::section(const std::string & title)
-{
- _os << ".SH " << title << endl;
-}
-
-void
-ManWriter::subsection(const std::string & title)
-{
- _os << ".SS \"" << title << "\"" << endl;
-}
-
-void
-ManWriter::paragraph(const std::string & text)
-{
- _os << text << endl;
-}
-