8000 GitHub - yilanboy/highlight-blade: Highlight laravel blade syntax with highlight.js.
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

yilanboy/highlight-blade

Repository files navigation

Highlight Blade

Highlight Laravel Blade & Alpine.js syntax with highlight.js.

You can see the highlight results here.

Installation

Using npm to download the library.

npm install highlight.js hightlight-blade

Importing the Library

To use the Blade template definition with highlight.js, you have two options for importing:

Optimized Import (Recommended)

Load only the language definitions you need.

// import core hljs api and required languages
import hljs from 'highlight.js/lib/core';
import javascript from 'highlight.js/lib/languages/javascript';
import xml from 'highlight.js/lib/languages/xml';
import php from 'highlight.js/lib/languages/php';
import blade from 'highlight-blade';

// register each language definition
hljs.registerLanguage('javascript', javascript);
hljs.registerLanguage('xml', xml);
hljs.registerLanguage('php', php);
hljs.registerLanguage('blade', blade);

Full Import

Load all languages of highlight.js, please note that this generates a large file.

import hljs from 'highlight.js';
import blade from 'highlight-blade';

hljs.registerLanguage('blade', blade);

More information about importing highlight.js library, please refer to here.

TODO

  • Support Laravel Blade syntax
  • Support Alpine.js syntax

About

Highlight laravel blade syntax with highlight.js.

Resources

License

Stars

Watchers

Forks

Packages

No packages published
0