Structure
By default, your markdown files live in docs/<panel-id> in the root of your project (configurable in the plugin setup). Inside that directory, there is one folder per locale, and inside the locale folder your actual documentation:
docs/<panel-id>/en/getting-started.mdusers/introduction.mdroles.mdroles/user.mdadmin.md
de/getting-started.md- ...
The knowledge base mirrors this tree in the panel navigation.
docs/<panel-id> are ignored.Nesting rules
The structure follows a few strict rules, because filament's navigation does not support arbitrarily deep nesting:
- You can nest at most 3 levels deep (as in the example above).
- In the top level (the locale directory), you can freely mix markdown files and directories.
- From the second level down, every directory needs a sibling markdown file of the same name (
roles/needs aroles.mdnext to it). That file acts as the parent item of everything inside the directory.
We try to throw meaningful exceptions whenever the structure is wrong, so if the panel crashes after adding a file, the message should point you to the problem.
Groups and parents
The relationship between items is resolved from the directory structure:
- A directory with a sibling
<name>.mdof typegroupbecomes a group in the navigation, with the files inside as its items. - A directory with a sibling
<name>.mdthat is a regular documentation file becomes a parent item with the files inside as children.
A group config file only consists of front matter:
---
type: group
title: Advanced
icon: heroicon-o-academic-cap
---
Generating files
You don't have to create the files by hand. The docs:make command walks you through it:
php artisan docs:make
You can also pass everything up front, including one or more locales:
php artisan docs:make knowledge-base documentation prologue.getting-started --locale=en --locale=de
If you don't pass any locale, the file is created for every locale folder that already exists in your docs directory.
Caching
The parsed markdown is cached, so you don't pay the rendering cost on every request. During development, clear it whenever you don't see your changes:
php artisan cache:clear
More on this in cache.