Skip to content

Commit 713f62f

Browse files
committed
chore: install torchlight.dev
1 parent d69a4cc commit 713f62f

File tree

5 files changed

+133
-10
lines changed

5 files changed

+133
-10
lines changed

.env.example

+2
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,7 @@ PUSHER_APP_CLUSTER=mt1
5151
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
5252
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
5353

54+
TORCHLIGHT_TOKEN=
55+
5456
SENTRY_LARAVEL_DSN=
5557
SENTRY_TRACES_SAMPLE_RATE=1

app/Http/Kernel.php

+9-8
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ class Kernel extends HttpKernel
1414
* @var array
1515
*/
1616
protected $middleware = [
17+
\Torchlight\Middleware\RenderTorchlight::class,
1718
// \App\Http\Middleware\TrustHosts::class,
1819
\App\Http\Middleware\TrustProxies::class,
1920
\Fruitcake\Cors\HandleCors::class,
@@ -54,14 +55,14 @@ class Kernel extends HttpKernel
5455
* @var array
5556
*/
5657
protected $routeMiddleware = [
57-
'auth' => \App\Http\Middleware\Authenticate::class,
58-
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
59-
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
60-
'can' => \Illuminate\Auth\Middleware\Authorize::class,
61-
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
58+
'auth' => \App\Http\Middleware\Authenticate::class,
59+
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
60+
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
61+
'can' => \Illuminate\Auth\Middleware\Authorize::class,
62+
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
6263
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
63-
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
64-
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
65-
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
64+
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
65+
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
66+
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
6667
];
6768
}

composer.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
"laravel/tinker": "^2.5",
1818
"livewire/livewire": "^2.8",
1919
"ph7jack/wireui": "^0.14.2",
20-
"sentry/sentry-laravel": "^2.10"
20+
"sentry/sentry-laravel": "^2.10",
21+
"torchlight/torchlight-laravel": "^0.5.7"
2122
},
2223
"require-dev": {
2324
"facade/ignition": "^2.5",

composer.lock

+66-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config/torchlight.php

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
<?php
2+
3+
return [
4+
// The Torchlight client caches highlighted code blocks. Here
5+
// you can define which cache driver you'd like to use. If
6+
// leave this blank your default app cache will be used.
7+
'cache' => env('TORCHLIGHT_CACHE_DRIVER'),
8+
9+
// Which theme you want to use. You can find all of the themes at
10+
// https://torchlight.dev/docs/themes.
11+
'theme' => env('TORCHLIGHT_THEME', 'material-theme-palenight'),
12+
13+
// Your API token from torchlight.dev.
14+
'token' => env('TORCHLIGHT_TOKEN'),
15+
16+
// If you want to register the blade directives, set this to true.
17+
'blade_components' => true,
18+
19+
// The Host of the API.
20+
'host' => env('TORCHLIGHT_HOST', 'https://api.torchlight.dev'),
21+
22+
// We replace tabs in your code blocks with spaces in HTML. Set
23+
// the number of spaces you'd like to use per tab. Set to
24+
// `false` to leave literal tabs in the HTML.
25+
'tab_width' => 4,
26+
27+
// If you pass a filename to the code component or in a markdown
28+
// block, Torchlight will look for code snippets in the
29+
// following directories.
30+
'snippet_directories' => [
31+
resource_path()
32+
],
33+
34+
// Global options to control blocks-level settings.
35+
// https://torchlight.dev/docs/options
36+
'options' => [
37+
// Turn line numbers on or off globally.
38+
// 'lineNumbers' => false,
39+
40+
// Control the `style` attribute applied to line numbers.
41+
// 'lineNumbersStyle' => '',
42+
43+
// Turn on +/- diff indicators.
44+
// 'diffIndicators' => true,
45+
46+
// If there are any diff indicators for a line, put them
47+
// in place of the line number to save horizontal space.
48+
// 'diffIndicatorsInPlaceOfLineNumbers' => true,
49+
50+
// When lines are collapsed, this is the text that will
51+
// be shown to indicate that they can be expanded.
52+
// 'summaryCollapsedIndicator' => '...',
53+
]
54+
];

0 commit comments

Comments
 (0)