Skip to content

Commit

Permalink
chore(build): auto-generate vimdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
astronvimbot committed May 24, 2024
1 parent 0707cb4 commit 46c8c70
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 13 deletions.
24 changes: 18 additions & 6 deletions doc/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ function astrocore.rooter.bufpath(bufnr: integer)


```lua
function astrocore.rooter.detect(bufnr?: integer, all?: boolean)
function astrocore.rooter.detect(bufnr?: integer, all?: boolean, config?: AstroCoreRooterOpts)
-> detected: AstroCoreRooterRoot[]
```

Expand All @@ -744,6 +744,8 @@ function astrocore.rooter.detect(bufnr?: integer, all?: boolean)

*param* `all` — whether to return all roots or just one

*param* `config` — a rooter configuration (defaults to global configuration)

*return* `detected` — roots

### exists
Expand All @@ -764,23 +766,27 @@ function astrocore.rooter.exists(path: string)


```lua
function astrocore.rooter.info()
function astrocore.rooter.info(config?: AstroCoreRooterOpts)
```

Get information information about the current root

*param* `config` — a rooter configuration (defaults to global configuration)

### is_excluded


```lua
function astrocore.rooter.is_excluded(path: string)
function astrocore.rooter.is_excluded(path: string, config?: AstroCoreRooterOpts)
-> excluded: boolean
```

Check if a path is excluded

*param* `path` — the path

*param* `config` — a rooter configuration (defaults to global configuration)

*return* `excluded` — whether or not the path is excluded

### normpath
Expand Down Expand Up @@ -811,37 +817,43 @@ function astrocore.rooter.realpath(path?: string)


```lua
function astrocore.rooter.resolve(spec: string|fun(bufnr: integer):string|string[]|string[])
function astrocore.rooter.resolve(spec: string|fun(bufnr: integer):string|string[]|string[], config?: AstroCoreRooterOpts)
-> function
```

Resolve the root detection function for a given spec

*param* `spec` the root detector specification

*param* `config` the root configuration

### root


```lua
function astrocore.rooter.root(bufnr?: integer)
function astrocore.rooter.root(bufnr?: integer, config?: AstroCoreRooterOpts)
```

Run the root detection and set the current working directory if a new root is detected

*param* `bufnr` — the buffer to detect

*param* `config` — a rooter configuration (defaults to global configuration)

### set_pwd


```lua
function astrocore.rooter.set_pwd(root: AstroCoreRooterRoot)
function astrocore.rooter.set_pwd(root: AstroCoreRooterRoot, config?: AstroCoreRooterOpts)
-> success: boolean
```

Set the current directory to a given root

*param* `root` — the root to set the pwd to

*param* `config` — a rooter configuration (defaults to global configuration)

*return* `success` — whether or not the pwd was successfully set


Expand Down
26 changes: 19 additions & 7 deletions doc/astrocore.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
*astrocore.txt* For Neovim >= 0.9.0 Last change: 2024 May 13
*astrocore.txt* For Neovim >= 0.9.0 Last change: 2024 May 24

==============================================================================
Table of Contents *astrocore-table-of-contents*
Expand Down Expand Up @@ -1009,7 +1009,7 @@ _return_ `path` — the real path
DETECT ~

>lua
function astrocore.rooter.detect(bufnr?: integer, all?: boolean)
function astrocore.rooter.detect(bufnr?: integer, all?: boolean, config?: AstroCoreRooterOpts)
-> detected: AstroCoreRooterRoot[]
<

Expand All @@ -1019,6 +1019,8 @@ _param_ `bufnr` — the buffer to detect

_param_ `all` — whether to return all roots or just one

_param_ `config` — a rooter configuration (defaults to global configuration)

_return_ `detected` — roots


Expand All @@ -1039,23 +1041,27 @@ _return_ `exists` — whether or not the path exists
INFO ~

>lua
function astrocore.rooter.info()
function astrocore.rooter.info(config?: AstroCoreRooterOpts)
<

Get information information about the current root

_param_ `config` — a rooter configuration (defaults to global configuration)


IS_EXCLUDED ~

>lua
function astrocore.rooter.is_excluded(path: string)
function astrocore.rooter.is_excluded(path: string, config?: AstroCoreRooterOpts)
-> excluded: boolean
<

Check if a path is excluded

_param_ `path` — the path

_param_ `config` — a rooter configuration (defaults to global configuration)

_return_ `excluded` — whether or not the path is excluded


Expand Down Expand Up @@ -1086,38 +1092,44 @@ _return_ `the` — resolved path
RESOLVE ~

>lua
function astrocore.rooter.resolve(spec: string|fun(bufnr: integer):string|string[]|string[])
function astrocore.rooter.resolve(spec: string|fun(bufnr: integer):string|string[]|string[], config?: AstroCoreRooterOpts)
-> function
<

Resolve the root detection function for a given spec

_param_ `spec` — the root detector specification

_param_ `config` — the root configuration


ROOT ~

>lua
function astrocore.rooter.root(bufnr?: integer)
function astrocore.rooter.root(bufnr?: integer, config?: AstroCoreRooterOpts)
<

Run the root detection and set the current working directory if a new root is
detected

_param_ `bufnr` — the buffer to detect

_param_ `config` — a rooter configuration (defaults to global configuration)


SET_PWD ~

>lua
function astrocore.rooter.set_pwd(root: AstroCoreRooterRoot)
function astrocore.rooter.set_pwd(root: AstroCoreRooterRoot, config?: AstroCoreRooterOpts)
-> success: boolean
<

Set the current directory to a given root

_param_ `root` — the root to set the pwd to

_param_ `config` — a rooter configuration (defaults to global configuration)

_return_ `success` — whether or not the pwd was successfully set


Expand Down

0 comments on commit 46c8c70

Please sign in to comment.