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 Aug 17, 2024
1 parent d5dc03a commit 63ec294
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 3 deletions.
14 changes: 11 additions & 3 deletions docs/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
title: Config
description: Configuration for care.nvim
---
# Config


<details>
<summary>Full Default Config</summary>
Expand Down Expand Up @@ -94,9 +94,10 @@ config.defaults = {
```

</details>
# Config

The config of care is used to configure the ui and care itself.
---

There are two main parts to the config. The first one is the `ui` field and the
second on is the rest of the configuration which is for configuring the general
behavior of care.
Expand Down Expand Up @@ -172,6 +173,7 @@ and what to remove if insert text is used.
`config.preselect boolean`

Whether items should be preselected or not

# Ui Configuration
The main class for the ui configuration of care.nvim
# `care.config.ui`
Expand Down Expand Up @@ -199,6 +201,7 @@ This is a table which defines the different icons.
`config.ui.ghost_text care.config.ui.ghost_text`

Configuration of ghost text

Configuration for the ghost text
# `care.config.ui.ghost_text`

Expand All @@ -216,9 +219,10 @@ the text will overlap with existing text after the cursor.
`config.ui.ghost_text.position "inline"|"overlay"`



This configuration should allow you to completely adapt the completion menu to
your likings.
---

It includes some basic window properties like the border and the maximum height
of the window. It also has a field to define the character used for the
scrollbar. Set `scrollbar` to `nil` value to disable the scrollbar.
Expand All @@ -228,6 +232,7 @@ scrollbar. Set `scrollbar` to `nil` value to disable the scrollbar.

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

Another field is `format_entry`. This is a function which recieves an entry of
the completion menu and determines how it's formatted. For that a table with
Expand Down Expand Up @@ -283,6 +288,7 @@ If the menu should be displayed on top, bottom or automatically

How the sections in the menu should be aligned


# `care.config.source`

# Methods
Expand All @@ -294,6 +300,7 @@ Whether the source is enabled (default true)

## Filter
`config.source.filter(entry: care.entry): boolean`
See: [care.entry](/dev/entry)

Filter function for entries by the source
# Fields
Expand All @@ -307,6 +314,7 @@ The maximum amount of entries which can be displayed by this source
`config.source.priority integer?`

The priority of this source. Is more important than matching score

Configuration of the completion menu of care.nvim
# `care.config.ui.docs`

Expand Down
6 changes: 6 additions & 0 deletions docs/dev/context.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Context
description: Type description of care.context, care.context.cursor
---

# Context

This is a class representing the current state. It includes buffer number and
Expand All @@ -12,12 +13,14 @@ cursor position. It is passed to completion sources to get completions.

## Changed
`context.changed(care.context): boolean`
See: [care.context](/dev/context)

Whether the context changed in comparison to the previous one. This is used to
check whether to get new completions or not when using autocompletion.

## New
`Context.new(previous: care.context?): care.context`
See: [care.context](/dev/context)

Create a new context. This takes a previous context as argument. This one is
stored to determine if the context changed or not when completing. The previous
Expand All @@ -27,13 +30,15 @@ really large.

## Previous
`context.previous care.context?`
See: [care.context](/dev/context)

The previous context which is used to determine whether the context changed or
not. The `previous` field of the previous context should always be `nil` so the
data structure doesn't grow infinitely.

## Cursor
`context.cursor care.context.cursor`
See: [care.context](/dev/context)

The cursor position. This will have a `col` and a `row` field and has 1-based
line and 0-based column indexes. This is the same as in
Expand All @@ -60,6 +65,7 @@ The complete line on which the cursor was when the context was created.

The line before the cursor. This is mostly important to be correct in insert
mode. In normal mode the character on which the cursor is is not included.

A cursor position
# `care.context.cursor`

Expand Down
4 changes: 4 additions & 0 deletions docs/dev/core.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Core
description: Type description of care.core
---

# Core

This module is for the core of care. Here everything comes together with the
Expand All @@ -12,6 +13,7 @@ most important things being the menu being opened and the completion triggered.

## New
`Core.new(): care.core`
See: [care.core](/dev/core)

Use this function to create a new instance. It takes no arguments and should be
called only once when the plugin is first set up.
Expand Down Expand Up @@ -52,12 +54,14 @@ Filter currently visible menu. This is used when moving the cursor.

## Context
`core.context care.context`
See: [care.context](/dev/context)

This is used to store the current context. There is always a new one created in
`on_change` and compared to see if it changed.

## Menu
`core.menu care.menu`
See: [care.menu](/dev/menu)

In this field a menu instance which is used in core is stored.

Expand Down
4 changes: 4 additions & 0 deletions docs/dev/entry.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Entry
description: Type description of care.entry
---

# Entry

Entries are the basic items in the completion menu. Arguably the most important field is the
Expand All @@ -12,6 +13,7 @@ completion item for which the lsp type is used.

## New
`Entry.new(completion_item: lsp.CompletionItem, source: care.internal_source, context: care.context): care.entry`
See: [care.entry](/dev/entry), [care.context](/dev/context), [care.internal_source](/dev/internal_source)

The new function is the constructor for a new completion entry.

Expand Down Expand Up @@ -57,12 +59,14 @@ Gets the default range for entry (if there is no textEdit)

## Source
`entry.source care.internal_source`
See: [care.internal_source](/dev/internal_source)

This is the source from which the entry came. This is important for using the right keyword
pattern and getting the right offset.

## Context
`entry.context care.context`
See: [care.context](/dev/context)

This is the context in which the entry was completed. This is important to now what context text-
edits of the entry target.
Expand Down
5 changes: 5 additions & 0 deletions docs/dev/internal_source.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Internal Source
description: Type description of care.internal_source
---

# Internal Source

The internal sources are used on top of [completion sources](#source) to store additional
Expand All @@ -12,6 +13,7 @@ metadata about which the source author doesn't have to care and sometimes can't

## New
`Internal_source.new(completion_source: care.source): care.internal_source`
See: [care.internal_source](/dev/internal_source), [care.source](/dev/source)

This function creates a new instance.

Expand All @@ -23,6 +25,7 @@ method to get it and as fallback the one from the config.

## Get Offset
`internal_source:get_offset(context: care.context): integer`
See: [care.context](/dev/context)

With this function the offset of the source is determined. The offset describes at which point
the completions for this source start. This is required to be able to remove that text if needed
Expand All @@ -42,11 +45,13 @@ This function checks whether the function is enabled or not based on it's config

## Source
`internal_source.source care.source`
See: [care.source](/dev/source)

This field is used to store the source written by the source author.

## Entries
`internal_source.entries care.entry[]`
See: [care.entry](/dev/entry)

In the entries field entries gotten from the source are stored. This is used to be able to sort
and filter the entries when not getting new ones.
Expand Down
8 changes: 8 additions & 0 deletions docs/dev/menu.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Menu
description: Type description of care.menu
---

# Menu

This is the main class of the care completion menu. The menu is used to display
Expand All @@ -13,6 +14,7 @@ completions.

## New
`Menu.new(): care.menu`
See: [care.menu](/dev/menu)

Creates a new instance of the completion menu.

Expand Down Expand Up @@ -44,6 +46,7 @@ This function is used to select the previous entry analogous to

## Open
`menu:open(entries: care.entry[], offset: integer): nil`
See: [care.entry](/dev/entry)

The `open` function is used to open the completion menu with a specified set of
entries. This includes opening the window and displaying the text.
Expand All @@ -55,6 +58,7 @@ This function closes the menu and resets some internal things.

## Get Active Entry
`menu:get_active_entry(): care.entry?`
See: [care.entry](/dev/entry)

With this function you can get the currently selected entry. This can be used
for the docs view or some other api functions. It is also used when the
Expand All @@ -68,6 +72,7 @@ the selected entry closes the menu and completes.

## Complete
`menu:complete(entry: care.entry): nil`
See: [care.entry](/dev/entry)

This function completes with a given entry. That means it removes text used for
filtering (if necessary), expands snippet with the configured function, applies
Expand All @@ -91,11 +96,13 @@ Scroll up or down in the docs window by `delta` lines.

## Menu Window
`menu.menu_window care.window`
See: [care.window](/dev/window)

Wrapper for utilities for the window of the menu

## Docs Window
`menu.docs_window care.window`
See: [care.window](/dev/window)

Wrapper for utilities for the window of the docs

Expand All @@ -106,6 +113,7 @@ The ghost text instance used to draw the ghost text.

## Entries
`menu.entries care.entry[]`
See: [care.entry](/dev/entry)

This field is used to store all the entries of the completion menu.

Expand Down
1 change: 1 addition & 0 deletions docs/dev/source.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Source
description: Type description of care.source
---

# Source

The sources are used to get get completions for care.nvim.
Expand Down
4 changes: 4 additions & 0 deletions docs/dev/window.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
title: Window Util
description: Type description of care.window, care.window.data
---

# Window Util

Utility class for working with windows in care
Expand All @@ -11,6 +12,7 @@ Utility class for working with windows in care

## New
`Window.new(): care.window`
See: [care.window](/dev/window)

Creates a new instance of the menu window

Expand Down Expand Up @@ -61,6 +63,7 @@ Change scroll of window

## Get Data
`window:get_data(): care.window.data`
See: [care.window](/dev/window)


# Fields
Expand Down Expand Up @@ -110,6 +113,7 @@ Namespace used for setting extmarks

Current scroll of the window


# `care.window.data`

# Fields
Expand Down

0 comments on commit 63ec294

Please sign in to comment.