Skip to main content

Crate mant_core

Crate mant_core 

Source
Expand description

Manual source, query, and output engine independent from its process hosts.

Structs§

CommandOutput
Minimal subprocess result used by deterministic source-locator tests.
ManualRequest
One validated manual lookup independent from CLI token syntax.
MarkdownOptions
Markdown serialization controls that do not alter the query AST.
ParsedMarkdown
Complete result of parsing one ManT-flavoured Markdown input.
QueryPolicy
Host execution policy kept outside the serialized request contract.
SystemCommandRunner
Production runner backed by std::process::Command.
TldrPageLocation
Source identity attached to a parsed tldr page.

Enums§

HostPlatform
Native host families supported by ManT distributions.
LocateError
Expected source-discovery failures suitable for a user-facing CLI error.
MarkdownParseError
Invalid structure in ManT’s optional top-level Markdown extension.
ProjectionError
Failure to derive an addressable view from a complete query.
QueryError
A query cannot produce either authoritative manual content or a quick reference.
SearchError
Invalid search input or matcher construction.
TldrCacheError
Offline cache discovery or page-read failure.
TldrDirectiveError
TldrParseError
A tldr page lacks the minimum structure required by the contract.
TldrUpdateError
Failure to refresh an installed client or ManT’s private checkout.

Constants§

MAX_MARKDOWN_BYTES
Upper bound on a single Markdown source, shared by every input path.

Traits§

CommandRunner
Injectable boundary around process execution.

Functions§

build_outline
Build a block-free, addressable outline for one complete query.
build_outline_with_detail
Build an outline with optional semantic definition entries.
get_system_tldr_cache_dirs
Return known installed-client cache roots in priority order.
get_tldr_cache_dir
Resolve the ManT-owned fallback checkout for an explicit environment.
get_tldr_languages
Resolve locale candidates, retaining first occurrence priority.
get_tldr_platforms
Resolve host, common, then cross-platform fallback page directories.
get_tldr_read_cache_dirs
Select installed-client caches or ManT’s private fallback checkout.
locate_manual_source
Locate a manual through the host’s configured man database.
locate_manual_source_with
Injectable form of locate_manual_source used by native unit tests.
lower_mandoc_document
Convert a completed low-level parse into the stable document contract.
native_api_version
Reports the native contract version through the engine layer.
normalize_tldr_topic
Convert a multi-word query to the tldr filename convention.
parse_groff_html
Normalize one complete man -Thtml document into ManT’s stable AST.
parse_manual_source
Parse and normalize one located man or mdoc source file.
parse_markdown
Split ManT’s optional leading tldr directive from the Markdown document.
parse_tldr_command
Parse the tldr placeholder extension and choose the long option variant.
parse_tldr_page
Parse one tldr Markdown page without performing any I/O.
query
Query the local man database and optional offline tldr caches.
query_markdown_text
Parse in-memory Markdown for the direct mant - command.
query_with_policy
Query with an explicit host policy such as native-parser-only diagnostics.
read_cached_tldr_page
Read one cached tldr page using current host conventions; never updates it.
render_excerpt_json
Serialize selected query nodes in compact or human-readable form.
render_excerpt_markdown
Render selected query nodes with their outline context.
render_excerpt_markdown_with_options
Render selected nodes using explicit presentation-only options.
render_excerpt_text
Render selected query nodes as unstyled text with outline context.
render_markdown
Render a complete query as clean Markdown without a trailing newline.
render_markdown_with_options
Render a complete query using explicit presentation-only options.
render_outline_json
Serialize a complete query outline in compact or human-readable form.
render_outline_markdown
Render a complete query outline as a nested CommonMark list.
render_outline_text
Render a complete query outline as a copyable Unicode tree.
render_query_json
Serialize a query contract in compact or human-readable form.
render_query_man
Render the manual as man(1)-faithful plain text.
render_query_text
Render a complete query without Markdown or terminal escape sequences.
render_search_json
Serialize structure-aware search results in compact or human-readable form.
render_search_markdown
Render a readable Markdown report whose coordinates target the full page.
render_search_text
Render grep-like results with stable Markdown coordinates and node paths.
render_update_json
Serialize the explicit tldr update result for a process boundary.
search_query
Search one complete query and report coordinates in its canonical Markdown.
select_excerpt
Select tldr, document-root content, or complete section subtrees by path or ID.
update_tldr_cache
Refresh tldr through an installed client or ManT’s private Git checkout.
validate_search_query
Validate search limits and compile its matcher without loading a manual.