Skip to content

Commit

Permalink
Merge pull request #8 from better-futures-studio/updates
Browse files Browse the repository at this point in the history
Commit updates.
  • Loading branch information
AbdelElrafa committed Oct 1, 2023
2 parents d8c659e + b76122e commit e1853e2
Show file tree
Hide file tree
Showing 13 changed files with 43 additions and 69 deletions.
2 changes: 1 addition & 1 deletion .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
github: abdelelrafa
github: better-futures-studio
6 changes: 3 additions & 3 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/abdelelrafa/docs-panel/discussions/new?category=q-a
url: https://github.com/better-futures-studio/docs-panel/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/abdelelrafa/docs-panel/discussions/new?category=ideas
url: https://github.com/better-futures-studio/docs-panel/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a security issue
url: https://github.com/abdelelrafa/docs-panel/security/policy
url: https://github.com/better-futures-studio/docs-panel/security/policy
about: Learn how to notify us for sensitive bugs
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) abdelelrafa <AbdelElrafa@users.noreply.github.com>
Copyright (c) Better Futures Studio

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# A Filament Panel for your applications public documentation.

[![Latest Version on Packagist](https://img.shields.io/packagist/v/abdelelrafa/docs-panel.svg?style=flat-square)](https://packagist.org/packages/abdelelrafa/docs-panel)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/abdelelrafa/docs-panel/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/abdelelrafa/docs-panel/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/abdelelrafa/docs-panel/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/AbdelElrafa/docs-panel/actions?query=branch%3Amain+workflow%3A%22Fix+PHP+Code+Styling%22)
[![Total Downloads](https://img.shields.io/packagist/dt/abdelelrafa/docs-panel.svg?style=flat-square)](https://packagist.org/packages/abdelelrafa/docs-panel)
[![Latest Version on Packagist](https://img.shields.io/packagist/v/better-futures-studio/docs-panel.svg?style=flat-square)](https://packagist.org/packages/better-futures-studio/docs-panel)
[![GitHub Tests Action Status](https://img.shields.io/github/actions/workflow/status/better-futures-studio/docs-panel/run-tests.yml?branch=main&label=tests&style=flat-square)](https://github.com/better-futures-studio/docs-panel/actions?query=workflow%3Arun-tests+branch%3Amain)
[![GitHub Code Style Action Status](https://img.shields.io/github/actions/workflow/status/better-futures-studio/docs-panel/fix-php-code-styling.yml?branch=main&label=code%20style&style=flat-square)](https://github.com/BetterFuturesStudio/docs-panel/actions?query=branch%3Amain+workflow%3A%22Fix+PHP+Code+Styling%22)
[![Total Downloads](https://img.shields.io/packagist/dt/better-futures-studio/docs-panel.svg?style=flat-square)](https://packagist.org/packages/better-futures-studio/docs-panel)



Expand All @@ -14,29 +14,11 @@ Get Docs up and running for your app in seconds.
You can install the package via composer:

```bash
composer require abdelelrafa/docs-panel
composer require better-futures-studio/docs-panel
```

Optionally, you can publish the views using

```bash
php artisan vendor:publish --tag="docs-panel-views"
```

## Usage

Simply put .md files in your `resources/docs` directory and you're good to go.

You can control the title, slug, group and order of your docs by adding a front matter to the top of your .md files. They are optional and have sensible defaults.

```MD
---
title: Artisan Console
slug: artisan
group: Digging Deeper
order: 1
---
```
## Documentation and Demo
<a href="https://docs.larafa.st" target="_blank">View the documentation and demo.</a>

## Testing

Expand Down
18 changes: 9 additions & 9 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
{
"name": "abdelelrafa/docs-panel",
"name": "better-futures-studio/docs-panel",
"description": "A Filament Panel for your applications public documentation.",
"keywords": [
"abdelelrafa",
"better-futures-studio",
"laravel",
"docs-panel"
],
"homepage": "https://github.com/abdelelrafa/docs-panel",
"homepage": "https://github.com/better-futures-studio/docs-panel",
"support": {
"issues": "https://github.com/abdelelrafa/docs-panel/issues",
"source": "https://github.com/abdelelrafa/docs-panel"
"issues": "https://github.com/better-futures-studio/docs-panel/issues",
"source": "https://github.com/better-futures-studio/docs-panel"
},
"license": "MIT",
"authors": [
Expand Down Expand Up @@ -43,13 +43,13 @@
},
"autoload": {
"psr-4": {
"AbdelElrafa\\DocsPanel\\": "src/",
"AbdelElrafa\\DocsPanel\\Database\\Factories\\": "database/factories/"
"BetterFuturesStudio\\DocsPanel\\": "src/",
"BetterFuturesStudio\\DocsPanel\\Database\\Factories\\": "database/factories/"
}
},
"autoload-dev": {
"psr-4": {
"AbdelElrafa\\DocsPanel\\Tests\\": "tests/"
"BetterFuturesStudio\\DocsPanel\\Tests\\": "tests/"
}
},
"scripts": {
Expand All @@ -69,7 +69,7 @@
"extra": {
"laravel": {
"providers": [
"AbdelElrafa\\DocsPanel\\DocsPanelServiceProvider"
"BetterFuturesStudio\\DocsPanel\\DocsPanelServiceProvider"
]
}
},
Expand Down
2 changes: 1 addition & 1 deletion config/docs-panel.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// config for AbdelElrafa/DocsPanel
// config for BetterFuturesStudio/DocsPanel
return [

];
2 changes: 1 addition & 1 deletion phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
backupStaticProperties="false"
>
<testsuites>
<testsuite name="AbdelElrafa Test Suite">
<testsuite name="BetterFuturesStudio Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
Expand Down
2 changes: 1 addition & 1 deletion resources/lang/en/docs-panel.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

// translations for AbdelElrafa/DocsPanel
// translations for BetterFuturesStudio/DocsPanel
return [
//
];
4 changes: 4 additions & 0 deletions resources/views/docs-pages.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
scroll-padding-top: 5rem;
}
.fi-page {
padding-left: 16px;
}
.docs_main a h2:before,
.docs_main a h3:before,
.docs_main a h4:before {
Expand Down
16 changes: 6 additions & 10 deletions src/DocsPanelServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace AbdelElrafa\DocsPanel;
namespace BetterFuturesStudio\DocsPanel;

use AbdelElrafa\DocsPanel\Pages\DocsPages;
use BetterFuturesStudio\DocsPanel\Pages\DocsPages;
use Filament\Facades\Filament;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
Expand Down Expand Up @@ -63,7 +63,7 @@ public function packageBooted(): void

protected function getAssetPackageName(): ?string
{
return 'abdelelrafa/docs-panel';
return 'better-futures-studio/docs-panel';
}

public function panel(Panel $panel): Panel
Expand Down Expand Up @@ -110,12 +110,10 @@ public function panel(Panel $panel): Panel

$navigationItems[] = NavigationItem::make($file['title'])
->group($group)
->icon(DocsPages::getNavigationIcon())
->activeIcon(DocsPages::getActiveNavigationIcon())
->isActiveWhen(fn (): bool => request()->routeIs("filament.{$panel}.pages.{$file['slug']}"))
->sort(DocsPages::getNavigationSort())
->badge(DocsPages::getNavigationBadge(), color: DocsPages::getNavigationBadgeColor())
->url("/{$routePath}");
->url("{$routePath}");
}
if (empty($navigationItems)) {
return;
Expand All @@ -129,14 +127,12 @@ public function panel(Panel $panel): Panel
return $builder->groups($navigationGroups);
});

$panel->renderHook('panels::topbar.end', fn () => self::$enableThemeSelector && ($panel->hasDarkMode() && ! $panel->hasDarkModeForced()) ? Blade::render('<x-filament-panels::theme-switcher />') : '');

foreach (self::$modifyPanelUsing as $modifyPanelUsing) {
$panel = $modifyPanelUsing($panel);
}

if (self::$enableThemeSelector && ($panel->hasDarkMode() && ! $panel->hasDarkModeForced())) {
$panel->renderHook('panels::topbar.end', fn () => Blade::render('<x-filament-panels::theme-switcher />'));
}

return $panel;
}

Expand Down
18 changes: 5 additions & 13 deletions src/Pages/DocsPages.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace AbdelElrafa\DocsPanel\Pages;
namespace BetterFuturesStudio\DocsPanel\Pages;

use AbdelElrafa\DocsPanel\DocsPanelServiceProvider;
use BetterFuturesStudio\DocsPanel\DocsPanelServiceProvider;
use Filament\Pages\Page;
use Filament\Panel;
use Illuminate\Contracts\Support\Htmlable;
Expand All @@ -14,8 +14,6 @@

class DocsPages extends Page
{
protected static ?string $navigationIcon = 'heroicon-o-document-text';

protected static string $view = 'docs-panel::docs-pages';

protected static ?int $navigationSort = -2;
Expand Down Expand Up @@ -89,15 +87,9 @@ public static function getDocs(): array

$title = $object->matter('title');
if (empty($title)) {
if (str_contains($file->getRelativePathname(), '/')) {
if (str_contains($file->getRelativePathname(), 'index.md')) {
$title = Str::of(str_replace(['index.md', '.md'], '', $file->getRelativePathname()))
->replace('/', ' ')
->title();
} else {
$title = str_replace(['.md'], '', $file->getRelativePathname());
}
}
$title = Str::of(basename($file->getRelativePathname()))
->beforeLast('.md')
->headline();
}

$docs[] = [
Expand Down
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use AbdelElrafa\DocsPanel\Tests\TestCase;
use BetterFuturesStudio\DocsPanel\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
6 changes: 3 additions & 3 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

namespace AbdelElrafa\DocsPanel\Tests;
namespace BetterFuturesStudio\DocsPanel\Tests;

use AbdelElrafa\DocsPanel\DocsPanelServiceProvider;
use BetterFuturesStudio\DocsPanel\DocsPanelServiceProvider;
use BladeUI\Heroicons\BladeHeroiconsServiceProvider;
use BladeUI\Icons\BladeIconsServiceProvider;
use Filament\Actions\ActionsServiceProvider;
Expand All @@ -25,7 +25,7 @@ protected function setUp(): void
parent::setUp();

Factory::guessFactoryNamesUsing(
fn (string $modelName) => 'AbdelElrafa\\DocsPanel\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
fn (string $modelName) => 'BetterFuturesStudio\\DocsPanel\\Database\\Factories\\' . class_basename($modelName) . 'Factory'
);
}

Expand Down

0 comments on commit e1853e2

Please sign in to comment.