Skip to content

Commit 0eea021

Browse files
include global parameters and fixup for HTML meta-characters
1 parent f6e4a45 commit 0eea021

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

doc/mk_params_doc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ def help(ous):
3535
ous.write("Z3 Options\n")
3636
z3_exe = BUILD_DIR + "/z3"
3737
out = subprocess.Popen([z3_exe, "-pm"],stdout=subprocess.PIPE).communicate()[0]
38-
modules = []
38+
modules = ["global"]
3939
if out != None:
4040
out = out.decode(sys.stdout.encoding)
4141
module_re = re.compile(r"\[module\] (.*)\,")

src/util/gparams.cpp

+8-2
Original file line numberDiff line numberDiff line change
@@ -536,15 +536,21 @@ struct gparams::imp {
536536
void display_module_markdown(std::ostream & out, char const* module_name) {
537537
lock_guard lock(*gparams_mux);
538538
param_descrs * d = nullptr;
539+
540+
if (module_name == std::string("global")) {
541+
out << "\n## Global Parameters\n\n";
542+
get_param_descrs().display_markdown(out);
543+
return;
544+
}
539545
if (!get_module_param_descr(module_name, d)) {
540546
std::stringstream strm;
541547
strm << "unknown module '" << module_name << "'";
542548
throw exception(std::move(strm).str());
543549
}
544-
out << "\n## Module " << module_name << "\n\n";
550+
out << "\n## " << module_name << "\n\n";
545551
char const * descr = nullptr;
546552
if (get_module_descrs().find(module_name, descr))
547-
out << "Description: " << descr << "\n";
553+
out << descr << "\n";
548554
out << "\n";
549555
d->display_markdown(out);
550556
}

src/util/params.cpp

+12-2
Original file line numberDiff line numberDiff line change
@@ -194,9 +194,19 @@ struct param_descrs::imp {
194194
out << " | " << d.m_kind << " ";
195195
else
196196
out << " (" << d.m_kind << ")";
197-
if (markdown)
197+
if (markdown) {
198198
out << " | ";
199-
if (include_descr)
199+
std::string desc;
200+
for (auto ch : std::string(d.m_descr)) {
201+
switch (ch) {
202+
case '<': desc += "&lt;"; break;
203+
case '>': desc += "&gt;"; break;
204+
default: desc.push_back(ch);
205+
}
206+
}
207+
out << " " << desc;
208+
}
209+
else if (include_descr)
200210
out << " " << d.m_descr;
201211
if (markdown) {
202212
out << " | ";

0 commit comments

Comments
 (0)