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 Sep 2, 2024
1 parent b94a7d5 commit 008103f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 4 deletions.
15 changes: 12 additions & 3 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ scrollbar. Set `scrollbar` to `nil` value to disable the scrollbar.
# Methods

## Format Entry
`config.ui.menu.format_entry(entry: care.entry): { [1]: string, [2]: string }[][]`
`config.ui.menu.format_entry(entry: care.entry, data: care.format_data): { [1]: string, [2]: string }[][]`

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

Expand All @@ -235,7 +235,6 @@ text-highlight chunks like `:h nvim_buf_set_extmarks()` is used. You can create
sections which are represented by tables and can have a different alignment
each. This is specified with another field which takes a table with the
alignment of each section.

For example you want to have the label of an entry in a red highlight and an
icon in a entry-kind specific color left aligned first and then the source of
the entry right aligned in blue. You could do that like this:
Expand Down Expand Up @@ -334,4 +333,14 @@ The border of the documentation view
## Scrollbar
`config.ui.docs.scrollbar string`

Character used for the scrollbar
Character used for the scrollbar

Additional data passed to format function to allow more advanced formatting
# `care.format_data`

# Fields

## Index
`format_data.index integer`

Index of the entry in the completion menu
33 changes: 33 additions & 0 deletions docs/configuration_recipes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
title: Getting started
description: How to get started using care.nvim
---

# Configuration recipes

Here are some useful configurations for care.

## Labels and shortcuts

This configuration will add labels to your items and allow to select them with
`ctrl+label`.

```lua
local labels = {"1", "2", "3", "4", "5", "6", "7", "8", "9"}

-- Add this to formatting

{ {
" " .. require("care.presets.utils").LabelEntries(labels)(entry, data) .. " ",
"Comment",
}, },

-- Keymappings
for i, label in ipairs(labels) do
vim.keymap.set("i", "<c-"..label..">", function()
require("care").api.select_visible(i)
-- If you also want to confirm the entry
require("care").api.confirm()
end)
end
```
2 changes: 1 addition & 1 deletion docs/mappings.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Mappings
description: How mappings work in care.nvim
sidebar_position: 2
sidebar_position: 3
---

# Mappings
Expand Down

0 comments on commit 008103f

Please sign in to comment.