Basic Implement
This commit is contained in:
parent
926bcd4970
commit
895d0178cb
|
@ -0,0 +1,32 @@
|
|||
<html>
|
||||
|
||||
<head>
|
||||
<title>App Name - @yield('title')</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
@section('sidebar') This is the {{ $mater }} sidebar.
|
||||
@show
|
||||
|
||||
<div class="container">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
@component('alert')
|
||||
@slot('title') Forbidden
|
||||
@endslot
|
||||
<strong>Whoops!</strong> Something went wrong!
|
||||
@endcomponent
|
||||
|
||||
@foreach ($users as $user)
|
||||
@if ($user->type == 1)
|
||||
@continue
|
||||
@endif
|
||||
<li>{{ $user->name }}</li>
|
||||
@if ($user->number == 5)
|
||||
@break
|
||||
@endif
|
||||
@endforeach
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,31 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>App Name - @yield('title')</title>
|
||||
</head>
|
||||
<body>
|
||||
@section('sidebar')
|
||||
This is the {{ $mater }} sidebar.
|
||||
@show
|
||||
|
||||
<div class="container">
|
||||
@yield('content')
|
||||
</div>
|
||||
|
||||
@component('alert')
|
||||
@slot('title')
|
||||
Forbidden
|
||||
@endslot
|
||||
<strong>Whoops!</strong> Something went wrong!
|
||||
@endcomponent
|
||||
|
||||
@foreach ($users as $user)
|
||||
@if ($user->type == 1)
|
||||
@continue
|
||||
@endif
|
||||
<li>{{ $user->name }}</li>
|
||||
@if ($user->number == 5)
|
||||
@break
|
||||
@endif
|
||||
@endforeach
|
||||
</body>
|
||||
</html>
|
|
@ -44,7 +44,7 @@ describe "BeautifyLanguages", ->
|
|||
|
||||
# Activate all of the languages
|
||||
allLanguages = [
|
||||
"c", "clojure", "coffee-script", "css", "csharp", "d",
|
||||
"blade", "c", "clojure", "coffee-script", "css", "csharp", "d",
|
||||
"gfm", "go", "html", "html-swig", "java", "javascript",
|
||||
"json", "less", "lua", "marko", "mustache", "objective-c",
|
||||
"perl", "php", "python", "ruby", "sass", "sql",
|
||||
|
|
|
@ -6,6 +6,7 @@ module.exports = class JSBeautify extends Beautifier
|
|||
link: "https://github.com/beautify-web/js-beautify"
|
||||
|
||||
options: {
|
||||
Blade: true
|
||||
HTML: true
|
||||
XML: true
|
||||
Handlebars: true
|
||||
|
@ -51,6 +52,16 @@ module.exports = class JSBeautify extends Beautifier
|
|||
beautifyCSS = require("js-beautify").css
|
||||
text = beautifyCSS(text, options)
|
||||
resolve text
|
||||
when "Blade"
|
||||
beautifyHTML = require("js-beautify").html
|
||||
# pre script (Workaround)
|
||||
text = text.replace(/\@(?!yield)([^\n\s]*)/ig, "<blade $1 />")
|
||||
text = beautifyHTML(text, options)
|
||||
# post script (Workaround)
|
||||
text = text.replace(/<blade ([^\n]*)\/>/ig, "@$1")
|
||||
text = text.replace(/\(\ \'/ig, "('")
|
||||
@debug("Beautified HTML: #{text}")
|
||||
resolve text
|
||||
else
|
||||
reject(new Error("Unknown language for JS Beautify: "+language))
|
||||
catch err
|
||||
|
|
|
@ -0,0 +1,22 @@
|
|||
module.exports = {
|
||||
|
||||
name: "Blade"
|
||||
namespace: "blade"
|
||||
fallback: ["html", "php"]
|
||||
|
||||
###
|
||||
Supported Grammars
|
||||
###
|
||||
grammars: [
|
||||
"Blade"
|
||||
]
|
||||
|
||||
###
|
||||
Supported extensions
|
||||
###
|
||||
extensions: [
|
||||
"blade.php"
|
||||
]
|
||||
|
||||
options: []
|
||||
}
|
|
@ -15,6 +15,7 @@ module.exports = class Languages
|
|||
"apex"
|
||||
"arduino"
|
||||
"bash"
|
||||
"blade"
|
||||
"c-sharp"
|
||||
"c"
|
||||
"clojure"
|
||||
|
|
Loading…
Reference in New Issue