FLM Feature flm.feature.href

Provides hyperlink macros for FLM.

Defines the \href, \url, and \email macros for creating clickable hyperlinks, bare URLs, and mailto links respectively. Display text is rendered as a pretty URL when not explicitly provided.

class flm.feature.href.HrefHyperlinkMacro(macroname, *, command_arguments=('target_href', 'target_email', 'display_text'), ref_type='href')

Bases: FLMMacroSpecBase

allowed_in_standalone_mode: bool = True

Whether or not this node is allowed in standalone mode, i.e., whether or not this node can be rendered independently of any document object.

classmethod pretty_url(target_href)

Return a human-friendly display form of target_href.

Strips common protocol prefixes (http://, https://, mailto:) and trailing /, #, ? characters.

Parameters:

target_href – The full URL or href string.

Returns:

Prettified URL string suitable for display.

postprocess_parsed_node(node)
render(node, render_context)
recompose_pure_latex(node, recomposer)
class flm.feature.href.FeatureHref

Bases: SimpleLatexDefinitionsFeature

Feature providing \href, \url, and \email hyperlink macros.

URLs without explicit display text are shown using a prettified form (protocol prefix and trailing punctuation stripped). Supports pure-LaTeX recomposition with optional macro name remapping.

feature_name: str | None = 'href'

A name that should uniquely identify this feature.

feature_title: str | None = 'Hyperlinks'

Descriptive name or title for this feature.

latex_definitions: TypeDictWithLatexContextDefinitions = {'macros': [HrefHyperlinkMacro(arguments_spec_list=[LatexArgumentSpec(argname='target_href', parser=<LatexDelimitedVerbatimParser>, parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False)), LatexArgumentSpec(argname='display_text', parser='{', parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='href', arguments_parser=<LatexArgumentsParser>, command_arguments=('target_href', 'display_text'), ref_type='href', command_argnames=['target_href', 'display_text']), HrefHyperlinkMacro(arguments_spec_list=[LatexArgumentSpec(argname='target_href', parser=<LatexDelimitedVerbatimParser>, parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='url', arguments_parser=<LatexArgumentsParser>, command_arguments=('target_href',), ref_type='href', command_argnames=['target_href']), HrefHyperlinkMacro(arguments_spec_list=[LatexArgumentSpec(argname='target_email', parser=<LatexDelimitedVerbatimParser>, parsing_state_delta=FLMParsingStateDeltaSetBlockLevel(is_block_level=False))], macroname='email', arguments_parser=<LatexArgumentsParser>, command_arguments=('target_email',), ref_type='href', command_argnames=['target_email'])]}

Set to a dictionary with one or more of the keys (‘macros’, ‘environments’, ‘specials’), whose corresponding values are lists of FLMMacroSpec, FLMEnvironmentSpec, and FLMSpecialsSpec instances.

HrefHyperlinkMacroClass

alias of HrefHyperlinkMacro

flm.feature.href.FeatureClass = <class 'flm.feature.href.FeatureHref'>

Feature providing \href, \url, and \email hyperlink macros.

URLs without explicit display text are shown using a prettified form (protocol prefix and trailing punctuation stripped). Supports pure-LaTeX recomposition with optional macro name remapping.