PHP code example of lynkbyte / docs-builder

1. Go to this page and download the library: Download lynkbyte/docs-builder library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lynkbyte / docs-builder example snippets


// config/docs-builder.php

'site_name' => 'My Documentation',

'site_description' => 'Documentation for my project',

// Directory containing your Markdown source files
'source_dir' => base_path('docs'),

// Where the built HTML is written
'output_dir' => public_path('docs'),

// OpenAPI YAML spec for API reference generation
'openapi_file' => base_path('docs/openapi.yaml'),

// URL path prefix for all generated links
'base_url' => '/docs',

// null = default diamond SVG
'logo' => null,

// Inline SVG
'logo' => '<svg viewBox="0 0 24 24" ...>...</svg>',

// HTML with an image
'logo' => '<img src="/images/logo.svg" alt="Logo" class="h-8">',

// null = defaults (Guides, API Reference, Examples)
'header_nav' => null,

// Custom links
'header_nav' => [
    ['title' => 'Guides', 'url' => '/docs'],
    ['title' => 'API', 'url' => '/docs/api-reference'],
    ['title' => 'Blog', 'url' => '/blog'],
],

// Default: Inter + JetBrains Mono + Material Symbols
'fonts' => [
    'https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&family=JetBrains+Mono:wght@400;500;600&display=swap',
    'https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:wght,[email protected],0..1&display=swap',
],

// Disable external fonts entirely
'fonts' => false,

// Default: cool blue DevDocs-inspired theme
'theme_name' => 'default',

// Modern: warm amber/gold theme inspired by Mintlify and Laravel docs
'theme_name' => 'modern',

'theme' => [
    'color-primary'       => '#8b5cf6',
    'color-primary-light' => '#a78bfa',
    'color-primary-dark'  => '#7c3aed',
    'color-dark-bg'       => '#0a0a0a',
    'color-light-bg'      => '#fafafa',
],

'navigation' => [
    [
        'title' => 'Getting Started',
        'pages' => [
            ['title' => 'Home', 'file' => 'README.md', 'icon' => 'home'],
            ['title' => 'Installation', 'file' => 'installation.md', 'icon' => 'download'],
        ],
    ],
    [
        'title' => 'API',
        'pages' => [
            ['title' => 'API Reference', 'file' => 'api-reference.md', 'icon' => 'api', 'layout' => 'api-reference'],
        ],
    ],
],

// Auto-generated from openapi.yaml tags if left empty
'api_navigation' => [],

// Map OpenAPI tags to Material Symbols icon names
'api_tag_icons' => [
    'Authentication' => 'lock',
    'Users'          => 'group',
    'Bookings'       => 'calendar_month',
    // Unlisted tags fall back to 'api'
],

'footer' => [
    'copyright' => '© ' . date('Y') . ' My Company. All rights reserved.',
    'links' => [
        ['title' => 'Privacy Policy', 'url' => '/privacy'],
        ['title' => 'GitHub', 'url' => 'https://github.com/my-org'],
    ],
],

// Show a "Contact Support" link in the table of contents sidebar
'support_url' => 'mailto:[email protected]',

// Set to null to hide the support card entirely (default)
'support_url' => null,
 `` |
| Heading anchors | Auto-generated from heading text |

### YAML Front Matter

Optionally add front matter to your Markdown files:


    $user = User::find(1);
    

'api_tag_icons' => [
    'Authentication' => 'lock',
    'Users'          => 'group',
    'Payments'       => 'payments',
],

'asset_mode' => 'precompiled',

'asset_mode' => 'vite',
bash
php artisan docs:init
bash
php artisan docs:build
bash
php artisan vendor:publish --tag=docs-builder-config