Syntax implementation of Laravel's's Blade language for highlight.js

Overview

Blade language definition for Highlight.js

Syntax implementation of Laravel's's Blade language for highlight.js.

Support us

We invest a lot of resources into creating best in class open source packages. You can support us by buying one of our paid products.

We highly appreciate you sending us a postcard from your hometown, mentioning which of our package(s) you are using. You'll find our address on our contact page. We publish all received postcards on our virtual postcard wall.

Installation

This package can be installed from NPM using npm or yarn:

yarn install highlightjs-blade

Usage

Simply include the Highlight.js library in your webpage or Node app, then load this module.

With Node or another build system

If you're using Node / Webpack / Rollup / Browserify, etc, simply require the language module, then register it with Highlight.js.

var hljs = require('highlightjs');
var hljsBlade = require('highlightjs-blade');

hljs.registerLanguage("blade", hljsBlade);
hljs.initHighlightingOnLoad();

Static website or simple usage

Simply load the module after loading Highlight.js. You'll use the minified version found in the dist directory. This module is just a CDN build of the language, so it will register itself as the Javascript is loaded.

">
<script type="text/javascript" src="/path/to/highlight.min.js">script>
<script
        type="text/javascript" charset="UTF-8"
        src="/path/to/highlightjs-blade/dist/blade.min.js"
>script>
<script type="text/javascript">
    hljs.initHighlightingOnLoad();
script>

Using directly from the UNPKG CDN

">
<script
        type="text/javascript"
        src="https://unpkg.com/highlightjs-blade/dist/blade.min.js"
>script>

React

You need to import both Highlight.js and third-party language like Blade:

{children} } } } export default Highlighter;">
import React, {Component} from 'react';
import 'highlight.js/scss/darcula.scss'; // your favourite theme
import blade from './blade'; // TODO: Figure out exact path in package
import hljs from 'highlight.js';

hljs.registerLanguage('blade', blade);

class Highlighter extends Component {
    constructor(props) {
        super(props);
        hljs.initHighlightingOnLoad();
    }

    render() {
        let {children} = this.props;
        return
        {
            <pre ref={(node) => this.node = node}>
                <code className="blade">
                    {children}
                </code>
            </pre>
        }
    }
}

export default Highlighter;

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Building

⚠️ These instructions are only for contributing to this package. If you just want to use the language definition, please refer to the Usage section above.

To build a distribution version of this module you need to use tools provided by Highlight.js. Please refer to the language contribution guide for more details on building this package.

  1. Checkout highlightjs/highlight.js from GitHub.
  2. Create the extra folder in the root directory, if missing.
  3. In the extra directory create a blade subdirectory and put the contents of this repository there.
  4. Run build tools for the cdn target and you should see the blade language module being build alongside Highlight.js itself:
node ./tools/build.js -t cdn

...
Building extra\blade\dist/blade.min.js.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

License

The MIT License (MIT). Please see License File for more information.

You might also like...

a VS Code Extension for Easily Localize any blade/php text in any Laravel project.

a VS Code Extension for Easily Localize any blade/php text in any Laravel project.

Laravel Easy Localize a VS Code Extension for Easily Localize any blade/php text in any Laravel project. Features Custom array key for each translatio

Oct 31, 2022

JavaScript syntax highlighter with language auto-detection and zero dependencies.

Highlight.js Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty muc

Jan 5, 2023

Line focus plugin for Highlight.js

Line focus plugin for Highlight.js

Highlight.js Focus Plugin This plugin provide the ability to highlight a focused line when using Highlight.js To use, first, register this plugin with

Jun 20, 2022

Convert Your Kindle highlight & Note to Markdown/JSON

kindle-highlight-to-markdown Convert Your Kindle highlight & Note to Markdown/JSON Install Install with npm: npm install kindle-highlight-to-markdown

Dec 31, 2022

A plugin for obsidian to focus and highlight on a specific heading in Reading mode.

A plugin for obsidian to focus and highlight on a specific heading in Reading mode.

Focus and Highlight A plugin for obsidian to focus on a specific paragraph in Reading mode. Features Focus on a specific heading and its children when

Dec 21, 2022

A CSS stylesheet to quickly highlight a11y concerns.

A CSS stylesheet to quickly highlight a11y concerns.

Checka11y.css A CSS stylesheet to quickly highlight a11y concerns. Lightweight • Modern • Accessibile • Customisable • Simple The first line of defenc

Dec 25, 2022

Steam - Highlight specific friends who play

highlight-friends Steam Website - Highlight specific friends who play https://greasyfork.org/en/scripts/450409-highlight-specific-friends-who-play?loc

Nov 6, 2022

"Jira Search Helper" is a project to search more detail view and support highlight than original jira search

Jira Search Helper What is Jira Search Helper? "Jira Search Helper" is a project to search more detail view and support highlight than original jira s

Dec 23, 2022

Highlight the Web ✏️✨

Highlight the Web  ✏️✨

Marker is a Browser Add-On that lets you draw on any Website. Please first navigate to a website, then press on the toolbar button to activate the add

Nov 14, 2022

i18n-language.js is Simple i18n language with Vanilla Javascript

i18n-language.js i18n-language.js is Simple i18n language with Vanilla Javascript Write by Hyun SHIN Demo Page: http://i18n-language.s3-website.ap-nor

Jul 12, 2022

When a person that doesn't know how to create a programming language tries to create a programming language

When a person that doesn't know how to create a programming language tries to create a programming language

Kochanowski Online Spróbuj Kochanowskiego bez konfiguracji projektu! https://mmusielik.xyz/projects/kochanowski Instalacja Stwórz nowy projekt przez n

Dec 4, 2022

Write "hello world" in your native language, code "hello world" in your favorite programming language!

Hello World, All languages! 🌎 📌 Write "hello world" in your native language, code "hello world" in your favorite language! #hacktoberfest2022 How to

Dec 13, 2022

The interpretation implementation implemented programming language built for fun. I'm currently boring in full stack web development. So, I crafted this one LoL. 👻

The interpretation implementation implemented programming language built for fun. I'm currently boring in full stack web development. So, I crafted this one LoL.  👻

What's Wuttyi? Everything is expression 👻 I just developed this tiny programming language because of boring in higher level programming construct. Mo

Dec 13, 2022

This is a template project demonstrating how the MERN stack(Mongo, Express, React, Node) can be used, here we have the back end implementation and there is the React implementation as the front end

This is a template project demonstrating how the MERN stack(Mongo, Express, React, Node) can be used, here we have the back end implementation and there is the React implementation as the front end

Versão em português MERN stack This is a template project demonstrating how the MERN stack(Mongo, Express, React, Node) can be used, here we have the

Jan 22, 2022

Lightweight, robust, elegant syntax highlighting.

Prism Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from Dabblet. You can learn more on prismjs.com

Dec 30, 2022

A tiny wrapper built around fetch with an intuitive syntax. :candy:

A tiny wrapper built around fetch with an intuitive syntax. :candy:

Wretch A tiny (~ 3Kb g-zipped) wrapper built around fetch with an intuitive syntax. f[ETCH] [WR]apper Wretch 1.7 is now live 🎉 ! Please check out the

Jan 3, 2023

Convert a simple HTML syntax into tables compatible with Foundation for Emails.

Inky Inky is an HTML-based templating language that converts simple HTML into complex, responsive email-ready HTML. Designed for Foundation for Emails

Dec 22, 2022

A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

A refined tool for exploring open-source projects on GitHub with a file tree, rich Markdown and image previews, multi-pane multi-tab layouts and first-class support for Ink syntax highlighting.

Ink codebase browser, "Kin" 🔍 The Ink codebase browser is a tool to explore open-source code on GitHub, especially my side projects written in the In

Oct 30, 2022
Owner
Spatie
We create open source, digital products and courses for the developer community
Spatie
JavaScript syntax highlighter with language auto-detection and zero dependencies.

Highlight.js Highlight.js is a syntax highlighter written in JavaScript. It works in the browser as well as on the server. It can work with pretty muc

highlight.js 20.8k Jan 5, 2023
Lightweight, robust, elegant syntax highlighting.

Prism Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from Dabblet. You can learn more on prismjs.com

Prism.js 10.9k Dec 30, 2022
Opinionated syntax highlighting with shiki for markdown-it.

式神 shikigami Opinionated syntax highlighting with shiki for markdown-it. Installation Just use your favorite package manager. npm i @nrsk/shikigami Th

Vladislav Mamon 6 Sep 30, 2022
Highlight your code using tree-sitter-highlight

rehype-tree-sitter-highlight highlight your code using tree-sitter-highlight Installation npm install rehype-tree-sitter-highlight Usage This is a reh

Sachin Raja 8 Nov 30, 2022
Syntax highlight using VSCode's json/plist as is.

WIP dps-vsctm.vim Syntax highlight using VSCode's json/plist as is. Requirements denops.vim Usage First, the grammar definition file must be placed in

NAKAI Tsuyoshi 68 Dec 26, 2022
Grupprojekt för kurserna 'Javascript med Ramverk' och 'Agil Utveckling'

JavaScript-med-Ramverk-Laboration-3 Grupprojektet för kurserna Javascript med Ramverk och Agil Utveckling. Utvecklingsguide För information om hur utv

Svante Jonsson IT-Högskolan 3 May 18, 2022
Hemsida för personer i Sverige som kan och vill erbjuda boende till människor på flykt

Getting Started with Create React App This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: np

null 4 May 3, 2022
Kurs-repo för kursen Webbserver och Databaser

Webbserver och databaser This repository is meant for CME students to access exercises and codealongs that happen throughout the course. I hope you wi

null 14 Jan 3, 2023
Adds support for Blade templates to Prettier. (work in progress)

Laravel Blade support for Prettier ⚠️ This plugin is still a work-in-progress. If you're trying it out, please keep this in mind. This package include

Ryan Chandler 139 Sep 20, 2022
A Laravel Blade parser, compiler, and static analyzer written in TypeScript.

Blade Parser This library provides a Laravel Blade parser written in TypeScript. In addition to being able to parse Blade template files, this library

Stillat 7 Jan 4, 2023