Inkstone Docs
Search... ⌘K
Getting Started

Laravel Usage#

When Inkstone is installed in a Laravel application, its commands are registered by Inkstone\Providers\InkstoneServiceProvider and run through Artisan.

Install Starter Files#

php artisan docs:install

The install command can publish:

  • config/inkstone.php
  • starter Markdown files
  • default Blade theme views
  • frontend source assets
  • deployment examples
  • build/.gitignore

Existing files are not overwritten unless you pass --force:

php artisan docs:install --force

Configure The Package#

Publish the config file:

php artisan vendor:publish --tag=inkstone-config

Edit:

config/inkstone.php

The most common keys are:

  • source_path
  • output_path
  • site
  • theme
  • github
  • search
  • demos
  • extensions

Build Static Documentation#

php artisan docs:build

The build command discovers documents, parses Markdown, transforms HTML, renders the theme, copies assets, writes static pages, and generates search and metadata files.

Serve Generated Docs In Laravel#

To serve the generated output from the Laravel application, add Inkstone's routes to routes/web.php:

use Inkstone\Facades\DocsGenerator as Inkstone;

Inkstone::routes();

By default, this serves the generated files from /docs. When serving through Laravel, Inkstone adjusts generated root-relative URLs to the configured route path without changing the static files written by docs:build.

You can change the mounted domain, path, and additional middleware in config/inkstone.php under the routes key.

Include The Documentation Sitemap#

The bundled SitemapExtension writes sitemap.xml during docs:build. Resolve the same extension from Laravel's container to obtain the URL served by the documentation route:

use Inkstone\Extensions\SitemapExtension;

$documentationSitemapUrl = app(SitemapExtension::class)->url();

Add the returned URL to the parent application's sitemap index. For example, an application serving Inkstone at /docs can include:

<?xml version="1.0" encoding="UTF-8"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    <sitemap>
        <loc>https://example.test/docs/sitemap.xml</loc>
    </sitemap>
</sitemapindex>

<sitemap> is a child of <sitemapindex>; it does not belong inside a page-level <urlset>. Sitemap indexes normally reference sitemap files on the same site. If the documentation uses a separate configured domain, publish or submit its sitemap according to that host's ownership rules.

The URL resolver honours an absolute site.base_url, resolves a relative base against Laravel's application URL, and otherwise uses Inkstone's named route with its configured path and fixed domain. Register Inkstone::routes() before generating or serving URLs that rely on the route. See Sitemaps for the full resolution order.

Serve Locally#

php artisan docs:serve --host=127.0.0.1 --port=8080

The serve command runs PHP's built-in static server against the generated output directory. Use it for local preview, not production hosting.

Clean Generated Output#

php artisan docs:clean

The clean command removes the configured generated output directory and recreates it.

Override Paths Per Command#

Artisan commands also accept path options:

php artisan docs:build --source=resources/docs --output=build/product-docs --base-url=/product-docs

These options override the current config for that command run.

Laravel Boost#

Inkstone ships optional Laravel Boost package resources:

resources/boost/guidelines/core.blade.php
resources/boost/skills/inkstone-documentation/SKILL.md

If the Laravel application uses Boost, refresh Boost after installing or updating Inkstone:

php artisan boost:install
php artisan boost:update

Boost can then include Inkstone-aware guidance for documentation structure, commands, navigation ordering, static demo blocks, and standalone package usage.

Boost is optional. Inkstone commands work normally without it.