Add tex compiler
This commit is contained in:
parent
aa8c9dcfd8
commit
c8304a48c7
|
@ -0,0 +1,12 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tex;
|
||||||
|
|
||||||
|
use Illuminate\View\Compilers\BladeCompiler;
|
||||||
|
|
||||||
|
class TexCompiler extends BladeCompiler
|
||||||
|
{
|
||||||
|
|
||||||
|
protected $contentTags = ['<<<', '>>>'];
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,35 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Tex;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use Illuminate\View\Compilers\BladeCompiler;
|
||||||
|
use Illuminate\View\DynamicComponent;
|
||||||
|
use Illuminate\View\Engines\CompilerEngine;
|
||||||
|
|
||||||
|
class TexServiceProvider extends ServiceProvider
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Register services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function register()
|
||||||
|
{
|
||||||
|
view()->addExtension('tex', 'tex', function() {
|
||||||
|
$compiler = new TexCompiler(app('files'), config('view.compiled'));
|
||||||
|
|
||||||
|
return new CompilerEngine($compiler, app('files'));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Bootstrap services.
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
|
*/
|
||||||
|
public function boot()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue