CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-highlight-js

Syntax highlighting with language autodetection for over 190 programming languages and markup formats.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

vue-integration.mddocs/

Vue.js Integration

Vue.js plugin for seamless integration with Vue components and applications. The plugin provides a standard Vue plugin interface that can be easily installed in any Vue application.

Capabilities

Vue Plugin

Creates a Vue.js plugin for highlighting code within Vue applications.

/**
 * Creates a Vue.js plugin for highlight.js integration
 * @returns VuePlugin instance with install method
 */
function vuePlugin(): VuePlugin;

interface VuePlugin {
  /** Standard Vue plugin install method */
  install: (vue: any) => void;
}

Usage Examples:

import hljs from 'highlight.js';
import { createApp } from 'vue';

// Vue 3 installation
const app = createApp(App);
app.use(hljs.vuePlugin());

// Vue 2 installation (legacy)
import Vue from 'vue';
Vue.use(hljs.vuePlugin());

In Vue Components:

<template>
  <div>
    <pre><code class="javascript">{{ code }}</code></pre>
  </div>
</template>

<script>
export default {
  data() {
    return {
      code: 'console.log("Hello, Vue!");'
    };
  },
  mounted() {
    // Plugin automatically makes hljs available
    this.$hljs.highlightAll();
  }
};
</script>

docs

configuration-modes.md

core-highlighting.md

dom-integration.md

index.md

language-management.md

modes-utilities.md

plugin-system.md

vue-integration.md

tile.json