Git Product home page Git Product logo

laravel-blade's Introduction

Laravel Blade Highlighter

This package adds syntax definitions for the Laravel Blade engine.

Works with various Sublime Text version, for older/specific versions use older/specific release.

How to install w/Sublime Package Control

  1. Search for Laravel Blade and install it.
  2. Restart Sublime Text.
  3. Reopen any .blade files.
  4. Enjoy :)

Sublime Text Manual Install

  1. Download or clone this repository into [install-dir]/Packages/laravel-blade
  2. Restart Sublime Text.
  3. Reopen any .blade files.
  4. Enjoy :)

Yeah but, show me what it is?

blade-example

Predawn.

blade-example

Material Theme.

Supported Extensions

How to Contribute

  • To test a local version of the highlighter first uninstall the highlighter from package control.
  • Follow the manual installation process by cloning the repo into your packages directory.
  • Restart Sublime Text.
  • Open up the '[install-dir]/Packages/laravel-blade' folder into a new Sublime Text project.
  • Open up the blade.tmLanguage file and make changes.
  • I have provided a test.blade file that holds most of the common uses for testing the regex, use this to verify your changes before and after you make them to ensure the changes you make do not break anything.
  • Send a pull request with a single change per request.

laravel-blade's People

Contributors

alexwhitman avatar anlutro avatar autokludge avatar corneliusio avatar cringerjs avatar deathaxe avatar dmitrybubyakin avatar heavybeard avatar intrepidws avatar jakebathman avatar jaybizzle avatar jbrooksuk avatar joostk avatar kennith avatar leonimuz avatar mc0de avatar medalink avatar patricksamson avatar pazuzu156 avatar pcr-coding avatar pephers avatar piperone avatar redgluten avatar sdebacker avatar tannermccoleman avatar taylorotwell avatar thyyppa avatar uzegonemad avatar vinkla avatar zaynali53 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

laravel-blade's Issues

Custom escape sequence

I've tried to highlight the "<%" and "%>" as an addition to the regular syntax "{{ }}", but it didn't work out for me. what would I need to add to the tmLanguage file to make it work?

{!! !!} Syntax not being highlighted

The new raw html {!! !!} tags are not being highlighted. I'm using version v.1.1.3 and Sublime Text 3.

Sublime

Edit: Noticed the actual commit was a revert, so I guess this is a feature request now.

Syntax highlighting issue

Syntax highlighting does not seem to pick up the opening {{ inside an HTML tag

Line 2 is the correct formatting
Line 3 shows the same code inside a tag which is unstyled

The correct behaviour would be to style the code inside the HTML tags

screen shot 2013-10-17 at 10 36 12

No forelse support yet

Hi Medalink,

thanks for your Blade Highlighting Plugin.
I've encountered, that highlighting for forelse is missing.

Only small changes need to be made. For the case you are too busy, feel free to paste this fixes for laravel-blade.tmLanguage:
Line 114: <string>\s{1}|^)@\b(if|elseif|foreach|for|forelse|while|extends|unless|each|yield|lang|choice|section|include)\b(?=(|\s*|)()</string>
Line 195: <string>\s{1}|^)@\b(endif|endforeach|endfor|endforelse|endwhile|else|empty|endunless|show|stop|endsection|parent|overwrite)\b</string>

The mustache PHP highlighting don't work inside quotation marks

The PHP code is highlighted when it is into the "mustaches" of blade except when this mustaches are inside quotation marks. This case is very frequent when you want to define dynamic data (for a JS function, for example) or class in HTML markup.

In the exemple below, GitHub Highlighting do the same :

<button id="delete-user" data-user="{{ $user->id }}">
    Delete {{ $user->name }}
<button>

Is there a solution to improve this ?

Problem with highlighting for {{ $var }}

Hello and first of all thanks for this wonderful highlighter for blade.

But I have a small issue where {{ $var }} is not highlighted the way it should.
Although it is highlighted but not in PHP style but just in raw text style which is not so handy.

You can see an example at the screen shot.

screenshot from 2013-07-08 16 45 47

Thanks in advance,

Juje007

Blade highlighting not working at all

I'm on Windows 7 64-bit with ST2. I've installed Laravel Blade Highlighter using Package Control but it doesn't work at all. I don't have the HTML5 package installed. The color scheme is Monokai. All other html/php highlighting appears normal.

Any ideas?

Sorry - it's woken up! The problem was that I had files already open in ST2 and they didn't update. As soon as I closed and re-opened them, I was cooking.

Render Issues

        <div class="control-group">
            {{ Form::submit('Login', array('class' => 'btn btn-primary')) }}&nbsp;&nbsp;{{ HTML::link('forgotpassword', "Can't remember your password?") }}
        </div>

something begins at array( and ends at {{ HTML::

Documentation tweak

Could you please update the ReadMe to be clearer that the HTML_5_ package is incompatible with laravel-blade.

It does say HTML, but it was only when I moused over it that I noticed it was the HTML5 package.

Otherwise, great package, thanks for contributing!

include highlighting

Noticed that while using the new array syntax that the highlighter breaks if you use parentheses.
screen shot 2014-10-10 at 12 41 17 am

HTML Blade Parsing Issue

<a href="{{ URL::to_action('intake@program_selection') }}">

In this scenario the {{}} and contents are highlighted as if they are within the HTML anchor href quotes.

Comment Issue

When I made a comment
{{-- --}}
It doesn't appear correctly

Commenting

Most packages allow CMD+/ to comment out the current selection line-by-line (with // in PHP, for example), or OPT+CMD+/ to comment it out in a block (e.g. /* ... */).

It would be great for your package to do this as well!

Updated syntax for Laravel 4

I've updated some of the blade syntax for Laravel 4. If you'll add another branch for Laravel 4 I'll be happy to create a pull request to it :)

Disable blade comments

Is there a way to revert "blade style comments" that were introduced in v1.5.2 or a way to use v1.5.1 without manually installing your package?

@show breaks laravel-blade

For some odd reason whenever i put

    <style>
    @section('styles')
    @show
    </style>

it breaks everything after it

it looks like this happens whenever the blade is inside the style tag

Whitespace before @ issue

Notice how the tab before the @ are highlighted, and the behaviour of the following...

The issue is probably with the regexes that go like this (\s{1}|^)\@\b(if|else|...)\b(?=(|\s*|)\()

But I cannot figure out how to make that first whitespace non-capturing.

Didn't work for .blade.php :(

Thanks for this plugin. However, it only works for .blade, but as soon as I change to .blade.php, it didn't work.

Any solutions?

Error opening Sublime

Hi Guys

I've started getting the following error opening Sublime:

Error loading syntax file "Packages/Laravel-Blade/Blade.tmLanguage": Error parsing plist xml: Failed to open file In file "Packages/Laravel-Blade/Blade.tmLanguage"

I tried deleting the package to reinstall it but still getting the message. Any ideas?

Highlighting issue

This particularly bad piece of code causes a parsing issue.

Notice "SeriesForm" and "ProgramForm" not being colored.

.blade.php is not recognized

I have this issue using TextMate 2.0 beta 6

In fact I always had this issue : file.blade.php are not recongized as blade until you select the Blade syntax. Then textmate remembers your choice for this only file and use Blade everytime you open the file, but the extension detection does not work for a reason I can't figure out.

Am I alone ? Did I miss something ?

Mixing Blade and HTML Comments

If I place HTML comments inside Blade comments, I lose syntax highlighting.

{{--
<!-- Some HTML Comment -->
@include('something')
--}}

screen shot 2013-08-12 at 2 27 16 pm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.