Skip to content

Commit

Permalink
chore(build): auto-generate docs
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 13, 2024
1 parent 6c490bd commit 360541a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
18 changes: 17 additions & 1 deletion docs/preset_components.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,20 @@ See [care.entry](/dev/entry)

This component adds a colored block for the item if it is a color. The character used for the block can
optionally be configured.
![image](https://github.com/user-attachments/assets/e6bf8620-92af-4ffa-8973-635cab7beec4)
![image](https://github.com/user-attachments/assets/e6bf8620-92af-4ffa-8973-635cab7beec4)

## Padding
`preset_components.Padding(size: integer): { [1]: string, [2]: string }[]`

This function is used to add padding. Use the parameter to determine the width.

## KindName
`preset_components.KindName(entry: care.entry, use_kind_color: boolean, highlight_group: string?): { [1]: string, [2]: string }[]`

See [care.entry](/dev/entry)

This component allows to display the kind of the completion item as a string. You can use the second parameter
to choose whether the string should be highlighted with the color of the kind or if it should just use a given
highlight group which can be given with the 3rd parameter.
![image](https://github.com/user-attachments/assets/4ceb2b54-50af-4459-96af-d485bba6ba3a)
![image](https://github.com/user-attachments/assets/fb5ecb19-1009-4249-af6f-6a2ccb7873fc)
8 changes: 6 additions & 2 deletions docs/presets.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,21 @@ format_entry = function(entry, data)
return require("care.presets").<preset_name>(entry, data)
end
```
You could also just use the shorter form
```lua
format_entry = require("care.presets").<preset_name>
```
# `care.presets`

# Methods

## Default
`presets.Default`
The default preset. Just includes the label and a simple icon.
![image](https://github.com/user-attachments/assets/d3d7d338-db32-471f-ae20-89ea7703cb55)
![image](https://github.com/user-attachments/assets/962a3bc3-72d8-413b-9b02-90e43e7bced8)

## Atom
`presets.Atom`
The atom preset is an atom-like configuration. It displays the kind icon with a blended colored background and
the label.
![image](https://github.com/user-attachments/assets/f8715fa7-1a0e-4be9-85ae-14b85cc2b7fd)
![image](https://github.com/user-attachments/assets/cb653979-ca57-49c8-ae23-510be1496a5c)

0 comments on commit 360541a

Please sign in to comment.