PHPackages                             aaronfrancis/docsync - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. aaronfrancis/docsync

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

aaronfrancis/docsync
====================

Sync documentation from GitHub repositories and serve them in your Laravel application

v0.1.0(4mo ago)3893↓50%MITPHPPHP ^8.2CI passing

Since Dec 30Pushed 4mo agoCompare

[ Source](https://github.com/aarondfrancis/docsync)[ Packagist](https://packagist.org/packages/aaronfrancis/docsync)[ RSS](/packages/aaronfrancis-docsync/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (11)Versions (2)Used By (0)

DocSync
=======

[](#docsync)

[![Latest Version on Packagist](https://camo.githubusercontent.com/7176597b2e384fea33d963634b1cd114c9ae9517a2b755370c03f0b121dd1fb8/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6161726f6e6672616e6369732f646f6373796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronfrancis/docsync)[![Tests](https://github.com/aaronfrancis/docsync/actions/workflows/tests.yaml/badge.svg)](https://github.com/aaronfrancis/docsync/actions/workflows/tests.yaml)[![Total Downloads](https://camo.githubusercontent.com/2064e376dcbe73bd12cc674615a91e353c36b75b6928b4f51fe920c60ecc8d17/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6161726f6e6672616e6369732f646f6373796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronfrancis/docsync)[![PHP Version](https://camo.githubusercontent.com/89eb80c65436cae21687314463fd300f8915fa8409c1dfc65d1e43f12f9ba771/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f6161726f6e6672616e6369732f646f6373796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronfrancis/docsync)[![License](https://camo.githubusercontent.com/5f034f57b89e82fca2895d6ded48d67e1d61730012aec799a688658e6aa767c9/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f6161726f6e6672616e6369732f646f6373796e632e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/aaronfrancis/docsync)

Sync documentation from GitHub repositories and serve them in your Laravel application.

Features
--------

[](#features)

- **Git sparse checkout** - Efficiently clones only the docs folder from repositories
- **Markdown parsing** - CommonMark + GFM with Torchlight syntax highlighting
- **Navigation generation** - Builds navigation trees from `_meta.json` files
- **Table of contents** - Automatically extracts headings for TOC
- **Pagination** - Previous/next page navigation
- **Caching** - Built-in caching for production performance
- **Filament integration** - Optional admin panel for managing documentation projects

Requirements
------------

[](#requirements)

- PHP 8.2+
- Laravel 11 or 12
- [Torchlight](https://torchlight.dev) account (for syntax highlighting)

Installation
------------

[](#installation)

```
composer require aaronfrancis/docsync
```

Publish the configuration and migration:

```
php artisan vendor:publish --tag=docsync-config
php artisan vendor:publish --tag=docsync-migrations
php artisan migrate
```

Configuration
-------------

[](#configuration)

```
// config/docsync.php

return [
    // Where synced docs are stored
    'storage_path' => storage_path('app/docs'),

    // Config key for GitHub token (for private repos)
    'github_token_key' => 'services.github.token',

    // Cache settings
    'cache' => [
        'enabled' => true,
        'ttl' => 3600, // 1 hour
    ],
];
```

Set your GitHub token in `config/services.php`:

```
'github' => [
    'token' => env('GITHUB_TOKEN'),
],
```

Usage
-----

[](#usage)

### Creating Documentation Projects

[](#creating-documentation-projects)

Projects are stored in the database. Create them however you prefer:

```
use AaronFrancis\DocSync\Models\DocumentationProject;

DocumentationProject::create([
    'slug' => 'my-package',
    'name' => 'My Package',
    'description' => 'Documentation for my package',
    'repository_url' => 'https://github.com/org/repo',
    'branch' => 'main',
    'docs_path' => 'docs',
    'sort_order' => 0,
    'is_active' => true,
]);
```

### Syncing Documentation

[](#syncing-documentation)

Sync all active projects:

```
php artisan docs:sync
```

Sync a specific project:

```
php artisan docs:sync --project=my-package
```

### Scheduling Syncs

[](#scheduling-syncs)

Add to your `routes/console.php`:

```
use Illuminate\Support\Facades\Schedule;

Schedule::command('docs:sync')
    ->hourly()
    ->withoutOverlapping()
    ->runInBackground();
```

### Using the Service

[](#using-the-service)

```
use AaronFrancis\DocSync\Facades\DocSync;
// or inject: AaronFrancis\DocSync\Services\DocumentationService

// Get all packages
$packages = DocSync::getPackages();

// Get a single package
$package = DocSync::getPackage('my-package');

// Get navigation tree
$navigation = DocSync::getNavigation('my-package');

// Get a page
$page = DocSync::getPage('my-package', 'getting-started');

// Get table of contents from HTML
$toc = DocSync::getTableOfContents($page['content']);

// Get pagination (previous/next)
$pagination = DocSync::getPagination('my-package', 'getting-started');

// Get next steps (upcoming pages with descriptions)
$nextSteps = DocSync::getNextSteps('my-package', 'getting-started', 3);

// Clear cache
DocSync::clearCache(); // all
DocSync::clearCache('my-package'); // specific package
```

### Documentation Structure

[](#documentation-structure)

Your repository should have a `docs` folder (or whatever you configure) with:

```
docs/
├── _meta.json      # Navigation structure
├── index.md        # Landing page
├── getting-started.md
└── advanced/
    └── configuration.md

```

The `_meta.json` defines navigation:

```
{
  "pages": [
    { "slug": "index", "title": "Introduction" },
    { "slug": "getting-started", "title": "Getting Started" },
    {
      "slug": "advanced",
      "title": "Advanced",
      "children": [
        { "slug": "configuration", "title": "Configuration" }
      ]
    }
  ]
}
```

Markdown files support frontmatter:

```
---
title: Getting Started
description: Learn how to get started with the package
---

# Getting Started

Your content here...
```

Filament Integration
--------------------

[](#filament-integration)

If you're using [Filament](https://filamentphp.com), register the resource in your panel provider:

```
use AaronFrancis\DocSync\Filament\Resources\DocumentationProjectResource;

public function panel(Panel $panel): Panel
{
    return $panel
        // ...
        ->resources([
            DocumentationProjectResource::class,
        ]);
}
```

This provides a full CRUD interface for managing documentation projects with sync actions.

Building Your Frontend
----------------------

[](#building-your-frontend)

This package handles syncing and parsing—you build the frontend. Here's a basic controller example:

```
use AaronFrancis\DocSync\Facades\DocSync;

class DocsController extends Controller
{
    public function index()
    {
        return view('docs.index', [
            'packages' => DocSync::getPackages(),
        ]);
    }

    public function show(string $package, ?string $slug = null)
    {
        $currentPackage = DocSync::getPackage($package);
        abort_unless($currentPackage, 404);

        $page = DocSync::getPage($package, $slug);
        abort_unless($page, 404);

        return view('docs.show', [
            'page' => $page,
            'navigation' => DocSync::getNavigation($package),
            'toc' => DocSync::getTableOfContents($page['content']),
            'pagination' => DocSync::getPagination($package, $slug),
            'packages' => DocSync::getPackages(),
            'currentPackage' => $currentPackage,
        ]);
    }
}
```

Testing
-------

[](#testing)

```
composer test
```

Code Style
----------

[](#code-style)

```
composer format
```

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE) for details.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance74

Regular maintenance activity

Popularity23

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity37

Early-stage or recently created project

 Bus Factor1

Top contributor holds 91.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

139d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/033238953a59b9223a1bde703b5e4254e63c7412195da1cb9de5af44bf53fc0a?d=identicon)[aarondfrancis](/maintainers/aarondfrancis)

---

Top Contributors

[![aarondfrancis](https://avatars.githubusercontent.com/u/881931?v=4)](https://github.com/aarondfrancis "aarondfrancis (11 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

laraveldocumentationmarkdowngithubsync

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/aaronfrancis-docsync/health.svg)

```
[![Health](https://phpackages.com/badges/aaronfrancis-docsync/health.svg)](https://phpackages.com/packages/aaronfrancis-docsync)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[graham-campbell/markdown

Markdown Is A CommonMark Wrapper For Laravel

1.3k7.1M64](/packages/graham-campbell-markdown)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[laravel-zero/framework

The Laravel Zero Framework.

3371.4M369](/packages/laravel-zero-framework)[aedart/athenaeum

Athenaeum is a mono repository; a collection of various PHP packages

245.2k](/packages/aedart-athenaeum)[dniccum/nova-documentation

A Laravel Nova tool that allows you to add markdown-based documentation to your administrator's dashboard.

37116.4k](/packages/dniccum-nova-documentation)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
