How-to guides¤
Solutions to specific problems, for people already using the package.
If you have never used it before, start with
Make your first formattable type
— these guides assume you know what pparts is. If you want the full list of
axes, keywords or constraints rather than steps, that is in the
reference.
Making your types renderable¤
- How to make a type formattable — the base
case: one
ppartsmethod and two short dunders, with theReprMixinshortcut at the end. -
How to nest formattable values — when your type holds other formattable values and must forward axes to them.
-
How to write a constructor-form repr — when
calllayout should print a constructor call and your type is not a dataclass.
Extending the grammar¤
- How to add an axis — when a spec needs to ask for something the engine has no word for, including sharing a word safely with another library.
- How to add a markup — when you need an output format beside text, HTML and LaTeX.
- How to render your own payload type — when you own the array or quantity inside a fragment and want to decide what a value format spec means for it.