GRASS 8 Programmer's Manual
8.5.0(2026)-8d6ceba290
Toggle main menu visibility
Loading...
Searching...
No Matches
parser_md.c
Go to the documentation of this file.
1
/*!
2
\file lib/gis/parser_md.c
3
4
\brief GIS Library - Argument parsing functions (Markdown output)
5
6
(C) 2012-2025 by the GRASS Development Team
7
8
This program is free software under the GNU General Public License
9
(>=v2). Read the file COPYING that comes with GRASS for details.
10
11
\author Martin Landa
12
\author Vaclav Petras
13
*/
14
#include <stdio.h>
15
#include <string.h>
16
17
#include <grass/gis.h>
18
#include <grass/glocale.h>
19
20
#include "parser_local_proto.h"
21
22
/*!
23
\brief Print module usage description in Markdown format.
24
*/
25
void
G__usage_markdown
(
void
)
26
{
27
if
(!st->pgm_name)
28
st->pgm_name =
G_program_name
();
29
if
(!st->pgm_name)
30
st->pgm_name =
"??"
;
31
32
/* print metadata used by man/build*.py */
33
fprintf(stdout,
"---\n"
);
34
fprintf(stdout,
"name: %s\n"
, st->pgm_name);
35
fprintf(stdout,
"description: "
);
36
if
(st->module_info.label)
37
fprintf(stdout,
"%s"
, st->module_info.label);
38
if
(st->module_info.label && st->module_info.description)
39
fprintf(stdout,
" "
);
40
if
(st->module_info.description)
41
fprintf(stdout,
"%s"
, st->module_info.description);
42
fprintf(stdout,
"\n"
);
43
fprintf(stdout,
"keywords: [ "
);
44
G__print_keywords
(stdout,
NULL
,
FALSE
);
45
fprintf(stdout,
" ]"
);
46
fprintf(stdout,
"\n---\n\n"
);
47
48
/* main header */
49
fprintf(stdout,
"# %s\n\n"
, st->pgm_name);
50
51
/* header */
52
if
(st->module_info.label)
53
fprintf(stdout,
"%s\n"
, st->module_info.label);
54
55
if
(st->module_info.description) {
56
if
(st->module_info.label)
57
fprintf(stdout,
"\n"
);
58
fprintf(stdout,
"%s\n"
, st->module_info.description);
59
}
60
61
const
char
*tab_indent =
" "
;
62
63
/* short version */
64
fprintf(stdout,
"\n=== \"Command line\"\n\n"
);
65
G__md_print_cli_short_version
(stdout, tab_indent);
66
fprintf(stdout,
"\n=== \"Python (grass.tools)\"\n\n"
);
67
G__md_print_python_short_version
(stdout, tab_indent,
true
);
68
fprintf(stdout,
"\n=== \"Python (grass.script)\"\n\n"
);
69
G__md_print_python_short_version
(stdout, tab_indent,
false
);
70
71
fprintf(stdout,
"\n## %s\n"
, _(
"Parameters"
));
72
73
/* long version */
74
fprintf(stdout,
"\n=== \"Command line\"\n\n"
);
75
G__md_print_cli_long_version
(stdout, tab_indent);
76
fprintf(stdout,
"\n=== \"Python (grass.tools)\"\n\n"
);
77
G__md_print_python_long_version
(stdout, tab_indent,
true
);
78
fprintf(stdout,
"\n=== \"Python (grass.script)\"\n\n"
);
79
G__md_print_python_long_version
(stdout, tab_indent,
false
);
80
}
NULL
#define NULL
Definition
ccmath.h:32
FALSE
#define FALSE
Definition
dbfopen.c:55
G__print_keywords
void G__print_keywords(FILE *fd, void(*format)(FILE *, const char *), int newline)
Print list of keywords (internal use only).
Definition
parser.c:929
G__usage_markdown
void G__usage_markdown(void)
Print module usage description in Markdown format.
Definition
parser_md.c:25
G__md_print_cli_long_version
void G__md_print_cli_long_version(FILE *file, const char *indent)
Definition
parser_md_cli.c:312
G__md_print_cli_short_version
void G__md_print_cli_short_version(FILE *file, const char *indent)
Definition
parser_md_cli.c:240
G__md_print_python_long_version
void G__md_print_python_long_version(FILE *file, const char *indent, bool tools_api)
Definition
parser_md_python.c:506
G__md_print_python_short_version
void G__md_print_python_short_version(FILE *file, const char *indent, bool tools_api)
Definition
parser_md_python.c:379
G_program_name
const char * G_program_name(void)
Return module name.
Definition
progrm_nme.c:28
gis
parser_md.c
Generated on
for GRASS 8 Programmer's Manual by
1.17.0