How to use the prismjs/components.js.languages function in prismjs

To help you get started, we’ve selected a few prismjs 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 tig / winprint / testfiles / generate-associations.js View on Github external
// Imports file-extension to langauge mapping from both
// prismjs and lang-map and outputs a JSDON document that
// follows the vscode schema for extension mapping.
// PrismJS language definitions trump for my solution.
const fs = require('fs');
var map = require('lang-map');
var components = require('prismjs/components.js');

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{
github tig / winprint / testfiles / generate-associations.js View on Github external
// Imports file-extension to langauge mapping from both
// prismjs and lang-map and outputs a JSDON document that
// follows the vscode schema for extension mapping.
// PrismJS language definitions trump for my solution.
const fs = require('fs');
var map = require('lang-map');
var components = require('prismjs/components.js');

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{
                langTemp.aliases.push(language.alias);
github tig / winprint / tools / generate-associations.js View on Github external
//   args: ['value1', 'value2', 'value3']
// };

// PythonShell.run('my_script.py', options, function (err, results) {
//   if (err)
//     throw err;
//   // Results is an array consisting of messages collected during execution
//   console.log('results: %j', results);
// });

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{
                langTemp.aliases.push(language.alias);
github tig / winprint / tools / generate-associations.js View on Github external
//   scriptPath: 'C:\Python38\Lib\site-packages\pygments',
//   args: ['value1', 'value2', 'value3']
// };

// PythonShell.run('my_script.py', options, function (err, results) {
//   if (err)
//     throw err;
//   // Results is an array consisting of messages collected during execution
//   console.log('results: %j', results);
// });

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{
github tig / winprint / proto / node / generate-associations.js View on Github external
// Imports file-extension to langauge mapping from both
// prismjs and lang-map and outputs a JSDON document that
// follows the vscode schema for extension mapping.
// PrismJS language definitions trump for my solution.
const fs = require('fs');
var map = require('lang-map');
var components = require('prismjs/components.js');

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{
                langTemp.aliases.push(language.alias);
            }
github tig / winprint / proto / node / generate-associations.js View on Github external
// Imports file-extension to langauge mapping from both
// prismjs and lang-map and outputs a JSDON document that
// follows the vscode schema for extension mapping.
// PrismJS language definitions trump for my solution.
const fs = require('fs');
var map = require('lang-map');
var components = require('prismjs/components.js');

// vscode files.associations is not an array. Use a dictionary instead.
var assocDict = {};
var languages = [];

for (var key in components.languages) {
    if (components.languages.hasOwnProperty(key) && key != 'meta') {
        var language = components.languages[key];
        var langTemp = {
          id : key
        };
        langTemp.aliases = [];

        // vscode doesn't support title, but I want to use it
        if (typeof language.title != 'undefined')
            langTemp.title = language.title;

        if (typeof language.alias != 'undefined'){
            if (Array.isArray(language.alias)){
                langTemp.aliases = language.alias;
            }
            else{