Coder Social home page Coder Social logo

shufo / blade-formatter Goto Github PK

View Code? Open in Web Editor NEW
432.0 7.0 24.0 3.45 MB

An opinionated blade template formatter for Laravel that respects readability

Home Page: https://www.npmjs.com/package/blade-formatter

License: MIT License

JavaScript 2.32% Dockerfile 0.10% TypeScript 97.36% Shell 0.02% Makefile 0.20%
formatter laravel blade

blade-formatter's Introduction

shufo

blade-formatter's People

Contributors

claytonrcarter avatar dave-ifour avatar dependabot-preview[bot] avatar dependabot[bot] avatar gagansday avatar garrettboone avatar github-actions[bot] avatar hjanos1 avatar joshuachp avatar jtanaka avatar ldommer avatar notdian avatar renovate[bot] avatar schelmo avatar shufo avatar sloveniangooner avatar yaegassy 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

blade-formatter's Issues

Couldn\'t resolve parser "php"

{ path: 'resources/views/user/filters/unsatisfieds.blade.php',
  message: 'Couldn\'t resolve parser "php"',
  error: Error: Couldn't resolve parser "php"
    at resolveParser$1 (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:10600:15)
    at normalize (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:10693:19)
    at formatWithCursor (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:14161:12)
    at /var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:42756:15
    at Object.format (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:42775:12)
    at prettifyPhpContentWithUnescapedTags (/var/www/html/node_modules/blade-formatter/src/util.js:79:25)
    at Proxy.formatAsPhp (/var/www/html/node_modules/blade-formatter/src/util.js:116:20)
    at Formatter.formatContent (/var/www/html/node_modules/blade-formatter/src/formatter.js:29:8)
    at util.readFile.then.then.content (/var/www/html/node_modules/blade-formatter/src/main.js:61:52)
    at <anonymous> }

This error is generated after running node_modules/.bin/blade-formatter --write resources/**/*.blade.php

Unexpected <

Im getting some odd errors in some views

{ path: 'resources/views/bonus/store.blade.php',
  message: 'Parse Error : syntax error, unexpected \'<\' on line 55\n\u001b[0m \u001b[90m 53 | \u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 54 | \u001b[39m                    \u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp \u001b[90m//@foreach ($downloadOptions as $d => $dO)\u001b[39m\u001b[0m\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 55 | \u001b[39m                        \u001b[33m<\u001b[39m\u001b[33mtr\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m    | \u001b[39m                       \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 56 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp  $dO[\u001b[32m\'description\'\u001b[39m]  \u001b[33m?\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 57 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp  $dO[\u001b[32m\'cost\'\u001b[39m]  \u001b[33m?\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 58 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m',
  error: 
   { SyntaxError: Parse Error : syntax error, unexpected '<' on line 55
  53 | 
  54 |                     <?php //@foreach ($downloadOptions as $d => $dO)
> 55 |                         <tr>
     |                        ^
  56 |                             <td><?php  $dO['description']  ?></td>
  57 |                             <td><?php  $dO['cost']  ?></td>
  58 |                             <td>
    at parser.raiseError (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser.js:319:17)
    at parser.error (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser.js:364:15)
    at parser.read_expr_item (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser/expr.js:446:12)
    at parser.read_expr (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser/expr.js:12:19)
    at parser.read_statement (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser/statement.js:383:27)
    at parser.read_top_statement (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser/statement.js:71:21)
    at parser.read_start (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser/main.js:18:19)
    at parser.parse (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/parser.js:277:23)
    at engine.parseCode (/usr/lib/node_modules/blade-formatter/node_modules/php-parser/src/index.js:167:22)
    at Object.parse (/usr/lib/node_modules/blade-formatter/node_modules/@prettier/plugin-php/src/parser.js:30:57)
     fileName: 'eval',
     loc: { start: [Object] },
     codeFrame: '\u001b[0m \u001b[90m 53 | \u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 54 | \u001b[39m                    \u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp \u001b[90m//@foreach ($downloadOptions as $d => $dO)\u001b[39m\u001b[0m\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 55 | \u001b[39m                        \u001b[33m<\u001b[39m\u001b[33mtr\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m    | \u001b[39m                       \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 56 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp  $dO[\u001b[32m\'description\'\u001b[39m]  \u001b[33m?\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 57 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp  $dO[\u001b[32m\'cost\'\u001b[39m]  \u001b[33m?\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 58 | \u001b[39m                            \u001b[33m<\u001b[39m\u001b[33mtd\u001b[39m\u001b[33m>\u001b[39m\u001b[0m' } }
{ path: 'resources/views/playlist/show.blade.php',
  message: 'Parse Error : syntax error, unexpected \'<\' on line 213\n\u001b[0m \u001b[90m 211 | \u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 212 | \u001b[39m\t\t\u001b[33m<\u001b[39m\u001b[33m?\u001b[39mphp \u001b[90m//<div class="block">\u001b[39m\u001b[0m\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 213 | \u001b[39m\t\t\t\t\u001b[33m<\u001b[39m\u001b[33mdiv\u001b[39m \u001b[36mclass\u001b[39m\u001b[33m=\u001b[39m\u001b[32m"row"\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m     | \u001b[39m\t\t\t\u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 214 | \u001b[39m\t\t\t\t\t\u001b[33m<\u001b[39m\u001b[33mdiv\u001b[39m \u001b[36mclass\u001b[39m\u001b[33m=\u001b[39m\u001b[32m"col-xs-6 col-sm-4 col-md-3"\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 215 | \u001b[39m\t\t\t\t\t\t\u001b[33m<\u001b[39m\u001b[33mdiv\u001b[39m \u001b[36mclass\u001b[39m\u001b[33m=\u001b[39m\u001b[32m"image-box text-center mb-20"\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 216 | \u001b[39m\t\t\t\t\t\t\t\u001b[33m<\u001b[39m\u001b[33mdiv\u001b[39m \u001b[36mclass\u001b[39m\u001b[33m=\u001b[39m\u001b[32m"overlay-container"\u001b[39m\u001b[33m>\u001b[39m\u001b[0m',

The < is not unexpected though.

nested directive not properly formatted

Current Behavior

nested @if directive produces unexpected result

Input

@if ($paginator->hasPages())
    <nav>
        <ul class="pagination">
        {{-- Previous Page Link --}}
    @if ($paginator->onFirstPage())
           <li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li>
    @else
           <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li>
    @endif

        {{-- Next Page Link --}}
        @if ($paginator->hasMorePages())
        <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li>
        @else
        <li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li>
        @endif
        </ul>
    </nav>
@endif

Output

❯ ./bin/blade-formatter if_nest.blade.php
@if ($paginator->hasPages())
    <nav>
        <ul class="pagination">
            {{-- Previous Page Link --}}
            @if ($paginator->onFirstPage())
                <li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li>
            @else
                <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li>
    @endif

    {{-- Next Page Link --}}
    @if ($paginator->hasMorePages())
        <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li>
    @else
        <li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li>
    @endif
    </ul>
    </nav>
@endif

Expected Behavior

Should output like belows

Output

@if ($paginator->hasPages())
    <nav>
        <ul class="pagination">
            {{-- Previous Page Link --}}
            @if ($paginator->onFirstPage())
                <li class="disabled" aria-disabled="true"><span>@lang('pagination.previous')</span></li>
            @else
                <li><a href="{{ $paginator->previousPageUrl() }}" rel="prev">@lang('pagination.previous')</a></li>
            @endif

            {{-- Next Page Link --}}
            @if ($paginator->hasMorePages())
                <li><a href="{{ $paginator->nextPageUrl() }}" rel="next">@lang('pagination.next')</a></li>
            @else
                <li class="disabled" aria-disabled="true"><span>@lang('pagination.next')</span></li>
            @endif
        </ul>
    </nav>
@endif

Object operator inside @if directives breaks aligned attributes

Expected Behavior

<input class="@if (empty($object->property)) something @endif"
       value="test" />

Current Behavior

<input class="@if (empty($object->property)) something @endif"
value="test" />

Possible Solution

Probably > inside @if directives regarded as xml tag closing symbol.
Any codes inside @if directives should be regarded as PHP.

Steps to Reproduce

Format html inside Expected Behavior using blade-formatter with --wrap-attributes preserve-aligned.

Context (Environment)

via VSCode extension v0.7.0

PHP code inside Blade @if and @foreach produce incorrect code

Hey, thanks for putting this project out. It's great to see someone making an effort towards autoformatting Blade templates!

Expected Behavior

I would expect the formatter to not modify the code's semantics.

Current Behavior

When formatting a document with PHP code inside a Blade @if or @foreach block, the formatter produces incorrect output, and repeated formats mutate the code further until ending up in a broken state.

Possible Solution

Steps to Reproduce

  1. Format the following code with blade-formatter 1.11.9:
<div>
    @if ($foobars)
        <?php
        // This is a comment
        echo 'foobar';
        ?>
    @endif
</div>
  1. Observe that the output is:
<div>
    @if ($foobars)
        <?php // This is a comment
        echo 'foobar'; ?>
    @endif
</div>
  1. Format it again, and observe that the comment is duplicated and an additional ?> is inserted, breaking the code:
<div>
    @if ($foobars)
        <?php // This is a comment
        // This is a comment
        ?>echo 'foobar'; ?>
    @endif
</div>
  1. Format it yet again, and observe that the code is now:
<div>
    @if ($foobars)
        <?php
        // This is a comment
        // This is a comment
        ?>echo 'foobar'; ?>
    @endif
</div>
  1. Further formats do not produce any further changes.

Here's a gif showing me repeatedly formatting the code:
0uWoFGr0jy

Skip Markdown Emails

This package formats (indents) markdown email templates in /views/emails and thus breaks it. Per Laravel docs.

Do not use excess indentation when writing Markdown emails. Markdown parsers will render indented content as code blocks.

long line with one-liner directive occurs error

Expected Behavior

<div>
@if ($some->user != null) {!! $achievement->user->pay !!} @endif
</div>

should format to

<div>
	@if ($some->user != null) {!! $achievement->user->pay !!} @endif
</div>

Current behaviour

Error occurs in long line with one-liner directive.

e.g.

@if ($some->user != null) {!! $achievement->user->pay !!} @endif

Possible Solution

To work around this.
Convert one-liner statement into multiline statement will suppress error.

bad

@if ($some->user != null) {!! $achievement->user->pay !!} @endif

good

@if ($some->user != null) 
	{!! $achievement->user->pay !!} 
@endif

Steps to Reproduce

  • Try format above statement

@forelse inside @if gets bad indentation

Expected Behavior

@if (true)
    <table>
        @forelse($elems as $elem)
            <tr></tr>
        @empty
            <tr></tr>
        @endforelse
    </table>
@endif

Current Behavior

@if (true)
    <table>
        @forelse($elems as $elem)
            <tr></tr>
        @empty
            <tr></tr>
@endforelse
</table>
@endif

Changed indent after `@section` with multiple arguments (from version 1.11.13)

Changed indent after @section with multiple arguments (from version 1.11.13)
Is this intended behavior?

Expected Behavior

Before 1.11.13

@section('content', 'title')
  <div class="some-class">
  </div>
@endsection

Current Behavior

From 1.11.13

@section('content', 'title')
<div class="some-class">
</div>
@endsection

Formatter adds unnecessary whitespaces to @json directives

Expected Behavior

<div data-single-quote='@json('string with single quote')'>
</div>

<div data-double-quote="@json("string with double quote")">
</div>

Current Behavior

<div data-single-quote='@json(' string with single quote')'>
</div>

<div data-double-quote="@json(" string with double quote")">
</div>

Formatter adds a white space after first quote inside @json directive.

Possible Solution

Regard codes inside @json directives as PHP.

Steps to Reproduce

Format HTML written in Expected Behavior

Context (Environment)

via VSCode extension v0.7.0

@for directive does not work

Expected Behavior

Input

@for ($i = 0; $i <= 5; $i++)
<div class="foo">
</div>
@endfor

Output

@for ($i = 0; $i <= 5; $i++)
    <div class="foo">
    </div>
@endfor

Current Behavior

@for ($i = 0; $i <= 5; $i++) <div class="foo">
    </div>
    @endfor

Possible Solution

Use @foreach instead

@foreach (range(0, 5) as $i)
<div class="foo">
{{ $i }}
</div>
@endforeach

Steps to Reproduce

  1. Write @for directive
  2. Format files

Context (Environment)

  • Linux 64bit
  • ver 1.1.4

Detailed Description

This is because js-beautifier used inside in blade-formatter could not parse @for directive

Possible Implementation

  • Use another html formatter to avoid js-beautifier parse behavor
  • Implement blade parser on my own

Format multiline directives

Expected Behavior

It should format multi line blade directives

Current Behavior

It flattens them

E.g.
It turns this

@button([
    'class' => 'btn btn-primary p-btn-wide',
    'text' => 'Save',
])

Into this:

@button([
'class' => 'btn btn-primary p-btn-wide',
'text' => 'Save',
])

"yarn.lock" unintentionally replaces "shufo/php-parser" with "czosel/php-parser"

Description

Is there any way to solve this problem?

Reproduce

prepare (Node v14.x.x)

mkdir -p /tmp/bfcheck
cd /tmp/bfcheck
npm init -y

yarn add [email protected]
cp yarn.lock before.lock

yarn add [email protected]

diff

$ diff yarn.lock before.lock
19c19
<     php-parser czosel/php-parser#b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
---
>     php-parser shufo/php-parser#0b7781fdf88be4b8974320cf27af1588c07e2da8
55,58c55,58
< [email protected]:
<   version "1.11.5"
<   resolved "https://registry.yarnpkg.com/blade-formatter/-/blade-formatter-1.11.5.tgz#a3b4175603f4c038ca39d013825532c435a83c65"
<   integrity sha512-BtRTC2mbCw0etWomcUHkefqAzInzOYO7FoqyhwQrat9+2PYhF0qcnqjG37UPJggFW0ohqHXsPXwnDYJp7mquhw==
---
> [email protected]:
>   version "1.11.4"
>   resolved "https://registry.yarnpkg.com/blade-formatter/-/blade-formatter-1.11.4.tgz#089ab1899199a53ae1d79c390049b11aaa5468ce"
>   integrity sha512-Y6ncCuim7YJt2NDQnlKYZzpXwrE4sFjZEUcaHuRSSY5gyxI3SrtyMOlM6Oh7UFAmD7xptRLe5lHIC7el9hNbMA==

Misc

In coc-blade-formatter, I manually modify yarn.lock every time as a workaround.

Related issue?

array_reduce function breaks

Current Behavior

These lines:
@php
$n = array_reduce($c, function ($tot, $i) {return $tot + $i; }, 0);
@endphp

are formatted like this:
@php
$n = array_reduce(
$c,
function ($tot, $i) {
return $tot + $i;
},
0,
);
@endphp

An extra comma is added after the last parameter (probably the formatter mistakes the array_reduce function for an array declaration). The issue probably affects other array_* functions.

An option to add indent after @case

Current Behavior

Switch directives are formatted into this style (from test case)

@switch($i)
    @case(1)
    First case...
    @break
    @case(2)
    Second case...
    @break
    @default
    Default case...
@endswitch

Prefered Behavior

but I prefer this style

@switch($i)
    @case(1)
        First case...
    @break
    @case(2)
        Second case...
    @break
    @default
        Default case...
@endswitch

Can you provide an option to configure this behaviour?

Context (Environment)

via VSCode extension v0.7.0

Doesn't work with short php tag

Expected Behavior

This should be ignored

<th><?= $userName ?></th>

Current Behavior

{ path:
   '../Modules/Admin/AdminDefault/Resources/views/translation/1.blade.php',
  message:
   "Parse Error : syntax error, unexpected '}', expecting ';' on line 1\n\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 1 | \u001b[39m\u001b[33m<\u001b[39m\u001b[33mth\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39m\u001b[33m=\u001b[39m $uesrName }}\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mth\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   | \u001b[39m               \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 | \u001b[39m\u001b[0m",
  error:
   { SyntaxError: Parse Error : syntax error, unexpected '}', expecting ';' on line 1
   > 1 | <th><?= $userName }}</th>
       |                ^
     2 | 
       at parser.raiseError (/node_modules/php-parser/src/parser.js:319:17)
       at parser.error (/node_modules/php-parser/src/parser.js:364:15)
       at parser.expectEndOfStatement (/node_modules/php-parser/src/parser.js:455:10)
       at parser.read_statement (/node_modules/php-parser/src/parser/statement.js:266:14)
       at parser.read_top_statement (/node_modules/php-parser/src/parser/statement.js:71:21)
       at parser.read_start (/node_modules/php-parser/src/parser/main.js:18:19)
       at parser.parse (/node_modules/php-parser/src/parser.js:277:23)
       at engine.parseCode (/node_modules/php-parser/src/index.js:167:22)
       at Object.parse (/node_modules/blade-formatter/node_modules/@prettier/plugin-php/src/parser.js:30:57)
       at Object.parse (/node_modules/blade-formatter/node_modules/prettier/index.js:9739:19)
     fileName: 'eval',
     loc: { start: [Object] },
     codeFrame:
      '\u001b[0m\u001b[31m\u001b[1m>\u001b[22m\u001b[39m\u001b[90m 1 | \u001b[39m\u001b[33m<\u001b[39m\u001b[33mth\u001b[39m\u001b[33m>\u001b[39m\u001b[33m<\u001b[39m\u001b[33m?\u001b[39m\u001b[33m=\u001b[39m $userName }}\u001b[33m<\u001b[39m\u001b[33m/\u001b[39m\u001b[33mth\u001b[39m\u001b[33m>\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m   | \u001b[39m               \u001b[31m\u001b[1m^\u001b[22m\u001b[39m\u001b[0m\n\u001b[0m \u001b[90m 2 | \u001b[39m\u001b[0m' } }

Possible Solution

short echo tag should be legal

Steps to Reproduce

  1. create tmp.blade.php
  2. add <th><?= $userName ?></th> to this file
    3.node_modules/.bin/blade-formatter -d -c tmp.blade.php
  3. see exception

Context (Environment)

Trying to beautify https://github.com/barryvdh/laravel-translation-manager/blob/master/resources/views/index.php

[feat] support ignore pattern

Context (Environment)

Motication

  • There is need to ignore specific files like email template to workaround problems with markdown embedded template like #9

Possible Implementation

  • create .bladeformatterignore or .bladeignore or something to ignore formatting target
resources/views/emails/**/*
  • Support gitignore like syntax

@lang() Issues

Expected Behavior

Not to add a space in @lang('torrent.stream-optimized')

Current Behavior

                            @if ($torrent->stream == 1)
                                <span class='badge-extra text-bold'>
                                    <i class='{{ config('other.font-awesome') }} fa-play text-red' data-toggle='tooltip'
-                                        title='' data-original-title='@lang('torrent.stream-optimized')'></i>
+                                        title='' data-original-title='@lang(' torrent.stream-optimized')'></i>
                                </span>
                            @endif

Possible Solution

No Idea.

Inserting padding in blank lines

Expected Behavior

Don't pad blank lines

Current Behavior

Pads new lines

Possible Solution

Delete all content in blank lines

Steps to Reproduce

  • Create a file with blank lines
  • blade-formatter --write --indent-size=8
  • Check padding in blank lines

Context (Environment)

Checked in VIM (where it doesn't trim blank lines by default)

Detailed Description

Check screenshot

image

This command messes up with vap in vim which "selects around paragraph"
image

Possible Implementation

Trim blank lines

What does complicated mean in the error message

Hey,

first of all this look like a really cool tool. Thanks for that.

So I tried it with a few blade files. But I this error for some files:
"Please check if template is too complicated or not. Or simplify template might solves issue."

What does too complicated mean? Too much lines or too much capsuled blocks?

Format all files and subfiles - Windows 10

Hey
Not really a bug or anything, probably just me being dim. I'm trying to find the correct syntax to format all files and subfiles in all directories within my project on Windows.
Here's what I have:

"./node_modules/.bin/blade-formatter --progress --write '**/*.blade.php'"

The above works fine on Linux systems, but doesn't on Windows. I thought perhaps the " were causing an issue, as that was the case with Prettier.
Can you help?
Cheers

Problem with opening / closing tags

Input:

@extends('dashboard')

@section('content')
@if( $member->isAdmin() )
<div class="focus">
@endif
<span>Test!</span>
@if( $member->isAdmin() )
</div>
@endif
@endsection

Output:

@extends('dashboard')

@section('content')
    @if( $member->isAdmin() )
        <div class="focus">
        @endif
        <span>Test!</span>
        @if( $member->isAdmin() )
        </div>
    @endif
@endsection

Desired output:

@extends('dashboard')

@section('content')
    @if( $member->isAdmin() )
        <div class="focus">
    @endif
    <span>Test!</span>
    @if( $member->isAdmin() )
        </div>
    @endif
@endsection

wrong indent with second parameter in @push, @prepend and @section

@if (true)
  @section('a-section', $some->content)
  @push('somewhere', 'something')
  @prepend('somewhere', 'something first')
@endif

translates into:

@if (true)
  @section('a-section', $some->content)
    @push('somewhere', 'something')
      @prepend('somewhere', 'something first')
      @endif

maybe there are more directives with parameters which, when used, doesnt require an end tag

@php raw block flattened on format

Expected Behavior

@php raw block like below

@php
if ($users) {
    $count = count($users);
}
@endphp

should format to

@php
	if ($users) {
    	$count = count($users);
	}
@endphp

or

@php
if ($users) {
   $count = count($users);
}
@endphp

Current Behavior

Currently codes within php raw block will flattened to

@php
if ($users) {
$count = count($users);
}
@endphp

Possible Solution

replace php codes within @php raw block to temporary stack with placeholder like @__raw_block_0__@ and restore code formatted as php by replacing placeholder with stacked code before format is done.

Context (Environment)

formatter white space inside directive arrow in a blade file

Expected Behavior

<script> @Isset($data['eval_gestionnaire']->project_perception) @endisset </script>

Current Behavior

<script> @Isset($data['eval_gestionnaire'] - > project_perception) @endisset </script>

Possible Solution

Except using @JSON() to declare the object outside isset , is there any other solution? -->

Steps to Reproduce

Context (Environment)

Detailed Description

Possible Implementation

nested parentheses in directive occurs error

Expected Behavior

even if nested parentheses in directive should not occurs error

Current Behavior

      <body class="hold-transition login-page"
          @if(config('admin.login_background_image'))style="background: url({{ config('admin.login_background_image') }}) no-repeat;background-size: cover;"
          @endif>

occurs error

blade directive in <script> tag causes error

Expected Behavior

It should not report error even if blade directive wraps scripts

<script>
  @if ($condition)
    let a = 0;
  @else
    let a = 1;
  @end

</script>

Current Behavior

Formatter reports error if blade directive used in <script> tag

<script>
  @if ($condition)
    let a = 0;
  @else
    let a = 1;
  @end

</script>

Possible Solution

  1. stack in directive into temporary location if there goes blade directive in scripts, and format then and return back
  2. report current limitation if blade directive used in scripts

do not touch php tags at the beginning

Expected Behavior

I have some blade files that start with php tag, I did that so IDE can understand what kind of type this variable is. For example

<?php
/**
 * @var \Modules\Common\PageDataBuilderV2\RenderableItems\Card $card
 */
?>
@extends('layouts.mainLayout')

@section('someBlock')
    //something
@endsection

If file starts with php tag don't touch it.

Current Behavior

file

<?php
/**
 * @var \Modules\Common\PageDataBuilderV2\RenderableItems\Card $card
 */
?>
@extends('layouts.mainLayout')

@section('someBlock')
    //something
@endsection

will be converted to

{{ /**
 * @var \Modules\Common\PageDataBuilderV2\RenderableItems\Card $card
 */ }}
@extends('layouts.mainLayout')

@section('someBlock')
    //something
@endsection

which breaks things

Possible Solution

Steps to Reproduce

  1. add <?php ?> at start of the file
  2. get exception

Possible Implementation

ignore the first <?php ?> of the file

Can't install [email protected]

Expected Behavior

Install finishes without any errors

Current Behavior

root@a7a28e2dfaed:/# npm install -g blade-formatter 
npm ERR! code 128
npm ERR! Command failed: git checkout b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
npm ERR! fatal: reference is not a tree: b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-03-30T08_34_33_019Z-debug.log
0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   '/usr/local/bin/node',
1 verbose cli   '/usr/local/bin/npm',
1 verbose cli   'install',
1 verbose cli   '-g',
1 verbose cli   'blade-formatter'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose npm-session 8ffa9cff2ba01e2b
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 http fetch GET 200 https://registry.npmjs.org/blade-formatter 102ms
8 http fetch GET 200 https://registry.npmjs.org/blade-formatter/-/blade-formatter-1.10.5.tgz 60ms
9 silly pacote tag manifest for blade-formatter@latest fetched in 175ms
10 timing stage:loadCurrentTree Completed in 189ms
11 silly install loadIdealTree
12 silly install cloneCurrentTreeToIdealTree
13 timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
14 silly install loadShrinkwrap
15 timing stage:loadIdealTree:loadShrinkwrap Completed in 1ms
16 silly install loadAllDepsIntoIdealTree
17 silly resolveWithNewModule [email protected] checking installable status
18 http fetch GET 200 https://registry.npmjs.org/chalk 62ms
19 http fetch GET 200 https://registry.npmjs.org/glob 107ms
20 http fetch GET 200 https://registry.npmjs.org/lodash 108ms
21 http fetch GET 200 https://registry.npmjs.org/detect-indent 112ms
22 http fetch GET 200 https://registry.npmjs.org/concat-stream 122ms
23 http fetch GET 200 https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz 64ms
24 http fetch GET 200 https://registry.npmjs.org/ignore 125ms
25 http fetch GET 200 https://registry.npmjs.org/js-beautify 126ms
26 http fetch GET 200 https://registry.npmjs.org/php-parser 130ms
27 silly pacote range manifest for chalk@^4.1.0 fetched in 141ms
28 silly resolveWithNewModule [email protected] checking installable status
29 http fetch GET 200 https://registry.npmjs.org/esm 140ms
30 http fetch GET 200 https://registry.npmjs.org/glob/-/glob-7.1.6.tgz 38ms
31 silly pacote range manifest for glob@^7.1.4 fetched in 163ms
32 silly resolveWithNewModule [email protected] checking installable status
33 http fetch GET 200 https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz 66ms
34 http fetch GET 200 https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz 72ms
35 http fetch GET 200 https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz 61ms
36 silly pacote range manifest for concat-stream@^2.0.0 fetched in 197ms
37 silly resolveWithNewModule [email protected] checking installable status
38 silly pacote range manifest for detect-indent@^6.0.0 fetched in 199ms
39 silly resolveWithNewModule [email protected] checking installable status
40 silly pacote range manifest for ignore@^5.1.8 fetched in 197ms
41 silly resolveWithNewModule [email protected] checking installable status
42 http fetch GET 200 https://registry.npmjs.org/vscode-oniguruma 108ms
43 http fetch GET 200 https://registry.npmjs.org/php-parser/-/php-parser-3.0.2.tgz 138ms
44 http fetch GET 200 https://registry.npmjs.org/js-beautify/-/js-beautify-1.13.5.tgz 142ms
45 http fetch GET 200 https://registry.npmjs.org/esm/-/esm-3.2.25.tgz 135ms
46 http fetch GET 200 https://registry.npmjs.org/prettier 137ms
47 silly pacote range manifest for php-parser@^3.0.0-prerelease.9 fetched in 281ms
48 silly pacote range manifest for js-beautify@^1.10.2 fetched in 284ms
49 silly resolveWithNewModule [email protected] checking installable status
50 silly resolveWithNewModule [email protected] checking installable status
51 http fetch GET 200 https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz 168ms
52 silly pacote range manifest for esm@^3.2.25 fetched in 288ms
53 silly resolveWithNewModule [email protected] checking installable status
54 silly pacote range manifest for lodash@^4.17.19 fetched in 288ms
55 silly resolveWithNewModule [email protected] checking installable status
56 http fetch GET 200 https://registry.npmjs.org/yargs 96ms
57 http fetch GET 200 https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz 76ms
58 silly pacote range manifest for yargs@^15.3.0 fetched in 183ms
59 silly resolveWithNewModule [email protected] checking installable status
60 http fetch GET 200 https://registry.npmjs.org/vscode-oniguruma/-/vscode-oniguruma-1.3.1.tgz 104ms
61 silly pacote version manifest for [email protected] fetched in 221ms
62 silly resolveWithNewModule [email protected] checking installable status
63 http fetch GET 200 https://registry.npmjs.org/prettier/-/prettier-2.2.1.tgz 442ms
64 silly pacote range manifest for prettier@^2.2.0 fetched in 586ms
65 silly resolveWithNewModule [email protected] checking installable status
66 http fetch GET 200 https://registry.npmjs.org/vscode-textmate 843ms
67 http fetch GET 200 https://registry.npmjs.org/vscode-textmate/-/vscode-textmate-4.4.0.tgz 45ms
68 silly pacote range manifest for vscode-textmate@^4.2.2 fetched in 892ms
69 silly resolveWithNewModule [email protected] checking installable status
70 info lifecycle @prettier/[email protected]~prepack: @prettier/[email protected]
71 info lifecycle @prettier/[email protected]~postpack: @prettier/[email protected]
72 silly pacote git manifest for @prettier/plugin-php@github:prettier/plugin-php#ed00e2a07851cfacba0f8648dc7b209be6b9e6b9 fetched in 3923ms
73 silly resolveWithNewModule @prettier/[email protected] checking installable status
74 http fetch GET 200 https://registry.npmjs.org/linguist-languages 153ms
75 http fetch GET 200 https://registry.npmjs.org/mem 154ms
76 http fetch GET 200 https://registry.npmjs.org/linguist-languages/-/linguist-languages-7.13.0.tgz 55ms
77 http fetch GET 200 https://registry.npmjs.org/mem/-/mem-8.1.0.tgz 54ms
78 silly pacote range manifest for linguist-languages@^7.5.1 fetched in 212ms
79 silly resolveWithNewModule [email protected] checking installable status
80 silly pacote range manifest for mem@^8.0.0 fetched in 213ms
81 silly resolveWithNewModule [email protected] checking installable status
82 silly fetchPackageMetaData error for php-parser@github:czosel/php-parser#b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa Command failed: git checkout b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
82 silly fetchPackageMetaData fatal: reference is not a tree: b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
83 timing stage:rollbackFailedOptional Completed in 1ms
84 timing stage:runTopLevelLifecycles Completed in 7795ms
85 verbose stack Error: Command failed: git checkout b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
85 verbose stack fatal: reference is not a tree: b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
85 verbose stack
85 verbose stack     at ChildProcess.exithandler (child_process.js:308:12)
85 verbose stack     at ChildProcess.emit (events.js:314:20)
85 verbose stack     at maybeClose (internal/child_process.js:1021:16)
85 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
86 verbose cwd /
87 verbose Linux 5.4.0-67-generic
88 verbose argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "-g" "blade-formatter"
89 verbose node v12.19.0
90 verbose npm  v6.14.8
91 error code 128
92 error Command failed: git checkout b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
92 error fatal: reference is not a tree: b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa
93 verbose exit [ 1, true ]

Possible Solution

Stop using prettier/plugin-php#ed00e2a07851cfacba0f8648dc7b209be6b9e6b9 which uses czosel/php-parser#b55446b48a4a588e8b62c7f9085ce0e7cb3b70fa.
Maintainer of czosel/php-parser removed that commit from GitHub.

Steps to Reproduce

  1. Run npm install [email protected]

Context (Environment)

The extension keeps indenting HTML string in script tag every time

Dear sir,
The extension indents my HTML string in the script tag every time I format blade files. It keeps formatting like this forever.
Sorry for my probably terrible english, since it is not my first language.

Expected Behavior

Before

@push('scripts')
    <script>
        const html = `<ul>
                        <li>Coffee</li>
                        <li>Tea</li>
                        <li>Milk</li>
                    </ul>`;
    </script>
@endpush

After

@push('scripts')
    <script>
        const html = `<ul>
                        <li>Coffee</li>
                        <li>Tea</li>
                        <li>Milk</li>
                    </ul>`;
    </script>
@endpush

Current Behavior

Before

@push('scripts')
    <script>
        const html = `<ul>
                        <li>Coffee</li>
                        <li>Tea</li>
                        <li>Milk</li>
                    </ul>`;
    </script>
@endpush

After 1st format

@push('scripts')
    <script>
        const html = `<ul>
                            <li>Coffee</li>
                            <li>Tea</li>
                            <li>Milk</li>
                        </ul>`;

    </script>
@endpush

After 2nd format

@push('scripts')
    <script>
        const html = `<ul>
                                <li>Coffee</li>
                                <li>Tea</li>
                                <li>Milk</li>
                            </ul>`;

    </script>
@endpush

[Question]Do you have plans for stdin support?

Thanks for this tool.

I mainly use Vim.

Support for stdin makes it easier and more convenient to integrate from other editors.

Example:

cat sample.blade.php | blade-formatter
# or
cat sample.blade.php | blade-formatter -

Do you have a plan for stdin support?

Cannot change indent size correctly.

if format with option -i2 then mix 2paces and 4spaces like below.

@extends('frontend.layouts.app')
@section('title') foo
@endsection
@section('content')
  <section id="content">
      <div class="container mod-users-pd-h">
          <div class="pf-user-header">
              <div></div>
              <p>@lang('users.index')</p>
          </div>
          <div class="pf-users-branch">
              <ul class="pf-users-branch__list">
                  @foreach($users as $user)
                    <li>
                        <img src="{{ asset('img/frontend/icon/branch-arrow.svg') }}" alt="branch_arrow">
                        {{ link_to_route('frontend.users.user.show', $users['name'], $users['_id']) }}
                    </li>
                  @endforeach
              </ul>
              <div class="pf-users-branch__btn">
                  @can('create', App\Models\User::class)
                    {!! link_to_route('frontend.users.user.create', __('users.create'), [1, 2, 3], ['class' => 'btn']) !!}
                  @endcan
              </div>
          </div>
      </div>
  </section>
@endsection
@section('footer')
@stop

Support standard input

Problem

Currently input is only supported by file path.

Solution

  • Option --stdin (like ESLint)
  • or pipe operation should be supported

Combination of Blade's block level directives and PHP's alternative foreach syntax make formatter add indent forever

Expected Behavior

I would expect the formatter to not add indentation on each format.

Current Behavior

When formatting a document which is wrapped in a block-level directive like @section(''), using other block-level Blade directives like @if and @foreach inside an PHP alternative style foreach block cause the formatter to keep adding indentation on each format.

Steps to Reproduce

  1. Format the following code with blade-formatter 1.11.9:
@section('section')
<?php
    foreach ($foos as $foo):
?>
    @if($foo)
        <div><?= $foo ?></div>
    @endif
<?php endforeach; ?>
@endsection
  1. Observe that the output is the following. Notice the mismatched indentation on @if and @foreach
@section('section')
    <?php foreach ($foos as $foo): ?>
    @if ($foo)
        <div><?= $foo ?></div>
        @endif
    <?php endforeach; ?>
@endsection
  1. Format the same document again, and observe that the output is:
@section('section')
    <?php foreach ($foos as $foo): ?>
    @if ($foo)
        <div><?= $foo ?></div>
            @endif
        <?php endforeach; ?>
@endsection
  1. Format again:
@section('section')
    <?php foreach ($foos as $foo): ?>
    @if ($foo)
        <div><?= $foo ?></div>
                @endif
            <?php endforeach; ?>
@endsection
  1. And a few more times:
@section('section')
    <?php foreach ($foos as $foo): ?>
    @if ($foo)
        <div><?= $foo ?></div>
                                                @endif
                                            <?php endforeach; ?>
@endsection

Here's a gif:

RfVFaE6M6k

@if in html class occurs error

Expected Behavior

@if (count($topics))
  <ul class="list-group border-0">
    @foreach ($topics as $topic)
      <li class="list-group-item border-right-0 border-left-0 @if($loop->first) border-top-0 @endif"></li>
    @endforeach
  </ul>
@endif

Current Behavior

@if (count($topics))
  <ul class="list-group border-0">
    @foreach ($topics as $topic)
      <li class="list-group-item border-right-0 border-left-0 <beautify start=" @if " exp=" ^^^$loop->first^^^">
        border-top-0
    @endif"></li>
@endforeach
</ul>
@endif

Buffer() DeprecationWarning on VS Code v1.49

The issue occurs only the first time enable blade-formatter, after that it works just fine.

Steps to Reproduce

  1. On VS Code v1.49, install the extension.
  2. Set user config (~/.config/Code/User/settings.json)
  "editor.formatOnSave": true,
  "[blade]": {
    "editor.autoClosingBrackets": "always",
    "editor.defaultFormatter": "shufo.vscode-blade-formatter"
  },
  1. Open any blade.php file, make a change and save. It will show warning notification, and waiting for something.

Saving 'xxxxxx.blade.php': Running 'Laravel Blade formatter' Formatter ([configure](command:workbench.action.openSettings...

  1. Click 'cancel', on the warning notification to stop it. I found the following warning on VS Code output panel, BLADE Language Server channel.

[Error - 8:18:13 AM] (node:7037) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

Noted that if I make change on the blade file again, it will works as expected.

Laravel @php Helper

Instead of just removing code like @php $bg = rand(1, 13); $bgchange = $bg.".jpg"; @endphp from a view wouldn't it be better to just throw a warning that using @php tag in views is frowned upon to avoid breaking views?

Inline php directive gets unexpected indentation

Expected Behavior

inline @php directive should keep indentation like below template

@extends('user.auth.page')
    @php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') )

@section('content')

@stop

Current Behavior

@extends('user.auth.page')
    @php( $password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url', 'password/reset') )

@section('content')

@stop

will format into

@extends('user.auth.page')

@php($password_reset_url = View::getSection('password_reset_url') ?? config('adminlte.password_reset_url',
    'password/reset'))

    @section('content')

    @stop

Latest Release Is Broken

Expected Behavior

node_modules/.bin/blade-formatter resources/**/*.blade.php To Work.

Current Behavior

{ path: 'resources/views/user/notification.blade.php',
  message: 'Couldn\'t resolve parser "php"',
  error:
   Error: Couldn't resolve parser "php"
       at resolveParser (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:11343:15)
       at normalize$1 (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:11438:18)
       at formatWithCursor (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:15034:12)
       at args (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:51620:12)
       at Object.format (/var/www/html/node_modules/blade-formatter/node_modules/prettier/index.js:51640:12)
       at prettifyPhpContentWithUnescapedTags (/var/www/html/node_modules/blade-formatter/src/util.js:78:25)
       at Proxy.formatAsPhp (/var/www/html/node_modules/blade-formatter/src/util.js:121:20)
       at Formatter.formatContent (/var/www/html/node_modules/blade-formatter/src/formatter.js:30:8)
       at util.readFile.then.then (/var/www/html/node_modules/blade-formatter/src/main.js:63:54) }

error occurs on unescape blade brace

Current Behavior

                                    @if ($achievement->user != null) {!!
											$achievement->user->pay2 !!} @endif

occurs error

Expected Behavior

It should not be error even if return code exists

                                    @if ($achievement->user != null) 
                                       {!! $achievement->user->pay2 !!} @endif

Possible Solution

  • Stack unescape blade braces

escape brace cause format error

Expected Behavior

Format properly

Current Behavior

  • Can't format

Steps to Reproduce

  • Format below template
{!! Form::open(['method' => 'DELETE', 'route' => ['roles.destroy', $role->id], 'style' => 'display:inline']) !!}
{!! Form::submit('Delete', ['class' => 'btn btn-danger']) !!}
{!! Form::close() !!}

Context (Environment)

Break all properties or none

Expected Behavior

.............................|<--- 120 chars here
<div this="xxx" has="" many="" props="" one="more">

or

<div 
    this="xxx" 
    has="" 
    many="" props=""
    one="more"
>

Current Behavior

<div this="xxx" has="" many="" 
     props="" one="more">

When the lines reaches max (default 120) it breaks a tag into multiple lines. It seems like it tries to fill up a line at a time or something.

Possible Solution

If max width is reach break a tags props one per line.

Steps to Reproduce

Make a long line.

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.