extensions/markdown-math/src/extension.ts/activate
export function activate(context: vscode.ExtensionContext) {
	function isEnabled(): boolean {
		const config = vscode.workspace.getConfiguration('markdown');
		return config.get<boolean>('math.enabled', true);
	}

	vscode.workspace.onDidChangeConfiguration(e => {
		if (e.affectsConfiguration(enabledSetting)) {
			vscode.commands.executeCommand('markdown.api.reloadPlugins');
		}
	}, undefined, context.subscriptions);

	return {
		extendMarkdownIt(md: any) {
			if (isEnabled()) {
				const katex = require('@iktakahiro/markdown-it-katex');
				return md.use(katex);
			}
			return md;
		}
	};
}