ascii-chat 0.11.33
Video chat in your terminal
Loading...
Searching...
No Matches
manpage.h File Reference

Man page template generation from options builder. More...

Go to the source code of this file.

Data Structures

struct  parsed_section_t
 Parsed section information. More...
 

Enumerations

enum  section_type_t { SECTION_TYPE_AUTO , SECTION_TYPE_MANUAL , SECTION_TYPE_MERGE , SECTION_TYPE_UNMARKED }
 Section type marker. More...
 

Functions

asciichat_error_t options_config_generate_manpage_template (const options_config_t *config, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
 Generate a man page template from options builder configuration.
 
asciichat_error_t options_builder_generate_manpage_template (options_builder_t *builder, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
 Generate man page template from builder (before build())
 
asciichat_error_t options_config_generate_manpage_merged (const options_config_t *config, const char *program_name, const char *mode_name, const char *output_path, const char *brief_description)
 Generate merged man page template preserving manual content.
 
parsed_section_t * parse_manpage_sections (const char *filepath, size_t *num_sections)
 Parse existing man page template to extract sections.
 
void free_parsed_sections (parsed_section_t *sections, size_t num_sections)
 Free parsed sections array.
 
const parsed_section_t * find_section (const parsed_section_t *sections, size_t num_sections, const char *section_name)
 Find section by name.
 
asciichat_error_t options_config_generate_final_manpage (const char *template_path, const char *output_path, const char *version_string, const char *content_file_path)
 Generate final man page (.1) from template (.1.in) with version substitution and optional content file.
 
const char * escape_groff_special (const char *str)
 Escape special groff/troff characters in text.
 
const char * format_mode_names (option_mode_bitmask_t bitmask)
 Format option mode names as human-readable string.
 

Detailed Description

Man page template generation from options builder.

This module provides functionality to auto-generate man page templates from the options builder configuration. The generated templates include auto-populated sections (SYNOPSIS, OPTIONS, EXAMPLES, USAGE) and placeholders for manual sections (DESCRIPTION, FILES, NOTES, BUGS, AUTHOR, SEE ALSO).

Supports merging auto-generated content with existing manual content using section markers (AUTO-START/END, MANUAL-START/END, MERGE-START/END).

Note
Man pages are generated in groff/troff format (man(5) format)

Definition in file manpage.h.

Enumeration Type Documentation

◆ section_type_t

Section type marker.

Enumerator
SECTION_TYPE_AUTO 

Fully auto-generated, manual edits lost on regeneration.

SECTION_TYPE_MANUAL 

Manually maintained, never touched by generator.

SECTION_TYPE_MERGE 

Intelligently merged: auto + manual content.

SECTION_TYPE_UNMARKED 

No marker found, defaults to MANUAL.

Definition at line 28 of file manpage.h.

28 {
section_type_t
Section type marker.
Definition manpage.h:28
@ SECTION_TYPE_MERGE
Intelligently merged: auto + manual content.
Definition manpage.h:31
@ SECTION_TYPE_UNMARKED
No marker found, defaults to MANUAL.
Definition manpage.h:32
@ SECTION_TYPE_AUTO
Fully auto-generated, manual edits lost on regeneration.
Definition manpage.h:29
@ SECTION_TYPE_MANUAL
Manually maintained, never touched by generator.
Definition manpage.h:30