Motivation is to allow modify render code easily and more safely as now it's a pain to introduce new changes. The default syntax version is 2.6.0 unless otherwise noted. The following functions must exist:
High-level functions
parser_check_layout_correctness <page-content>return: 0 if it's correct and 1 if it's invalid
note: tag, description and code example correctness is not checked
parser_get_command_name_with_subcommands [--check|-c] <page-content>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
parser_get_command_description [--check|-c] <page-content>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
parser_get_command_tags [--check|-c] <page-content>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
tags returned as AWK-parsable text, where \0 is a tag name and value delimiter (field separator)
tags can be repeated, but only the first tag occurrence value is preserved
and \n is a record delimiter
parser_get_command_examples [--check|-c] <page-content>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
tags returned as AWK-parsable text, where \0 is a example description and code delimiter (field separator)
and \n is a record delimiter
Tag-specific functions
Spacing is ignored while analyzing tags. Syntactic value correctness is checked.
parser_get_command_tag_value <tag-list>return: 0
note: check can be omitted if it's guaranteed that layout is valid
if tag doesn't exist then empty string is returned
if tag is a list than each value is returned on a separate string
is a string returned by `parser_get_command_tags`
parser_check_command_tag_value_correctness <tag-list>return: 0 if tag value is correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
is a string returned by `parser_get_command_tags`
Example-specific functions
parser_get_command_example_description <example-list>return: 0
note: check can be omitted if it's guaranteed that layout is valid
if example doesn't exist then empty string is returned
is a string returned by `parser_get_command_examples`
parser_get_command_example_code <example-list>return: 0
note: check can be omitted if it's guaranteed that layout is valid
if example doesn't exist then empty string is returned
is a string returned by `parser_get_command_examples`
Example description specific functions
parser_check_command_example_description_correctness <example-description>return: 0 if there are no not closed mnemonics and not closed alternatives and
1 otherwise
note: is a string returned by parser_get_command_example_description
Example code specific functions
parser_check_command_example_code_correctness <example-code>return: 0 if there are no not closed placeholders and 1 otherwise
note: is a string returned by parser_get_command_example_code
Page building functions
parser_set_command_name_with_subcommands [--check|-c] <page-content> <command subcommand1 subcommand2 ...>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout is valid
parser_set_command_description [--check|-c] <page-content> <line1 line2 ...>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout and <line1 line2 ...> are valid
parser_set_command_tags [--check|-c] <page-content> <tag-list>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout and are valid
is a string conforming `parser_get_command_tags` output format
parser_set_command_examples [--check|-c] <page-content> <example-list>return: 0 if layout correct and 1 if it's invalid
note: check can be omitted if it's guaranteed that layout and are valid
is a string conforming `parser_get_command_examples` output format
Motivation is to allow modify render code easily and more safely as now it's a pain to introduce new changes. The default syntax version is 2.6.0 unless otherwise noted. The following functions must exist:
High-level functions
parser_check_layout_correctness <page-content>
return: 0 if it's correct and 1 if it's invalid note: tag, description and code example correctness is not checkedparser_get_command_name_with_subcommands [--check|-c] <page-content>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is validparser_get_command_description [--check|-c] <page-content>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is validparser_get_command_tags [--check|-c] <page-content>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is valid tags returned as AWK-parsable text, where\0
is a tag name and value delimiter (field separator) tags can be repeated, but only the first tag occurrence value is preserved and\n
is a record delimiterparser_get_command_examples [--check|-c] <page-content>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is valid tags returned as AWK-parsable text, where\0
is a example description and code delimiter (field separator) and\n
is a record delimiterTag-specific functions
Spacing is ignored while analyzing tags. Syntactic value correctness is checked.
parser_get_command_tag_value <tag-list>
return: 0 note: check can be omitted if it's guaranteed that layout is valid if tag doesn't exist then empty string is returned if tag is a list than each value is returned on a separate stringparser_check_command_tag_value_correctness <tag-list>
return: 0 if tag value is correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is validExample-specific functions
parser_get_command_example_description <example-list>
return: 0 note: check can be omitted if it's guaranteed that layout is valid if example doesn't exist then empty string is returnedparser_get_command_example_code <example-list>
return: 0 note: check can be omitted if it's guaranteed that layout is valid if example doesn't exist then empty string is returnedExample description specific functions
parser_check_command_example_description_correctness <example-description>
return: 0 if there are no not closed mnemonics and not closed alternatives and 1 otherwise note:parser_get_command_example_description
Example code specific functions
parser_check_command_example_code_correctness <example-code>
return: 0 if there are no not closed placeholders and 1 otherwise note:parser_get_command_example_code
Page building functions
parser_set_command_name_with_subcommands [--check|-c] <page-content> <command subcommand1 subcommand2 ...>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout is validparser_set_command_description [--check|-c] <page-content> <line1 line2 ...>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout and <line1 line2 ...> are validparser_set_command_tags [--check|-c] <page-content> <tag-list>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout andparser_set_command_examples [--check|-c] <page-content> <example-list>
return: 0 if layout correct and 1 if it's invalid note: check can be omitted if it's guaranteed that layout and