Reusable Components

Reusable components allow you to write content once and include it in multiple places, ensuring consistency and reducing maintenance.

Why Use Reusable Components?

Benefits

  • Single Source of Truth: Update once, changes appear everywhere
  • Consistency: Same content displayed identically across all pages
  • Efficiency: Write once, reuse many times
  • Easy Maintenance: Fix errors in one place
  • Version Management: Update product versions globally

Use Cases

  • Product version numbers
  • System requirements
  • Installation instructions
  • Contact information
  • Legal disclaimers
  • Common warnings
  • Pricing information
  • Support details

Creating Reusable Components

Location

Store all reusable components in:

resources/docs/includes/

Basic Component

File: resources/docs/includes/system-requirements.md

## System Requirements

- PHP 8.2 or higher
- MySQL 8.0+ or PostgreSQL 13+
- Composer 2.x
- Node.js 18+ and NPM
- 2GB RAM minimum
- 10GB disk space

Using the Component

In any documentation page:

# Installation Guide

Before installing, check the requirements:

## System Requirements

- PHP 8.2 or higher
- MySQL 8.0+ or PostgreSQL 13+
- Composer 2.x
- Node.js 18+ and NPM
- 2GB RAM minimum
- 10GB disk space


Now you're ready to proceed...

Advanced Examples

Product Information

File: resources/docs/includes/product-info.md

**Current Version**: 3.2.1  
**Release Date**: February 10, 2026  
**License**: MIT  
**Support**: Available for all paid plans

Usage:

# Welcome

[Include not found: product-info]

Get started below...

Installation Steps

File: resources/docs/includes/installation-steps.md

## Installation Steps

1. **Clone the repository**
   ```bash
   git clone https://github.com/yourcompany/yourapp.git
   cd yourapp
  1. Install dependencies

    composer install
    npm install
    
  2. Configure environment

    cp .env.example .env
    php artisan key:generate
    
  3. Run migrations

    php artisan migrate
    
  4. Start the server

    php artisan serve
    

**Usage:**
```markdown
# Quick Start

[Include not found: installation-steps]

Next: [Configuration](configuration)

API Authentication

File: resources/docs/includes/api-auth-header.md

All API requests must include an authentication header:

```bash
Authorization: Bearer YOUR_API_TOKEN

You can generate tokens in your account settings.


**Usage in multiple API docs:**
```markdown
# Users Endpoint

[Include not found: api-auth-header]

## List Users

`GET /api/users`

...

Support Contact

File: resources/docs/includes/support.md

---

**Need Help?**

- 📧 Email: [email protected]
- 💬 Chat: Available 9 AM - 5 PM EST
- 📚 Knowledge Base: [help.example.com](https://help.example.com)
- 🎫 Submit a Ticket: [support.example.com](https://support.example.com)

Usage:

# Troubleshooting

Try these solutions...

[Include not found: support]

Warning Notices

File: resources/docs/includes/beta-warning.md

<div class="warning">This feature is currently in beta. API endpoints and behavior may change in future releases. Do not use in production without thorough testing.</div>

Usage:

# New Feature: Advanced Analytics

[Include not found: beta-warning]

This feature allows...

Component Best Practices

1. Keep Components Focused

Good:

<!-- includes/database-requirements.md -->
## Database Requirements

- MySQL 8.0+
- PostgreSQL 13+
- SQLite 3.35+

Avoid:

<!-- includes/all-requirements.md -->
## All Requirements

### Server Requirements
...

### Database Requirements
...

### PHP Requirements
...

2. Use Descriptive Names

Good:

  • system-requirements.md
  • api-authentication.md
  • contact-support.md
  • installation-steps.md

Avoid:

  • reqs.md
  • auth.md
  • info.md
  • steps.md

3. Include Complete Context

Components should be self-contained:

<!-- includes/upgrade-notice.md -->
## Before Upgrading

<div class="warning">Always backup your database before upgrading.</div>

### Upgrade Steps

1. Put site in maintenance mode
2. Backup database
3. Run upgrade command
4. Test thoroughly
5. Exit maintenance mode

### Rollback

If issues occur, restore from backup and contact support.

4. Version-Specific Components

For version-specific content:

resources/docs/includes/
├── v3/
│   ├── installation.md
│   └── requirements.md
└── v2/
    ├── installation.md
    └── requirements.md

Usage:

[Include not found: v3/installation]

Combining with Shortcodes

Mix includes with shortcodes for enhanced content:

File: resources/docs/includes/quick-start.md

## Quick Start

<div class="tip">This guide assumes you have PHP and Composer installed.</div>

### Installation

1. Download the package
2. Install dependencies
3. Configure `.env`
4. Run migrations

<div class="note">Need detailed instructions? See our [Installation Guide](installation).</div>

Nested Includes

Multiple Includes on One Page

You can use multiple includes:

# Complete Setup Guide

## Requirements

## System Requirements

- PHP 8.2 or higher
- MySQL 8.0+ or PostgreSQL 13+
- Composer 2.x
- Node.js 18+ and NPM
- 2GB RAM minimum
- 10GB disk space


## Installation

[Include not found: installation-steps]

## Configuration

[Include not found: configuration-guide]

## Support

[Include not found: support]

Real-World Examples

SaaS Pricing

File: resources/docs/includes/pricing-tiers.md

| Plan | Price | Features |
|------|-------|----------|
| Free | $0/mo | Up to 5 users, Basic features |
| Pro | $29/mo | Up to 25 users, Advanced features |
| Enterprise | Custom | Unlimited users, All features |

[View detailed pricing →](https://example.com/pricing)

File: resources/docs/includes/disclaimer.md

---

*This documentation is provided "as is" without warranty of any kind. Your use of this software is at your own risk.*

Version Compatibility

File: resources/docs/includes/version-compatibility.md

## Version Compatibility

| Feature | v2.x | v3.x |
|---------|------|------|
| Basic Auth | ✅ | ✅ |
| OAuth 2.0 | ❌ | ✅ |
| Webhooks | ✅ | ✅ |
| Rate Limiting | ❌ | ✅ |

Organizing Includes

For large documentation sites:

resources/docs/includes/
├── common/
│   ├── requirements.md
│   ├── support.md
│   └── disclaimer.md
├── api/
│   ├── authentication.md
│   ├── rate-limits.md
│   └── error-codes.md
├── installation/
│   ├── linux.md
│   ├── macos.md
│   └── windows.md
└── legal/
    ├── terms.md
    ├── privacy.md
    └── disclaimer.md

Usage:

[Include not found: api/authentication]
[Include not found: installation/linux]

Tips for Success

  1. Plan Ahead: Identify repetitive content early
  2. Stay Organized: Use subdirectories for categories
  3. Document Usage: Add comments in complex includes
  4. Test Thoroughly: Check includes render correctly
  5. Update Carefully: Remember changes affect all pages
  6. Version Control: Track changes to includes in Git

Next Steps

×