cottax.consumers.visualization.naming module¶
How a drawing writes a name: the plain formatter, a name as shown, and its markup.
- type Notations = Mapping[type[Mint], Notation]¶
A formatter’s own notation per purpose, by its Mint class, over the `MintDrawing`s.
- notation_of(notations: Notations, m: Mint, medium: str, otherwise: str)[source]¶
m’s notation in medium (‘plain’, ‘latex’): the formatter’s own along its class’s ancestry, else its MintDrawing’s, else otherwise around its spelling.
- Return type:
- class CopyDrawing[source]¶
Bases:
MintDrawingA cut’s copy wears a hat: hat{y}.
- plain: AbstractVar[Notation] = Around()¶
- latex: AbstractVar[Notation] = Accent()¶
- class PlainFormat(notation: Notations | None = None)[source]¶
Bases:
FormatterEvery name by spell_plain, a minted one in its purpose’s notation (notation keyed by the Mint class, else its MintDrawing), else as <spelling>(·) – what a drawing writes unless told otherwise.
- type Shown = tuple[str, str | None]¶
What a drawing sets for a name: its markup, and the mark drawn over it (or None).
- MARKS = {'bar': '̄', 'dot': '̇', 'hat': '̂', 'tilde': '̃'}¶
Each mark as a combining character, for a medium that cannot draw it.
- shown(path: Label, formatter: Formatter)[source]¶
path as a drawing sets it: the formatter’s own name for it where it gives one (outright), else its namespace’s notation over what it stands for (recursively: a mint over a mint), else its spelling. Decided once, here, for every drawing.
- Return type:
- marked(name: Shown)[source]¶
A shown name as one run of markup, its mark a combining character on the first letter of its text – for a medium that cannot draw the mark itself.
- Return type:
str
- MARKUP = '\x01'¶
What a Formatter wraps around a spelling it has already set as markup.
<I>, <B>, <SUB>, <SUP>, <FONT FACE=”…”> and the XML entities are what a marked run may hold; any other tag is dropped and its text kept, so an unknown one is legible rather than fatal. x01 cannot occur in a name and never reaches the drawing.