18#include "parser_local_proto.h"
20static void print_escaped_for_html(
FILE *,
const char *);
21static void print_escaped_for_html_options(
FILE *,
const char *);
22static void print_escaped_for_html_keywords(
FILE *,
const char *);
43 "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n");
45 fprintf(
stdout,
" <meta http-equiv=\"Content-Type\" content=\"text/html; "
46 "charset=utf-8\">\n");
48 " <meta name=\"Author\" content=\"GRASS Development Team\">\n");
50 " <meta http-equiv=\"content-language\" content=\"en-us\">\n");
51 fprintf(
stdout,
" <meta name=\"viewport\" content=\"width=device-width, "
52 "initial-scale=1\">\n");
54 fprintf(
stdout,
" <meta name=\"description\" content=\"%s",
st->pgm_name);
55 if (
st->module_info.description)
60 if (
st->module_info.keywords) {
66 fprintf(
stdout,
" <link rel=\"stylesheet\" href=\"grassdocs.css\" "
67 "type=\"text/css\">\n");
71 fprintf(
stdout,
"<a href=\"index.html\"><img src=\"grass_logo.png\" "
72 "alt=\"GRASS logo\"></a>\n");
77 if (
st->module_info.label ||
st->module_info.description)
80 if (
st->module_info.label)
83 if (
st->module_info.description)
87 if (
st->module_info.keywords) {
92 fprintf(
stdout,
"<div id=\"name\"><b>%s</b><br></div>\n",
st->pgm_name);
111 opt = &
st->first_option;
115 type =
opt->key_desc;
170 if (
flag->description) {
183 _(
"Allow output files to overwrite existing files"));
196 fprintf(
stdout,
"<dd>%s</dd>\n",
_(
"Force launching GUI dialog"));
204 opt = &
st->first_option;
211 type =
opt->key_desc;
239 print_escaped_for_html(
stdout,
opt->label);
242 if (
opt->description) {
244 print_escaped_for_html(
stdout,
opt->description);
250 print_escaped_for_html_options(
stdout,
opt->options);
256 print_escaped_for_html(
stdout,
opt->def);
263 while (
opt->opts[i]) {
266 if (
opt->gisprompt) {
270 "old,colortable,colortable") == 0)
273 "old,barscale,barscale") == 0)
276 "old,northarrow,northarrow") == 0)
281 "<img height=\"12\" "
282 "style=\"max-width: 80;\" "
283 "src=\"%s/%s.png\" alt=\"%s\"> ",
286 print_escaped_for_html(
stdout,
opt->opts[i]);
288 print_escaped_for_html(
stdout,
opt->descs[i]);
309#define do_escape(c, escaped) \
313void print_escaped_for_html(
FILE *f,
const char *str)
317 for (s = str; *s; s++) {
323 do_escape(
'\t',
" ");
330void print_escaped_for_html_options(
FILE *f,
const char *str)
334 for (s = str; *s; s++) {
340 do_escape(
'\t',
" ");
348void print_escaped_for_html_keywords(
FILE *f,
const char *str)
353 if (
st->n_keys > 1 &&
strcmp(
st->module_info.keywords[1], str) == 0) {
358 fprintf(f,
"<a href=\"topic_");
359 for (s = str; *s; s++) {
366 fprintf(f,
".html\">%s</a>", str);
369 if (
st->n_keys > 0 &&
strcmp(
st->module_info.keywords[0], str) == 0) {
374 for (s = str; *s; s++) {
381 fprintf(f,
".html\">%s</a>", str);
385 if (
st->n_keys > 0 &&
386 strcmp(
st->module_info.keywords[2], str) == 0) {
389 fprintf(f,
"<a href=\"keywords.html#%s\">%s</a>", str, str);
392 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.