FLM Feature flm.feature.markup

Custom text formatting macros and semantic block environments.

Provides a feature for defining macros that apply text format styles (e.g. bold, italic) and environments that render as semantic blocks with a given role and optional annotations.

class flm.feature.markup.FeatureMarkup(text_macros: Mapping[str, TypeTextMacroDef] | None = None, semantic_environments: Mapping[str, TypeSemanticEnvironmentDef] | None = None)

Bases: Feature

Feature for defining custom text formatting macros and semantic block environments. Text macros wrap content in one or more format styles; semantic environments render as block-level elements with a specified role.

feature_name: str | None = 'markup'

A name that should uniquely identify this feature.

feature_title: str | None = 'Mark up parts chunks of text to produce custom text formatting or custom environments'

Descriptive name or title for this feature.

feature_flm_doc = '\n    Feature that lets you define custom macros and environments that render as\n    custom text formatting macros or custom semantic blocks.\n    '
DocumentManager: Type[FeatureDocumentManagerBase] | None = None

The document manager class to use for this feature. Instances of this class will automatically be created when a new flmdocument.FLMDocument is instantiated. This class is expected to be a subclass of flm.feature.FeatureDocumentManagerBase. Alternatively, set this class attribute to None in your feature subclass to indicate that this feature does not need any document manager instance.

RenderManager: Type[FeatureRenderManagerBase] | None = None

The render manager class to use for this feature. Instances of this class will automatically be created when rendering a flmdocument.FLMDocument (see flm.flmdocument.FLMDocument.render(), and more specifically flm.flmdocument.FLMDocument.make_render_context()). This class is expected to be a subclass of flm.feature.FeatureRenderManagerBase. Alternatively, set this class attribute to None in your feature subclass to indicate that this feature does not need any document manager instance.

add_latex_context_definitions()
flm.feature.markup.FeatureClass = <class 'flm.feature.markup.FeatureMarkup'>

Feature for defining custom text formatting macros and semantic block environments. Text macros wrap content in one or more format styles; semantic environments render as block-level elements with a specified role.