Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion module/move/wca/src/ca/formatter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,26 @@ mod private
use iter_tools::Itertools;
use ca::aggregator::Order;

/// -
/// Enum representing the format options for generating help content.
///
/// `HelpFormat` defines the output format of help content, enabling the choice
/// between different styles, such as `Markdown` for structured text, or other
/// custom formats.
#[ derive( Debug, Clone, PartialEq ) ]
pub enum HelpFormat
{
/// Generates help content in Markdown format, suitable for environments
/// that support Markdown rendering (e.g., documentation platforms, text editors).
Markdown,
/// Represents an alternative format, customizable for different needs.
Another,
}

/// Generates Markdown-formatted help content based on a dictionary of terms and a specified order.
///
/// The `md_generator` function takes a reference to a `Dictionary` and an `Order` to produce
/// a help document in Markdown format. This function is useful for generating structured,
/// readable help documentation suitable for Markdown-compatible platforms.
pub fn md_generator( grammar : &Dictionary, order: Order ) -> String
{
let text = grammar.commands()
Expand Down
9 changes: 9 additions & 0 deletions module/move/wca/src/ca/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ mod private

// qqq : for Bohdan : it should transparent mechanist which patch list of commands, not a stand-alone mechanism

/// Enum `LevelOfDetail` specifies the granularity of detail for rendering or processing:
#[ derive( Debug, Default, Copy, Clone, PartialEq, Eq ) ]
pub enum LevelOfDetail
{
/// No detail (default).
#[ default ]
None,
/// Basic level of detail.
Simple,
/// High level of detail.
Detailed,
}

Expand Down Expand Up @@ -64,6 +68,11 @@ mod private
}

// qqq : for Barsik : make possible to change properties order
/// Generates help content as a formatted string based on a given dictionary and options.
///
/// This function takes a `Dictionary` of terms or commands and a `HelpGeneratorOptions`
/// struct to customize the help output, generating a user-friendly help message
/// or guide in `String` format.
pub fn generate_help_content( dictionary : &Dictionary, o : HelpGeneratorOptions< '_ > ) -> String
{
struct Row
Expand Down
3 changes: 0 additions & 3 deletions module/move/wca/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@
#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "Readme.md" ) ) ]
#![ doc = include_str!( concat!( env!( "CARGO_MANIFEST_DIR" ), "/", "doc/", "wca.md" ) ) ]

#![ allow( where_clauses_object_safety ) ] // https://github.com/chris-morgan/anymap/issues/31
// qqq : xxx : is it neccessary?

use mod_interface::mod_interface;

pub mod ca;
Expand Down
Loading