-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a2eceea
commit 3d95976
Showing
3 changed files
with
109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
--- | ||
title: Preset Components | ||
description: Type description of care.preset_components | ||
--- | ||
|
||
# Preset Components | ||
|
||
This module contains some high-level components for easily creating `format_entry` functions. | ||
# `care.preset_components` | ||
|
||
# Methods | ||
|
||
## ShortcutLabel | ||
`preset_components.ShortcutLabel(labels: string[], entry: care.entry, data: care.format_data, highlight_group?: string): { [1]: string, [2]: string }[]` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
This adds a label for shortcuts [described here](/configuration_recipes#labels-and-shortcuts). By default this will | ||
use the `Comment` highlight group. This can be overridden though. | ||
|
||
## KindIcon | ||
`preset_components.KindIcon(entry: care.entry, style?: "blended"|"fg"): { [1]: string, [2]: string }[]` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
This components displays a kind icon. You can choose between the blended and foreground style. | ||
|
||
## Label | ||
`preset_components.Label(entry: care.entry, data: care.format_data, display_colored_block?: boolean): { [1]: string, [2]: string }[]` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
This adds a completion item label to be displayed. Optionally this can also include a colored block if the items | ||
is a color and we know the value of the color. | ||
|
||
## ColoredBlock | ||
`preset_components.ColoredBlock(entry: care.entry, character?: string): { [1]: string, [2]: string }[]` | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Preset Utils | ||
description: Type description of care.preset_utils | ||
--- | ||
|
||
# Preset Utils | ||
|
||
This module contains lower level utilities for the presets and the preset components. | ||
# `care.preset_utils` | ||
|
||
# Methods | ||
|
||
## Label Entries | ||
`preset_utils.label_entries(labels: string[]): fun(_,data: care.format_data): string` | ||
|
||
This function can be used to get a function to label the entries with shortscuts as [described | ||
here](/configuration_recipes#labels-and-shortcuts). | ||
|
||
## Get Color | ||
`preset_utils.get_color(entry: care.entry): string?` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
With this function you can get a color if the entry is a color and the hex color code is available in the | ||
completion item. | ||
|
||
## Get Highlight For Hex | ||
`preset_utils.get_highlight_for_hex(hex: string): string` | ||
|
||
This function allows to get a highlight group for a certain hex color code. This is useful because like that the | ||
user doesn't have to constantly create new highlight groups to apply a hex value to a certain thing. The | ||
highlight group will have the hex value as foregroung color. | ||
|
||
## Kind Highlight | ||
`preset_utils.kind_highlight(entry: care.entry, style: "fg"|"blended")` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
With this function you can get the kind highlight group for a specific entry. The style can either be foreground | ||
or blended. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
--- | ||
title: Presets | ||
description: Type description of care.presets | ||
--- | ||
|
||
# Presets | ||
|
||
In this module some presets for the format_entry function are available. | ||
# `care.presets` | ||
|
||
# Methods | ||
|
||
## Default | ||
`presets.Default(entry: care.entry, data: care.format_data): { [1]: string, [2]: string }[][]` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
The default preset. Just includes the label and a simple icon. | ||
|
||
## Atom | ||
`presets.Atom(entry: care.entry, data: care.format_data): { [1]: string, [2]: string }[][]` | ||
|
||
See [care.entry](/dev/entry) | ||
|
||
The atom preset is an atom-like configuration. It displays the kind icon with a blended colored background and | ||
the labelatom preset is an atom-like configuration. It displays the kind icon with a blended colored background | ||
and the label. |