Search by

yanikkumar / laravel-static-docs

yanikkumar

Database-free static HTML documentation generator & manager for Laravel

Package info

github.com/yanikkumar/laravel-static-docs

Language:Blade

pkg:composer/yanikkumar/laravel-static-docs

Statistics

Installs: 3

Dependents: 0

Suggesters: 0

Stars: 1

Open Issues: 0

v1.0.1 2026-12-02 11:51 UTC

This package is auto-updated.

Last update: 2026-12-02 12:12:31 UTC


README

A lightweight, database-free static HTML documentation generator and CMS manager for Laravel.
Write documentation in Markdown from an admin UI, organize pages into sidebar sections with automatic #anchor sub-topics, customize the theme & project logo, and compile everything into fast static HTML files.

Features

  • Zero Database: Stores Markdown sources (markdown/*.md), sidebar manifest (manifest.json), theme settings (theme.json), and compiled static HTML (html/*.html) on disk.
  • Automatic #anchor Sub-Topics: ## and ### Markdown headings automatically receive id="..." anchors and appear as nested #sub-topic links under the active page in the sidebar.
  • Public or Guarded Access: Works with or without authentication middleware (viewer_middleware can be ['web'] for public docs or ['web', 'auth'] for private/internal docs).
  • Theme & Logo Customizer: Choose built-in presets, upload or link a project logo, customize primary/secondary/sidebar colors, and inject custom CSS.
  • Contextual Help Button: Drop <x-static-docs-help-button slug="your-page" /> anywhere in Blade views to link users directly to the relevant documentation page.

Installation

Install directly via Composer (Packagist):

composer require yanikkumar/laravel-static-docs

Optional: Publish Config / Views & Seed Sample Docs

php artisan vendor:publish --tag=static-docs-config
php artisan vendor:publish --tag=static-docs-views
php artisan static-docs:seed

Configuration (config/static-docs.php)

  • Public Docs (No Auth Guard):
    'viewer_middleware' => ['web'],
    'admin_middleware'  => ['web', 'auth'],
  • Private Docs (Behind Auth / Role Guard):
    'viewer_middleware' => ['web', 'auth'],
    'admin_middleware'  => ['web', 'auth', 'role:1'],
  • Integrate with Your Admin Layout (or leave null to use the package's built-in layout):
    'admin_layout'  => 'layouts.app',
    'admin_section' => 'content',

Usage

  • Docs Viewer: Visit /docs (or your configured route_prefix).
  • Docs Manager: Visit /docs-manager (or your configured admin_route_prefix).
  • Seed Sample Docs:
    php artisan static-docs:seed
    # or reset & seed fresh:
    php artisan static-docs:seed --fresh
  • Contextual Help Component:
    <x-static-docs-help-button slug="advertisements" label="Know how this works" />

License

MIT