chore(doc): Auto generate docs

This commit is contained in:
JuanZoran 2023-03-17 02:18:27 +00:00 committed by github-actions[bot]
parent aabe1f3a8f
commit 641a90de6b

View File

@ -34,7 +34,7 @@ Table of Contents *Trans-table-of-contents*
- |Trans-待办-(画大饼)| - |Trans-待办-(画大饼)|
注意: 当前分支目前没有发布, README.MD的描述并不准确, 遇到问题请切换到 MAIN分支或者联系我 ~ 注意: 当前分支目前没有发布, README.MD 的描述并不准确, 遇到问题请切换到 MAIN分支或者联系我 ~
特点 *Trans-trans.nvim-特点* 特点 *Trans-trans.nvim-特点*
@ -105,7 +105,7 @@ Packer.nvim ~
use { use {
'JuanZoran/Trans.nvim' 'JuanZoran/Trans.nvim'
run = function() require('Trans').install() end, -- 自动下载使用的本地词库 run = function() require('Trans').install() end, -- 自动下载使用的本地词库
requires = { 'kkharji/sqlite.lua', }, requires = 'kkharji/sqlite.lua', ,
-- 如果你不需要任何配置的话, 可以直接按照下面的方式启动 -- 如果你不需要任何配置的话, 可以直接按照下面的方式启动
config = function () config = function ()
require'Trans'.setup{ require'Trans'.setup{
@ -131,7 +131,6 @@ Packer.nvim ~
require("Trans").setup {} -- 启动Trans require("Trans").setup {} -- 启动Trans
vim.keymap.set({"n", 'x'}, "mm", '<Cmd>Translate<CR>', { desc = ' Translate' }) -- 自动判断virtual 还是 normal 模式 vim.keymap.set({"n", 'x'}, "mm", '<Cmd>Translate<CR>', { desc = ' Translate' }) -- 自动判断virtual 还是 normal 模式
vim.keymap.set({'n', 'x'}, 'mk', '<Cmd>TransPlay<CR>', {desc = ' 自动发音'}) -- 自动发音选中或者光标下的单词 vim.keymap.set({'n', 'x'}, 'mk', '<Cmd>TransPlay<CR>', {desc = ' 自动发音'}) -- 自动发音选中或者光标下的单词
vim.keymap.set("n", "mi", "<Cmd>TranslateInput<CR>", { desc = ' Translate' })
end end
} }
< <
@ -172,7 +171,7 @@ Lazy.nvim ~
> Linux 下安装: > Linux 下安装:
> `sudo pacman -S sqlite # Arch` > `sudo pacman -S sqlite # Arch`
> `sudo apt-get install sqlite3 libsqlite3-dev # Ubuntu` > `sudo apt-get install sqlite3 libsqlite3-dev # Ubuntu`
后续会增加 `healthcheck` 进行检查 **尝试运行 checkhealth Trans**
- **auto_play** 使用步骤: - **auto_play** 使用步骤:
linux 只需要安装`festival` sudo apt-get install festival festvox-kallpc16k linux 只需要安装`festival` sudo apt-get install festival festvox-kallpc16k
**如果你想要设置音色,发音可以访问:** Festival 官方 **如果你想要设置音色,发音可以访问:** Festival 官方
@ -217,25 +216,20 @@ Festival配置(仅针对linux用户) ~
配置 *Trans-trans.nvim-配置* 配置 *Trans-trans.nvim-配置*
>lua >lua
require'Trans'.setup{ require'Trans'.setup {
---@type string the directory for database file and password file ---@type string the directory for database file and password file
dir = os.getenv('HOME') .. '/.vim/dict', dir = os.getenv('HOME') .. '/.vim/dict',
---@type table modeStrategy default strategy for mode query = 'fallback',
-- backend_order = {},
---@type 'default' | 'dracula' | 'tokyonight' global Trans theme [see lua/Trans/style/theme.lua]
theme = 'default', -- default | tokyonight | dracula
strategy = { strategy = {
---@type { frontend:string, backend:string } fallback strategy for mode ---@type { frontend:string, backend:string | string[] } fallback strategy for mode
default = { default = {
frontend = 'hover', frontend = 'hover',
backend = '*', backend = '*',
}, },
}, },
---@type table<string, TransBackendOpts> fallback backend for mode
backend = {
---@class TransBackendOpts
default = {
---@type integer timeout for backend send request
timeout = 2000,
},
},
---@type table frontend options ---@type table frontend options
frontend = { frontend = {
---@class TransFrontendOpts ---@class TransFrontendOpts
@ -251,6 +245,7 @@ Festival配置(仅针对linux用户) ~
close = 'slid', close = 'slid',
interval = 12, interval = 12,
}, },
timeout = 2000,
}, },
---@class TransHoverOpts : TransFrontendOpts ---@class TransHoverOpts : TransFrontendOpts
hover = { hover = {
@ -261,16 +256,17 @@ Festival配置(仅针对linux用户) ~
---@type string -- see: /lua/Trans/style/spinner ---@type string -- see: /lua/Trans/style/spinner
spinner = 'dots', spinner = 'dots',
---@type string -- TODO :support replace with {{special word}} ---@type string -- TODO :support replace with {{special word}}
fallback_message = '翻译超时或没有找到相关的翻译', fallback_message = '{{notfound}} 翻译超时或没有找到相关的翻译',
auto_resize = true, auto_resize = true,
-- strict = false, -- TODO :No Width limit when str is a sentence
padding = 10, -- padding for hover window width padding = 10, -- padding for hover window width
keymaps = { keymaps = {
-- play = '_', -- Deprecated
pageup = '[[', pageup = '[[',
pagedown = ']]', pagedown = ']]',
pin = '<leader>[', pin = '<leader>[',
close = '<leader>]', close = '<leader>]',
toggle_entry = '<leader>;', toggle_entry = '<leader>;',
-- play = '_', -- Deprecated
}, },
---@type string[] auto close events ---@type string[] auto close events
auto_close_events = { auto_close_events = {
@ -278,31 +274,47 @@ Festival配置(仅针对linux用户) ~
'CursorMoved', 'CursorMoved',
'BufLeave', 'BufLeave',
}, },
---@type string[] order to display translate result ---@type table<string, string[]> order to display translate result
order = { order = {
'title', default = {
'tag', 'str',
'pos', 'translation',
'exchange', 'definition',
'translation', },
'definition', offline = {
'title',
'tag',
'pos',
'exchange',
'translation',
'definition',
},
youdao = {
'title',
'translation',
'definition',
'web',
}
}, },
---@type table<string, string> ---@type table<string, string>
icon = { icon = {
-- or use emoji -- or use emoji
star = '', -- ⭐ list = '●', -- ● | ○ | ◉ | ◯ | ◇ | ◆ | ▪ | ▫ | ⬤ | 🟢 | 🟡 | 🟣 | 🟤 | 🟦 | 🟨 | 🟧 | 🟥 | 🟪 | 🟫 | 🟩 | 🟠 | 🟦 | 🟨 | 🟧 | 🟥 | 🟪 | 🟫 | 🟩 | 🟠
notfound = ' ', -- ❔ star = '', -- ⭐ | ✴ | ✳ | ✲ | ✱ | ✰ | ★ | ☆ | 🌟 | 🌠 | 🌙 | 🌛 | 🌜 | 🌟 | 🌠 | 🌌 | 🌙 |
yes = '✔', -- ✔️ notfound = ' ', --❔ | ❓ | ❗ | ❕|
no = '', -- ❌ yes = '✔', -- ✅ | ✔️ | ☑
cell = '■', -- ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █ no = '', -- ❌ | ❎ | ✖ | ✘ | ✗ |
cell = '■', -- ■ | □ | ▇ | ▏ ▎ ▍ ▌ ▋ ▊ ▉ █
web = '󰖟', --🌍 | 🌎 | 🌏 | 🌐 |
tag = ' ',
pos = '',
translation = '󰊿',
definition = '󰗊',
exchange = '✳',
}, },
}, },
}, },
style = { }p
---@type string global Trans theme [see lua/Trans/style/theme.lua]
theme = 'default', -- default | tokyonight | dracula
},
}
< <
@ -315,7 +327,6 @@ Festival配置(仅针对linux用户) ~
>lua >lua
vim.keymap.set({'n', 'x'}, 'mm', '<Cmd>Translate<CR>') vim.keymap.set({'n', 'x'}, 'mm', '<Cmd>Translate<CR>')
vim.keymap.set({'n', 'x'}, 'mk', '<Cmd>TransPlay<CR>') -- 自动发音选中或者光标下的单词 vim.keymap.set({'n', 'x'}, 'mk', '<Cmd>TransPlay<CR>') -- 自动发音选中或者光标下的单词
vim.keymap.set('n', 'mi', '<Cmd>TranslateInput<CR>')
< <
@ -325,50 +336,58 @@ Festival配置(仅针对linux用户) ~
默认定义 默认定义
>lua >lua
{ {
TransWord = { TransWord = {
fg = '#7ee787', fg = '#7ee787',
bold = true, bold = true,
}, },
TransPhonetic = { TransPhonetic = {
link = 'Linenr' link = 'Linenr'
}, },
TransTitle = { TransTitle = {
fg = '#0f0f15', fg = '#0f0f15',
bg = '#75beff', bg = '#75beff',
bold = true, bold = true,
}, },
TransTitleRound = { TransTitleRound = {
fg = '#75beff', fg = '#75beff',
}, },
TransTag = { TransTag = {
fg = '#e5c07b', -- fg = '#e5c07b',
}, link = '@tag'
TransExchange = { },
link = 'TransTag', TransExchange = {
}, link = 'TransTag',
TransPos = { },
link = 'TransTag', TransPos = {
}, link = 'TransTag',
TransTranslation = { },
link = 'TransWord', TransTranslation = {
}, link = 'TransWord',
TransDefinition = { },
link = 'Moremsg', TransDefinition = {
}, link = 'Moremsg',
TransWin = { },
link = 'Normal', TransWin = {
}, link = 'Normal',
TransBorder = { },
link = 'FloatBorder', TransBorder = {
}, fg = '#89B4FA',
TransCollins = { },
fg = '#faf743', TransCollins = {
bold = true, fg = '#faf743',
}, bold = true,
TransFailed = { },
fg = '#7aa89f', TransFailed = {
}, fg = '#7aa89f',
} },
TransWaitting = {
link = 'MoreMsg'
},
TransWeb = {
-- TODO :
link = 'MoreMsg',
}
}
< <
@ -395,14 +414,14 @@ Festival配置(仅针对linux用户) ~
待办 (画大饼) *Trans-trans.nvim-待办-(画大饼)* 待办 (画大饼) *Trans-trans.nvim-待办-(画大饼)*
- ☒ 多风格样式查询
- ☒ 重新录制屏幕截图示例
- ☒ 快捷键定义 - ☒ 快捷键定义
- ☒ 自动读音 - ☒ 自动读音
- ☒ 在线多引擎异步查询
- ☒ `句子翻译` | `中翻英` 的支持
- ☐ 多风格样式查询
- ☐ 重新录制屏幕截图示例
- ☐ 变量命名的支持 - ☐ 变量命名的支持
- ☐ 历史查询结果保存 - ☐ 历史查询结果保存
- ☐ 在线多引擎异步查询
- ☐ `句子翻译` | `中翻英` 的支持
============================================================================== ==============================================================================
2. Links *Trans-links* 2. Links *Trans-links*