调整Laravel Blade的Atom-Beautify / JS-Beautify

时间:2019-06-24 06:37:21

标签: php atom-editor laravel-blade js-beautify atom-beautify

我喜欢在Atom中自定义JS-Beautify,以更好地格式化刀片文件。

我们的手动样式如下:

{{--
  Template Name: Full Width Template
--}}
<!-- template-fullwidth -->

@extends('layouts.app')

@section('content')
  @while(have_posts()) 
    @php the_post() @endphp
    @include('sections.content-page')
  @endwhile
@endsection

JS-Beautify给了我们这个

{{-- Template Name: Full Width Template
--}}
<!-- template-fullwidth -->
@extends('layouts.app')
@section('content')
@while(have_posts())
@php the_post()
@endphp
@include('sections.content-page')
@endwhile
@endsection

我尝试配置.jsbeautifyrc文件,但是没有运气。

我想:

  1. 保留评论行
  2. 在选择指令[@extends,@section]
  3. 前添加一个空行
  4. 在@section指令内缩进行
  5. 缩进@while和@if内的项目
  6. 将@php代码和@endphp放在一行上

否则,所有这些都不具备某种可读性强,格式正确的代码,而不仅仅是一堆指令。

可以做到吗?

0 个答案:

没有答案