semo-plugin-hello-world v1.2.2
semo-plugin-hello-world
This is the hello world plugin for Semo, it is just for fun, and is the showcase of what Semo plugin looks like.
Usage
npm install -g @semo/cli
semo run hello-worldYou don't need to download the plugin by using npm install, but semo run helps you to do that.
OK, you can download the plugin by using npm install
npm install -g semo-plugin-hello-world
semo hello-worldOr magically just:
npx @semo/cli run hello-worldOptions
- --lang: For now, it only support
en_USandzh_CN. - --inspiration-type: For now, it only support
en,cn,it,poison, andrule. - --clean: No box and no color
- --simple: Just output inspiration
Extension
Change the default behavior of the command by using semo config -g
semo config set '$plugin.hello-world.lang' zh_CN -g
semo config set '$plugin.hello-world.inpirationType' it -gYou can use hooks to change the command output. The template is:
{{ hi }}
{{ greeting }}
{{ inspiration }}You can change then using these hooks in your global Semo plugins.
exports.hook_hello_world_hi = async () => {}
exports.hook_hello_world_greeting = async () => {}
exports.hook_hello_world_inspirations = async () => {}The last inspirations hook need to return an Array of sentences, and than output randomly by the command core.
The inspirations format
In core, we use yml to define inspriation and there are 2 format supported:
- who: somebody
said: somethingor
- something --somebodyThe first format may provide more formated output, but now, the last format is easy to use, so if you hook inspirations, you can just return sentences array.
Contribution
There must be typos need to be fixed, and we need more inspiration types and more good inspirations.
If you have any ideas about this plugin, please create issues or push PR to us.
License
MIT