Skip to content

Commit

Permalink
docs(cookbook.md): add docs for more base methods and attrs
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelot committed Feb 7, 2022
1 parent 002eefd commit 05d0e13
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions cookbook.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
- [Main concepts](#main-concepts)
- [Component fields](#component-fields)
- [The StatusLine life cycle](#the-statusline-life-cycle)
- [StatusLine Base Methods](#statusline-base-methods)
- [StatusLine Base Methods and Attributes](#statusline-base-methods-and-attributes)
- [Builtin conditions and utilities](#builtin-conditions-and-utilities)
- [Recipes](#recipes)
- [Getting started](#getting-started)
Expand Down Expand Up @@ -177,10 +177,10 @@ refreshed.

Confused yet? Don't worry, everything will come together in the [Recipes](#recipes) examples.

### StatusLine Base Methods
### StatusLine Base Methods and Attributes

You'll probably never need those, however, for completeness, it's worth
explaining the `StatusLine` object base methods:
explaining the `StatusLine` object base methods and attributes:

- `new(self, child)`: This is the constructor that takes in the `child`
"blueprint" and returns a new `StatusLine` object. This function is
Expand All @@ -198,6 +198,13 @@ explaining the `StatusLine` object base methods:
parent's attributes, ignoring what was passed to them by inheritance.
- `local_(self, attr)`: Return the value of `attr` only if it is defined for
the component itself, do not look in the parent's metatables.
- `broadcast(self, func)`: Execute `func(component)` on every component of the
statusline.
- `get(self, id)`: Get a handle of the component with the given `id`
- `id`: Table containing the indices required to index the component from the
root.
- `{set,get}_win_attr(self, attr, default)`: Set or get a window-local
component attribute. If the attribute is not defined, sets a default value.

## Builtin conditions and utilities

Expand Down

0 comments on commit 05d0e13

Please sign in to comment.