MCPcopy Create free account
hub / github.com/antirez/llama.cpp-deepseek-v4-flash / write_table_entry

Function write_table_entry

examples/gen-docs/gen-docs.cpp:33–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

31}
32
33static void write_table_entry(std::ostringstream & ss, const common_arg & opt) {
34 ss << "| `";
35 // args
36 auto all_args = opt.get_args();
37 for (const auto & arg : all_args) {
38 if (arg == all_args.front()) {
39 ss << arg;
40 if (all_args.size() > 1) ss << ", ";
41 } else {
42 ss << arg << (arg != all_args.back() ? ", " : "");
43 }
44 }
45 // value hint
46 if (opt.value_hint) {
47 std::string md_value_hint(opt.value_hint);
48 string_replace_all(md_value_hint, "|", "\\|");
49 ss << " " << md_value_hint;
50 }
51 if (opt.value_hint_2) {
52 std::string md_value_hint_2(opt.value_hint_2);
53 string_replace_all(md_value_hint_2, "|", "\\|");
54 ss << " " << md_value_hint_2;
55 }
56 // help text
57 std::string md_help(opt.help);
58 md_help = string_strip(md_help);
59 string_replace_all(md_help, "\n", "<br/>");
60 string_replace_all(md_help, "|", "\\|");
61 ss << "` | " << md_help << " |\n";
62}
63
64static void write_table(std::ostringstream & ss, std::vector<common_arg *> & opts) {
65 write_table_header(ss);

Callers 1

write_tableFunction · 0.85

Calls 4

string_stripFunction · 0.85
get_argsMethod · 0.80
string_replace_allFunction · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected