How to use markdown-it-texmath - 1 common examples

To help you get started, we’ve selected a few markdown-it-texmath examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github goessner / mdmath / extension.js View on Github external
exports.activate = function activate(context) {
    let   mdit = null;   // markdown-it object ...

    const kt = require('katex'),
          tm = require('markdown-it-texmath').use(kt),
          path = require('path'),
          fs = require('fs'),
          cfg = (key) => vscode.workspace.getConfiguration('mdmath')[key],
          infoMsg = (msg) => {
                vscode.window.showInformationMessage(`Markdown + Math: ${msg}`);
          },
          errMsg = (msg) => {
                vscode.window.showErrorMessage(`Markdown + Math: ${msg}`);
          },
          asHTML = () => {
                const doc = vscode.window.activeTextEditor
                         && vscode.window.activeTextEditor.document,
                      usrcss = cfg('style');

                if (!doc || doc.languageId !== 'markdown')
                    return infoMsg('Active document is no markdown source document!');

markdown-it-texmath

markdown-it extension for rendering TeX Math

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular markdown-it-texmath functions