veiliglanceren / laravel-remote-documentation
Easily fetch, parse, and display remote Markdown documentation from GitHub (or other sources) directly into customizable Blade views in your Laravel application.
Requires
- php: ^8.1
- laravel/framework: ^10.0|^11.0|^12.0
- league/commonmark: ^2.6
Requires (Dev)
- guzzlehttp/guzzle: ^7.0
- mockery/mockery: ^1.6
- orchestra/testbench: ^8.0 || ^9.0 || ^10.0
- pestphp/pest: ^2.0 || ^3.0
- pestphp/pest-plugin-laravel: ^2.0 || ^3.0
This package is not auto-updated.
Last update: 2025-04-27 19:57:38 UTC
README
This package is maintained by VeiligLanceren.nl, your partner in website development and everything else to power up your online company.
Laravel Remote Documentation
Easily fetch, parse, and display remote Markdown documentation from GitHub (or other sources) directly into customizable Blade views inside your Laravel application.
โจ Features
- Fetch remote
.md
files from public GitHub repositories - Convert Markdown to clean HTML
- Generate Blade templates automatically
- Fully customizable Blade layouts
- Service-oriented, extensible, and tested
๐ฆ Installation
Install the package via Composer:
composer require veiliglanceren/laravel-remote-documentation
Laravel will automatically discover the package.
If needed, manually register the ServiceProvider:
Veiliglanceren\LaravelRemoteDocumentation\RemoteDocumentationServiceProvider::class
And the Facade:
'RemoteDocumentation' => Veiliglanceren\LaravelRemoteDocumentation\Facades\RemoteDocumentation::class,
โก Quick Usage
Fetch documentation and generate Blade file via command:
php artisan remote-docs:fetch vendor/repository README.md
This will:
- Fetch the
README.md
from GitHubvendor/repository
- Convert it to HTML
- Save it as a Blade file under
resources/views/vendor/remote-documentation/vendor_repository.blade.php
Customize your layout
Override the default layout by publishing the views:
php artisan vendor:publish --tag=remote-documentation-views
You can then edit resources/views/vendor/remote-documentation/layout.blade.php
.
๐ Available functions
The following functions are available through the RemoteDocumentation
facade.
Service | Purpose |
---|---|
RemoteDocumentation::get($repo, $file) |
Fetch and parse remote Markdown |
RemoteDocumentation::parse($markdown) |
Generate a Blade view file |
All services are fully extensible and injectable for advanced use cases.
โ Testing
Run the tests using PestPHP:
./vendor/bin/pest
๐งช Pest Compatibility
This package supports:
- Pest v2 (for Laravel 10)
- Pest v3 (for Laravel 11 and 12)
Ensure that your Pest version aligns with your Laravel version to maintain compatibility.
๐ Future Roadmap
- Add feature tests for full command flow
- Support private repositories with token authentication
๐ License
The MIT License (MIT).
Please see License File for more information.