# TRANSLATORS: Tranlate the values in quotes
volatile.q_label = "Q"; # appears before questions as Q:
volatile.a_label = "A"; # appears before answers as A:
# NO TRANSLATION NEEDED BEYOND THIS POINT
# start_docs_page() starts a documentation page with the specified title
subroutine(start_docs_page(string title), (
volatile.docs_page_title = title;
#debug_message("volatile.docs_page_title: " . volatile.docs_page_title . "\n");
docs.header;
'
\n';
" \n";
expand(' ' . title . ' | \n');
"
\n";
"
\n";
'\n';
" \n";
" \n";
if (internal.docs.tab eq 'USER') and (internal.docs.index eq 'FALSE') then " " else ' ';
));
subroutine(end_docs_page, (
" | \n";
"
\n";
"
\n";
docs.footer;
));
# docs_option_link() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_option_link(string option), (
# Get the full node name for this option
string fullOptionName = get_node_name_from_shortcut(option);
# Get the option name within the profile
string optionNameForURL = fullOptionName;
if (starts_with(fullOptionName, "profiles.default_profile.")) then
optionNameForURL = "profile." . substr(optionNameForURL, length("profiles.default_profile."));
# Get the option label
string label = $("lang_options." . optionNameForURL . ".label");
string result = expand("$label");
result;
)); # docs_option_link
# remove_prefix() -- this removes a prefix p from string s
subroutine(remove_prefix(string s, string p), (
if (starts_with(s, p)) then
s = substr(s, length(p));
s;
));
# docs_chapter_link() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_chapter_link(string chapter), (
expand("");
$("docs.technical_manual.page_titles." . chapter);
"";
)); # docs_chapter_link
# docs_chapter_link_with_anchor() returns a link to an option documentation page, given the shortcut or option name
subroutine(docs_chapter_link_with_anchor(string chapter, string anchor, string label), (
expand("");
label;
"";
)); # docs_chapter_link_with_anchor
# docs_function_link() returns a link to a Salang function
subroutine(docs_function_link(string function), (
"";
"" . function . "()
";
"";
)); # docs_function
# docs_user_chapter_link() returns a link to an option documentation page in the user guide, given the shortcut or option name
subroutine(docs_user_chapter_link(string chapter), (
expand("");
$("docs.user_guide.page_titles." . chapter);
"";
)); # docs_user_chapter_link
# docs_faq_link() returns a link to an FAQ entry, given the name
subroutine(docs_faq_link(string name), (
expand("");
$("docs.faq.db." . name . ".label");
"";
)); # docs_faq_link
# docs_user_faq_link() returns a link to an FAQ entry in the User FAQ, given the name
subroutine(docs_user_faq_link(string name), (
expand("");
$("docs.user_faq.db." . name . ".label");
"";
)); # docs_user_faq_link
# docs_faq_short_description() returns a short description of a FAQ entry
subroutine(docs_faq_short_description(string name), (
expand("$volatile.q_label: ") . $("docs.faq.db." . name . ".question") . "
\n";
expand("$volatile.a_label: ") . $("docs.faq.db." . name . ".short_answer") . "\n";
"For full details, see " . docs_faq_link(name) . ".
\n";
"
\n";
)); # docs_faq_short_description
# docs_user_faq_short_description() returns a short description of a FAQ entry from the User FAQ
subroutine(docs_user_faq_short_description(string name), (
expand("$volatile.q_label: ") . $("docs.user_faq.db." . name . ".question") . "
\n";
expand("$volatile.a_label: ") . $("docs.user_faq.db." . name . ".short_answer") . "\n";
"For full details, see " . docs_user_faq_link(name) . ".
\n";
"
\n";
)); # docs_user_faq_short_description