Skip to content

Commit

Permalink
feat: added markdown-rendering using laravels Illuminate-string-metho…
Browse files Browse the repository at this point in the history
…des closes #138
  • Loading branch information
stevan06v committed Mar 19, 2024
1 parent 92ed51b commit 67ecdc4
Show file tree
Hide file tree
Showing 7 changed files with 55 additions and 67 deletions.
3 changes: 1 addition & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
"livewire/livewire": "^3.4",
"livewire/volt": "^1.6",
"robsontenorio/mary": "^1.25",
"spatie/laravel-markdown": "^2.5",
"ueberdosis/pandoc": "^0.9.0"
"spatie/laravel-markdown": "^2.5"
},
"require-dev": {
"barryvdh/laravel-ide-helper": "^3.0",
Expand Down
58 changes: 1 addition & 57 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions resources/views/livewire/monitors/deployments.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
use Livewire\Volt\Component;
new class extends Component {
//
}; ?>

<div>
//
</div>
20 changes: 17 additions & 3 deletions resources/views/livewire/monitors/read-me-view.blade.php
Original file line number Diff line number Diff line change
@@ -1,16 +1,30 @@
<?php
use Livewire\Volt\Component;
use \Illuminate\Support\Str;
new class extends Component {
public $markdown_content;
public $project_url;
public function mount($markdown)
public function mount($monitor)
{
$this->markdown_content = Str::markdown($monitor->readme);
$this->project_url = $monitor->project_url;
}
}; ?>
<div>
{{ $markdown_content }}
<div class="border-other-grey border-2 rounded-2xl p-6">
<sl-icon name="info-circle" class="text-6xl font-bold text-primary-blue"></sl-icon>
<div class="prose mt-4">
{!! $markdown_content !!}
</div>
<div class="w-min mt-12">
<sl-button>
<a href="{{ $project_url }}" target="_blank">View Source</a>
</sl-button>
</div>
</div>
</div>
17 changes: 12 additions & 5 deletions resources/views/livewire/monitors/show.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,17 @@ public function mount(Monitor $monitor)
}; ?>

<div class="mx-8 mt-6">
<div class="border-other-grey border-2 rounded-2xl">
<livewire:monitors.card lazy="true" :monitor="$monitor"/>
</div>
<div>
<div class="mx-8 mt-6">
<div class="border-other-grey border-2 rounded-2xl">
<livewire:monitors.card lazy="true" :monitor="$monitor"/>
</div>

<livewire:monitors.read-me-view :markdown="$monitor->readme"/>
<div class="mt-8 grid grid-cols-3 gap-8">
<div class="col-span-2">
<livewire:monitors.read-me-view :monitor="$monitor"/>
</div>
<div class="border-other-grey border-2 rounded-2xl p-5">Deployments</div>
</div>
</div>
</div>
11 changes: 11 additions & 0 deletions resources/views/livewire/tasks/list.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?php
use Livewire\Volt\Component;
new class extends Component {
//
}; ?>

<div>
//
</div>
2 changes: 2 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@
Volt::route('/register', 'auth.register');

Volt::route('/repos', 'repositories.list');


0 comments on commit 67ecdc4

Please sign in to comment.