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