mirror of https://github.com/Hilbis/Hilbish
fix(nature/tips): cleanup tips display
parent
54b85b1c99
commit
e4df61f020
|
@ -1,34 +1,35 @@
|
||||||
local bait = require 'bait'
|
local bait = require 'bait'
|
||||||
local lunacolors = require 'lunacolors'
|
local lunacolors = require 'lunacolors'
|
||||||
|
|
||||||
PREAMBLE = [[
|
local postamble = [[
|
||||||
Getting Started: https://rosettea.github.io/Hilbish/docs/getting-started/
|
{yellow}These tips can be disabled with {reset}{invert} hilbish.opts.tips = false {reset}
|
||||||
{yellow}🛈 These tips can be disabled with hilbish.opts.tips = false{reset}
|
|
||||||
]]
|
]]
|
||||||
|
|
||||||
hilbish.tips = {
|
hilbish.tips = {
|
||||||
"Join the discord and say hi! -> https://discord.gg/3PDdcQz",
|
'Join the discord and say hi! {blue}https://discord.gg/3PDdcQz{reset}',
|
||||||
"{green}hilbish.alias{reset} -> Sets an alias to another cmd",
|
'{green}hilbish.alias{reset} interface manages shell aliases. See more detail by running {blue}doc api hilbish.alias.',
|
||||||
"{green}hilbish.appendPath{reset} -> Appends the provided dir to the command path ($PATH)",
|
'{green}hilbish.appendPath(\'path\'){reset} -> Appends the provided dir to the command path ($PATH)',
|
||||||
"{green}hilbish.completions{reset} -> Are use to control suggestions when tab completing.",
|
'{green}hilbish.completions{reset} -> Used to control suggestions when tab completing.',
|
||||||
"{green}hilbish.message{reset} -> Simple notification system which can be used by other plugins and parts of the shell to notify the user of various actions.",
|
'{green}hilbish.message{reset} -> Simple notification system which can be used by other plugins and parts of the shell to notify the user of various actions.',
|
||||||
[[
|
[[
|
||||||
{green}hilbish.opts{reset} -> Simple toggle or value options a user can set.
|
{green}hilbish.opts{reset} -> Simple toggle or value options a user can set.
|
||||||
- EX: hilbish.opts.greeting = false, will cause the greeting message on start-up to not display.
|
You may disable the startup greeting by {invert}hilbish.opts.greeting = false{reset}
|
||||||
]],
|
]],
|
||||||
[[
|
[[
|
||||||
{green}hilbish.runner{reset} -> The runner interface contains functions that allow the user to change how Hilbish interprets interactive input.
|
{green}hilbish.runner{reset} -> The runner interface contains functions to
|
||||||
- The default runners can run shell script and Lua code.
|
manage how Hilbish interprets interactive input. The default runners can run
|
||||||
]],
|
shell script and Lua code!
|
||||||
[[
|
]],
|
||||||
Add Lua-written commands with the commander module!
|
[[
|
||||||
Checkout the docs here -> https://rosettea.github.io/Hilbish/docs/api/commander/
|
Add Lua-written commands with the commander module!
|
||||||
]]
|
Check the command {blue}doc api commander{reset} or the web docs:
|
||||||
|
https://rosettea.github.io/Hilbish/docs/api/commander/
|
||||||
|
]]
|
||||||
}
|
}
|
||||||
|
|
||||||
bait.catch('hilbish.init', function()
|
bait.catch('hilbish.init', function()
|
||||||
if hilbish.interactive and hilbish.opts.tips then
|
if hilbish.interactive and hilbish.opts.tips then
|
||||||
local idx = math.random(1, #hilbish.tips)
|
local idx = math.random(1, #hilbish.tips)
|
||||||
print(lunacolors.format(PREAMBLE .. "\nTip: " .. hilbish.tips[idx]))
|
print(lunacolors.format('{yellow}🛈 Tip:{reset} ' .. hilbish.tips[idx] .. '\n' .. postamble))
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Reference in New Issue