20#include "parser_local_proto.h"
22static void print_escaped_for_html(
FILE *,
const char *);
23static void print_escaped_for_html_options(
FILE *,
const char *);
24static void print_escaped_for_html_keywords(
FILE *,
const char *);
45 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
47 fprintf(
stdout,
" <meta http-equiv=\"Content-Type\" content=\"text/html; "
48 "charset=utf-8\">\n");
50 " <meta name=\"Author\" content=\"GRASS Development Team\">\n");
52 " <meta http-equiv=\"content-language\" content=\"en-us\">\n");
53 fprintf(
stdout,
" <meta name=\"viewport\" content=\"width=device-width, "
54 "initial-scale=1\">\n");
56 fprintf(
stdout,
" <meta name=\"description\" content=\"%s",
st->pgm_name);
57 if (
st->module_info.description)
62 if (
st->module_info.keywords) {
68 fprintf(
stdout,
" <link rel=\"stylesheet\" href=\"grassdocs.css\" "
69 "type=\"text/css\">\n");
73 fprintf(
stdout,
"<a href=\"index.html\"><img src=\"grass_logo.png\" "
74 "alt=\"GRASS logo\"></a>\n");
79 if (
st->module_info.label ||
st->module_info.description)
82 if (
st->module_info.label)
85 if (
st->module_info.description)
89 if (
st->module_info.keywords) {
94 fprintf(
stdout,
"<div id=\"name\"><b>%s</b><br></div>\n",
st->pgm_name);
113 opt = &
st->first_option;
117 type =
opt->key_desc;
172 if (
flag->description) {
185 _(
"Allow output files to overwrite existing files"));
198 fprintf(
stdout,
"<dd>%s</dd>\n",
_(
"Force launching GUI dialog"));
206 opt = &
st->first_option;
213 type =
opt->key_desc;
241 print_escaped_for_html(
stdout,
opt->label);
244 if (
opt->description) {
246 print_escaped_for_html(
stdout,
opt->description);
252 print_escaped_for_html_options(
stdout,
opt->options);
258 print_escaped_for_html(
stdout,
opt->def);
265 while (
opt->opts[i]) {
268 if (
opt->gisprompt) {
272 "old,colortable,colortable") == 0)
275 "old,barscale,barscale") == 0)
278 "old,northarrow,northarrow") == 0)
283 "<img height=\"12\" "
284 "style=\"max-width: 80;\" "
285 "src=\"%s/%s.png\" alt=\"%s\"> ",
288 print_escaped_for_html(
stdout,
opt->opts[i]);
290 print_escaped_for_html(
stdout,
opt->descs[i]);
311#define do_escape(c, escaped) \
315void print_escaped_for_html(
FILE *f,
const char *str)
319 for (s = str; *s; s++) {
325 do_escape(
'\t',
" ");
332void print_escaped_for_html_options(
FILE *f,
const char *str)
336 for (s = str; *s; s++) {
342 do_escape(
'\t',
" ");
350void print_escaped_for_html_keywords(
FILE *f,
const char *str)
355 if (
st->n_keys > 1 &&
strcmp(
st->module_info.keywords[1], str) == 0) {
360 fprintf(f,
"<a href=\"topic_");
361 for (s = str; *s; s++) {
368 fprintf(f,
".html\">%s</a>", str);
371 if (
st->n_keys > 0 &&
strcmp(
st->module_info.keywords[0], str) == 0) {
376 for (s = str; *s; s++) {
383 fprintf(f,
".html\">%s</a>", str);
387 if (
st->n_keys > 0 &&
388 strcmp(
st->module_info.keywords[2], str) == 0) {
391 fprintf(f,
"<a href=\"keywords.html#%s\">%s</a>", str, str);
394 fprintf(f,
"<a href=\"keywords.html#%s\">%s</a>", str, str);
const char * G_program_name(void)
Return module name.
void G__print_keywords(FILE *fd, void(*format)(FILE *, const char *), int newline)
Print list of keywords (internal use only)
int G__uses_new_gisprompt(void)
#define do_escape(c, escaped)
Format text for HTML output.
void G__usage_html(void)
Print module usage description in HTML format.
Structure that stores flag info.
Structure that stores option information.