From 1013cd0456d09a463d8b9c63e7d3671918fd6500 Mon Sep 17 00:00:00 2001 From: Frankie B Date: Fri, 28 Jul 2023 23:45:33 +0100 Subject: Add hlphp & codeblock component --- resources/views/components/codeblock.blade.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 resources/views/components/codeblock.blade.php (limited to 'resources/views/components') diff --git a/resources/views/components/codeblock.blade.php b/resources/views/components/codeblock.blade.php new file mode 100644 index 0000000..8dcebda --- /dev/null +++ b/resources/views/components/codeblock.blade.php @@ -0,0 +1,14 @@ +@php +$file_path = "code/".$file; +$file_name = basename($file_path); + +$hl = new \Highlight\Highlighter(); + +$highlighted = $hl->highlight($lang, Storage::disk('local')->get($file_path)); +$file_size = Storage::disk('local')->size($file_path); +@endphp +
+    

{{ $file_name }} {{ $file_size}} bytes

+
+ {!! $highlighted->value !!} +
-- cgit v1.2.3-54-g00ecf