-
Notifications
You must be signed in to change notification settings - Fork 17
Documentation search #114
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Documentation search #114
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
1cedb17
добавление функционала по поиску
agoalofalife 5240acb
добавление функционала по поиску
agoalofalife 67d9161
Changed detect `sections`
tabuna 2961d7b
Fixed code style
tabuna 49ce61b
WIP
tabuna e6fb9f4
WIP
tabuna ba25d66
WIP
tabuna e78d204
WIP
tabuna 9e3e5d1
WIP
tabuna File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,3 +71,5 @@ QUIZ_STATUS=false | |
TELEGRAM_BOT_TOKEN= | ||
TELEGRAM_CHAT_ID= | ||
TELEGRAM_CHANNEL_ID= | ||
|
||
SCOUT_DRIVER= |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<?php | ||
|
||
namespace App\Models; | ||
|
||
use Illuminate\Database\Eloquent\Casts\Attribute; | ||
use Illuminate\Database\Eloquent\Concerns\HasUuids; | ||
use Illuminate\Database\Eloquent\Factories\HasFactory; | ||
use Illuminate\Database\Eloquent\Model; | ||
use Laravel\Scout\Searchable; | ||
|
||
class DocumentationSection extends Model | ||
{ | ||
use HasFactory, HasUuids, Searchable; | ||
|
||
/** | ||
* The attributes that are mass assignable. | ||
* | ||
* @var array | ||
*/ | ||
protected $fillable = [ | ||
'id', | ||
'title', | ||
'title_page', | ||
'slug', | ||
'version', | ||
'file', | ||
'content', | ||
'level', | ||
]; | ||
|
||
/** | ||
* @return \Illuminate\Database\Eloquent\Casts\Attribute | ||
*/ | ||
protected function fileForUrl(): Attribute | ||
{ | ||
return Attribute::make( | ||
get: fn (mixed $value, array $attributes) => str_replace('.md', '', $attributes['file']), | ||
); | ||
} | ||
|
||
/** | ||
* @return array | ||
*/ | ||
public function toSearchableArray() | ||
{ | ||
return [ | ||
'title' => $this->title, | ||
'content' => $this->content, | ||
'level' => $this->level, | ||
]; | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
34 changes: 34 additions & 0 deletions
34
database/migrations/2024_03_17_133145_create_documentation_sections_table.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
use Illuminate\Database\Migrations\Migration; | ||
use Illuminate\Database\Schema\Blueprint; | ||
use Illuminate\Support\Facades\Schema; | ||
|
||
return new class extends Migration | ||
{ | ||
/** | ||
* Run the migrations. | ||
*/ | ||
public function up(): void | ||
{ | ||
Schema::create('documentation_sections', function (Blueprint $table) { | ||
$table->uuid('id')->primary(); | ||
$table->string('title_page')->comment('Заголовок всей страницы'); | ||
$table->string('title'); | ||
$table->integer('level')->nullable()->comment('Уровень заголовка'); | ||
$table->string('slug'); | ||
$table->string('version'); | ||
$table->string('file'); | ||
$table->text('content'); | ||
$table->timestamps(); | ||
}); | ||
} | ||
|
||
/** | ||
* Reverse the migrations. | ||
*/ | ||
public function down(): void | ||
{ | ||
Schema::dropIfExists('documentation_sections'); | ||
} | ||
}; |
28 changes: 14 additions & 14 deletions
28
public/build/assets/app-BUWIDZ8f.js → public/build/assets/app-B-hWsIbj.js
Large diffs are not rendered by default.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Как насчет комментария хотя бы? 😀