Skip to content

Commit

Permalink
[issue1132] Fix txt2tags markup.
Browse files Browse the repository at this point in the history
Produce proper txt2tags markup instead of markup that only works for MoinMoin.
  • Loading branch information
jendrikseipp authored Jan 10, 2024
1 parent c08369e commit 329c5fe
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 9 deletions.
10 changes: 7 additions & 3 deletions src/search/plugins/doc_printer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void Txt2TagsPrinter::print_usage(const Feature &feature) const {
argument_help_strings.push_back(arg_help);
}
os << utils::join(argument_help_strings, ", ")
<< ")" << endl << endl << endl;
<< ")" << endl;
}
}

Expand All @@ -133,11 +133,12 @@ void Txt2TagsPrinter::print_arguments(const Feature &feature) const {
if (arg_type.is_enum_type()) {
for (const pair<string, string> &explanation :
arg_type.get_documented_enum_values()) {
os << " - ``" << explanation.first << "``: "
os << " - ``" << explanation.first << "``: "
<< explanation.second << endl;
}
}
}
os << endl << endl;
}

void Txt2TagsPrinter::print_notes(const Feature &feature) const {
Expand All @@ -153,10 +154,11 @@ void Txt2TagsPrinter::print_notes(const Feature &feature) const {

void Txt2TagsPrinter::print_language_features(const Feature &feature) const {
if (!feature.get_language_support().empty()) {
os << "Language features supported:" << endl;
os << "Supported language features:" << endl;
for (const LanguageSupportInfo &ls : feature.get_language_support()) {
os << "- **" << ls.feature << ":** " << ls.description << endl;
}
os << endl << endl;
}
}

Expand All @@ -166,6 +168,7 @@ void Txt2TagsPrinter::print_properties(const Feature &feature) const {
for (const PropertyInfo &prop : feature.get_properties()) {
os << "- **" << prop.property << ":** " << prop.description << endl;
}
os << endl << endl;
}
}

Expand All @@ -187,6 +190,7 @@ void Txt2TagsPrinter::print_category_synopsis(const string &synopsis,
<< "expressions but are deprecated."
<< endl;
}
os << endl;
}

void Txt2TagsPrinter::print_category_footer() const {
Expand Down
12 changes: 6 additions & 6 deletions src/search/utils/markup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ string format_conference_reference(
const string &year) {
ostringstream ss;
ss << "\n\n"
<< " * " << format_authors(authors) << ".<<BR>>\n"
<< " [" << t2t_escape(title) << " " << url << "].<<BR>>\n"
<< " In //" << t2t_escape(conference) << "//";
<< format_authors(authors) << ".<<BR>>\n"
<< "[" << t2t_escape(title) << " " << url << "].<<BR>>\n"
<< "In //" << t2t_escape(conference) << "//";
if (!pages.empty())
ss << ", pp. " << t2t_escape(pages);
ss << ". ";
Expand All @@ -50,9 +50,9 @@ string format_journal_reference(
const string &year) {
ostringstream ss;
ss << "\n\n"
<< " * " << format_authors(authors) << ".<<BR>>\n"
<< " [" << t2t_escape(title) << " " << url << "].<<BR>>\n"
<< " //" << t2t_escape(journal) << "// "
<< format_authors(authors) << ".<<BR>>\n"
<< "[" << t2t_escape(title) << " " << url << "].<<BR>>\n"
<< "//" << t2t_escape(journal) << "// "
<< t2t_escape(volume) << ":" << t2t_escape(pages) << ". "
<< t2t_escape(year) << ".\n\n\n";
return ss.str();
Expand Down

0 comments on commit 329c5fe

Please sign in to comment.