Skip to content

Commit

Permalink
docs: adapt gendoc config
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestrew committed Aug 2, 2024
1 parent ed5f89c commit 9e06f14
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 68 deletions.
104 changes: 50 additions & 54 deletions doc/telescope-file-browser.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
==============================================================================
_EXTENSIONS_FILE_BROWSER *telescope-file-browser._extensions_file_browser*
TELESCOPE-FILE-BROWSER.NVIM *telescope-file-browser*

`telescope-file-browser.nvim` is an extension for telescope.nvim. It helps you
efficiently create, delete, rename, or move files powered by navigation from
Expand Down Expand Up @@ -64,7 +64,7 @@ Extends |telescope-file-browser.PickerOpts|
implementation details By default,

==============================================================================
_EXTENSIONS_FILE_BROWSER_PICKER*telescope-file-browser._extensions_file_browser_picker*
PICKER *telescope-file-browser.picker*

You can use the file browser as follows >lua
vim.keymap.set(
Expand Down Expand Up @@ -189,16 +189,16 @@ Extends |telescope.picker.opts|
the file browser


*telescope-file-browser._extensions_file_browser_picker.file_browser()*
_extensions_file_browser_picker.file_browser({opts})
*telescope-file-browser.picker.file_browser()*
fb_picker.file_browser({opts})
Create a new file browser picker.

Parameters: ~
{opts} (`telescope-file-browser.PickerOpts?`) options to pass to the
picker. See |telescope-file-browser.PickerOpts|

==============================================================================
_EXTENSIONS_FILE_BROWSER_ACTIONS*telescope-file-browser._extensions_file_browser_actions*
ACTIONS *telescope-file-browser.actions*

The file browser actions are functions enable file system operations from
within the file browser picker. In particular, the actions include creation,
Expand All @@ -223,8 +223,8 @@ You can remap actions as follows: >lua
}
<

*telescope-file-browser._extensions_file_browser_actions.create()*
_extensions_file_browser_actions.create({prompt_bufnr})
*telescope-file-browser.actions.create()*
fb_actions.create({prompt_bufnr})
Creates a new file or dir in the current directory of the
|telescope-file-browser.picker.file_browser|.
• Finder:
Expand All @@ -239,8 +239,8 @@ _extensions_file_browser_actions.create({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.create_from_prompt()*
_extensions_file_browser_actions.create_from_prompt({prompt_bufnr})
*telescope-file-browser.actions.create_from_prompt()*
fb_actions.create_from_prompt({prompt_bufnr})
Creates a new file or dir via prompt in the current directory of the
|telescope-file-browser.picker.file_browser|.
• Notes:
Expand All @@ -252,8 +252,8 @@ _extensions_file_browser_actions.create_from_prompt({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.rename()*
_extensions_file_browser_actions.rename({prompt_bufnr})
*telescope-file-browser.actions.rename()*
fb_actions.rename({prompt_bufnr})
Rename files or folders for |telescope-file-browser.picker.file_browser|.

Notes:
Expand All @@ -265,8 +265,7 @@ _extensions_file_browser_actions.rename({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.move()*
_extensions_file_browser_actions.move({prompt_bufnr})
fb_actions.move({prompt_bufnr}) *telescope-file-browser.actions.move()*
Move multi-selected files or folders to current directory in
|telescope-file-browser.picker.file_browser|.
• Notes:
Expand All @@ -278,8 +277,7 @@ _extensions_file_browser_actions.move({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.copy()*
_extensions_file_browser_actions.copy({prompt_bufnr})
fb_actions.copy({prompt_bufnr}) *telescope-file-browser.actions.copy()*
Copy file or folders recursively to current directory in
|telescope-file-browser.picker.file_browser|.
• Finder:
Expand All @@ -291,8 +289,8 @@ _extensions_file_browser_actions.copy({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.remove()*
_extensions_file_browser_actions.remove({prompt_bufnr})
*telescope-file-browser.actions.remove()*
fb_actions.remove({prompt_bufnr})
Remove file or folders recursively for
|telescope-file-browser.picker.file_browser|.

Expand All @@ -301,23 +299,22 @@ _extensions_file_browser_actions.remove({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.toggle_hidden()*
_extensions_file_browser_actions.toggle_hidden({prompt_bufnr})
*telescope-file-browser.actions.toggle_hidden()*
fb_actions.toggle_hidden({prompt_bufnr})
Toggle hidden files or folders for
|telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.toggle_respect_gitignore()*
_extensions_file_browser_actions.toggle_respect_gitignore({prompt_bufnr})
*telescope-file-browser.actions.toggle_respect_gitignore()*
fb_actions.toggle_respect_gitignore({prompt_bufnr})
Toggle respect_gitignore for |telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.open()*
_extensions_file_browser_actions.open()
fb_actions.open() *telescope-file-browser.actions.open()*
Opens the file or folder with the default application.
• Notes:
• map fb_actions.open + fb_actions.close if you want to close the picker
Expand All @@ -328,48 +325,48 @@ _extensions_file_browser_actions.open()
• Windows: defaults to default applications through `start` @pram
prompt_bufnr number: The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.goto_parent_dir()*
_extensions_file_browser_actions.goto_parent_dir({prompt_bufnr}, {bypass})
*telescope-file-browser.actions.goto_parent_dir()*
fb_actions.goto_parent_dir({prompt_bufnr}, {bypass})
Goto parent directory in |telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr
{bypass} (`boolean`) Allow passing beyond the globally set
current working directory

*telescope-file-browser._extensions_file_browser_actions.goto_cwd()*
_extensions_file_browser_actions.goto_cwd({prompt_bufnr})
*telescope-file-browser.actions.goto_cwd()*
fb_actions.goto_cwd({prompt_bufnr})
Goto working directory of nvim in
|telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.change_cwd()*
_extensions_file_browser_actions.change_cwd({prompt_bufnr})
*telescope-file-browser.actions.change_cwd()*
fb_actions.change_cwd({prompt_bufnr})
Change working directory of nvim to the selected file/folder in
|telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.goto_home_dir()*
_extensions_file_browser_actions.goto_home_dir({prompt_bufnr})
*telescope-file-browser.actions.goto_home_dir()*
fb_actions.goto_home_dir({prompt_bufnr})
Goto home directory in |telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.toggle_browser()*
_extensions_file_browser_actions.toggle_browser({prompt_bufnr})
*telescope-file-browser.actions.toggle_browser()*
fb_actions.toggle_browser({prompt_bufnr})
Toggle between file and folder browser for
|telescope-file-browser.picker.file_browser|.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.toggle_all()*
_extensions_file_browser_actions.toggle_all({prompt_bufnr})
*telescope-file-browser.actions.toggle_all()*
fb_actions.toggle_all({prompt_bufnr})
Toggles all selections akin to |telescope.actions.toggle_all| but ignores
parent & current directory
• Note: if the parent or current directory were selected, they will be
Expand All @@ -378,8 +375,8 @@ _extensions_file_browser_actions.toggle_all({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.select_all()*
_extensions_file_browser_actions.select_all({prompt_bufnr})
*telescope-file-browser.actions.select_all()*
fb_actions.select_all({prompt_bufnr})
Multi select all entries akin to |telescope.actions.select_all| but
ignores parent & current directory
• Note:
Expand All @@ -390,49 +387,49 @@ _extensions_file_browser_actions.select_all({prompt_bufnr})
Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.sort_by_size()*
_extensions_file_browser_actions.sort_by_size({prompt_bufnr})
*telescope-file-browser.actions.sort_by_size()*
fb_actions.sort_by_size({prompt_bufnr})
Toggle sorting by size of the entry.
Note: initially sorts descendingly in size.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.sort_by_date()*
_extensions_file_browser_actions.sort_by_date({prompt_bufnr})
*telescope-file-browser.actions.sort_by_date()*
fb_actions.sort_by_date({prompt_bufnr})
Toggle sorting by last change to the entry.
Note: initially sorts desendingly from most to least recently changed
entry.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.backspace()*
_extensions_file_browser_actions.backspace({prompt_bufnr}, {bypass})
*telescope-file-browser.actions.backspace()*
fb_actions.backspace({prompt_bufnr}, {bypass})
If the prompt is empty, goes up to parent dir. Otherwise, acts as normal.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr
{bypass} (`boolean`) Allow passing beyond the globally set
current working directory

*telescope-file-browser._extensions_file_browser_actions.path_separator()*
_extensions_file_browser_actions.path_separator({prompt_bufnr})
*telescope-file-browser.actions.path_separator()*
fb_actions.path_separator({prompt_bufnr})
When a path separator is entered, navigate to the directory in the prompt.

Parameters: ~
• {prompt_bufnr} (`number`) The prompt bufnr

*telescope-file-browser._extensions_file_browser_actions.open_dir()*
_extensions_file_browser_actions.open_dir({prompt_bufnr}, {_}, {dir})
*telescope-file-browser.actions.open_dir()*
fb_actions.open_dir({prompt_bufnr}, {_}, {dir})
Open directory and refresh picker

Parameters: ~
• {prompt_bufnr} (`integer`)
{dir} (`string?`) priority dir path

==============================================================================
_EXTENSIONS_FILE_BROWSER_FINDERS*telescope-file-browser._extensions_file_browser_finders*
FINDERS *telescope-file-browser.finders*

The file browser finders power the picker with both a file and folder browser.

Expand All @@ -444,8 +441,8 @@ Extends |telescope-file-browser.PickerOpts|
finder (advanced)


*telescope-file-browser._extensions_file_browser_finders.browse_files()*
_extensions_file_browser_finders.browse_files({opts})
*telescope-file-browser.finders.browse_files()*
fb_finders.browse_files({opts})
Returns a finder that is populated with files and folders in `path` .
• Notes:
• Uses `fd` if available for more async-ish browsing and speed-ups
Expand All @@ -454,8 +451,8 @@ _extensions_file_browser_finders.browse_files({opts})
{opts} (`telescope-file-browser.FinderOpts?`) options to pass to the
finder. See |telescope-file-browser.FinderOpts|

*telescope-file-browser._extensions_file_browser_finders.browse_folders()*
_extensions_file_browser_finders.browse_folders({opts})
*telescope-file-browser.finders.browse_folders()*
fb_finders.browse_folders({opts})
Returns a finder that is populated with (sub-)folders of `cwd` .
• Notes:
• Uses `fd` if available for more async-ish browsing and speed-ups
Expand All @@ -464,8 +461,7 @@ _extensions_file_browser_finders.browse_folders({opts})
{opts} (`telescope-file-browser.FinderOpts?`) options to pass to the
finder. See |telescope-file-browser.FinderOpts|

*telescope-file-browser._extensions_file_browser_finders.finder()*
_extensions_file_browser_finders.finder({opts})
fb_finders.finder({opts}) *telescope-file-browser.finders.finder()*
Returns a finder that combines |fb_finders.browse_files| and
|fb_finders.browse_folders| into a unified finder.

Expand Down
1 change: 0 additions & 1 deletion lua/telescope/_extensions/file_browser/actions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ local popup = require "plenary.popup"
local scan = require "plenary.scandir"
local async = require "plenary.async"

---@package
local fb_actions = setmetatable({}, {
__index = function(_, k)
error("Key does not exist for 'fb_actions': " .. tostring(k))
Expand Down
37 changes: 24 additions & 13 deletions scripts/gendocs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,29 @@ load(vim.fn.system "curl -s https://raw.githubusercontent.com/jamestrew/docgen.n
require("docgen").run {
name = "telescope-file-browser",
files = {
"./lua/telescope/_extensions/file_browser.lua",
"./lua/telescope/_extensions/file_browser/picker.lua",
"./lua/telescope/_extensions/file_browser/actions.lua",
"./lua/telescope/_extensions/file_browser/finders.lua",
{
"./lua/telescope/_extensions/file_browser.lua",
title = "TELESCOPE-FILE-BROWSER.NVIM",
tag = "telescope-file-browser",
fn_prefix = "file_browser",
},
{
"./lua/telescope/_extensions/file_browser/picker.lua",
title = "PICKER",
tag = "telescope-file-browser.picker",
fn_prefix = "fb_picker",
},
{
"./lua/telescope/_extensions/file_browser/actions.lua",
title = "ACTIONS",
tag = "telescope-file-browser.actions",
fn_prefix = "fb_actions",
},
{
"./lua/telescope/_extensions/file_browser/finders.lua",
title = "FINDERS",
tag = "telescope-file-browser.finders",
fn_prefix = "fb_finders",
},
},
section_fmt = function(filename)
local section_names = {
["./lua/telescope/_extensions/file_browser.lua"] = "TELESCOPE-FILE-BROWSER",
["./lua/telescope/_extensions/file_browser/picker.lua"] = "PICKER",
["./lua/telescope/_extensions/file_browser/actions.lua"] = "ACTIONS",
["./lua/telescope/_extensions/file_browser/finders.lua"] = "FINDERS",
}
return section_names[filename]
end,
}

0 comments on commit 9e06f14

Please sign in to comment.