Skip to content

Instantly share code, notes, and snippets.

CmdUtils.CreateCommand({
name: "pronounce",
author: { name: "Walter Chang", email: "weihsiu@gmail.com" },
license: "Creative Commons 3.0 (by nc)",
description: "Pronounce a selected or typed English word",
takes: {"word": noun_arb_text},
preview: function(pblock, text) {
var msg = 'Pronounces "${word}"';
var subs = { word: this._pickWord(text.text) };
pblock.innerHTML = CmdUtils.renderTemplate(msg, subs);
CmdUtils.CreateCommand({
name: "tw-stock",
author: { name: "Walter Chang", email: "weihsiu@gmail.com" },
license: "Creative Commons 3.0 (by nc)",
description: "Quote a stock symbol from Taiwan Stock Exchange",
takes: {"stock symbol": noun_arb_text},
preview: function(pblock, what) {
var msg = 'Gets stock quote for "${stockSymbol}"';
var subs = { stockSymbol: what.text };
pblock.innerHTML = CmdUtils.renderTemplate(msg, subs);