定制 marko/docs 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

marko/docs

Composer 安装命令:

composer require marko/docs

包简介

Documentation search contract for Marko Framework

README 文档

README

Documentation search contract for Marko — defines the interface for querying Marko documentation, with interchangeable driver implementations.

Overview

marko/docs is the contract package that defines how Marko documentation is searched. It ships no search implementation — install a driver instead: marko/docs-fts for lightweight lexical search (SQLite FTS5). A driver implements DocsSearchInterface, so apps depend on the contract and stay decoupled from the backend.

Installation

Install a driver (which pulls in this package automatically):

composer require marko/docs-fts

Or install the contract alone if you are building a custom driver:

composer require marko/docs

Usage

use Marko\Docs\Contract\DocsSearchInterface;
use Marko\Docs\ValueObject\DocsQuery;

class DocsController
{
    public function __construct(
        private DocsSearchInterface $docs,
    ) {}

    public function search(string $term): array
    {
        return $this->docs->search(new DocsQuery($term, limit: 10));
    }
}

Customization

Implement DocsSearchInterface and register your implementation as a Preference:

#[Preference(DocsSearchInterface::class)]
class MyDocsSearch implements DocsSearchInterface
{
    public function search(DocsQuery $query): array { /* ... */ }
    public function getPage(string $id): DocsPage { /* ... */ }
    public function listNav(): array { /* ... */ }
    public function driverName(): string { return 'custom'; }
}

Documentation

Full driver comparison and API reference: marko/docs

统计信息

  • 总下载量: 8
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 4
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-03

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固