Welcome to lara-docs-kit, a powerful Laravel documentation package. This package aims to simplify the process of creating and managing documentation for your Laravel projects.
To get started with lara-docs-kit, follow these simple steps:
- Install the package via Composer:
composer require rex-devs/lara-docs-kit
- Publish the tailwind css file.
php artisan vendor:publish --tag=lara-docs-kit-assets
- To enable the syntax highlighting the javascript package shiki is needed to be installed in the project. It can be install via npm:
npm install shiki
- A directory to store all the markdown files for the documentation will need to be created, using the default config the following command can be used to create the directory.
mkdir ./resources/docs
- A
nav.json
file will then be needed within that directory outlining the navigation menu.
{
"introduction": "/",
}
- That's it! You're now ready to start using lara-docs-kit for your Laravel documentation needs.
The package is configured to run straight out the box, it adds a /docs
route
that takes markdown files directly out of the /resources/docs
directory and
deliveries them to the public. However, there is a config file that can be
published and changed as needed.
To publish the configuration file using the following command:
php artisan vendor:publish --tag=lara-docs-kit-config
The configuration file located at config/lara-docs-kit.php
can then be
customised according to your project's requirements. Here is an example of a
route.
'routes' => [
[
'name' => 'docs',
'url' => '/docs',
'dir' => 'docs/',
'middleware' => [
'web',
],
],
],
The package also uses a nav.json
file in the top level of the directory that
holds all the markdown files. This file allows for both top level links but also
nested links (maximum of 1 level deep).
{
"introduction": "/",
"parent": {
"introduction": "/parent/",
"child": "/parent/child"
}
}
If you find any issues or have suggestions to improve lara-docs-kit, we welcome contributions from the community. Please feel free to submit a pull request or open an issue.
lara-docs-kit is open-source software licensed under the MIT license.
We hope lara-docs-kit proves to be a valuable tool for your Laravel projects. Should you have any questions or need assistance, don't hesitate to reach out to us on [email protected].
Happy documenting! 😊