kekos/prest-doc 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

kekos/prest-doc

最新稳定版本:v0.4.1

Composer 安装命令:

composer require kekos/prest-doc

包简介

Static Site Generator for OpenAPI documentation

README 文档

README

Static Site Generator for OpenAPI documentation written in PHP.

Install

composer require kekos/prest-doc

Requires at least PHP 8.1.

Usage

./bin/prest-doc <in_directory> <out_directory> <layout_file> [<config_file>]
  • <in_directory> points to a directory which Prest-doc should read and convert.
  • <out_directory> points to a directory where converted files will be written. Please note that this directory will be deleted by Prest-doc on each run
  • <layout_file> is a file path to layout file. See the examples/ directory.
  • <config_file> is a file path to configuration. Optional.

Configuration

API templates

You can override the default OpenAPI Markdown templates by creating a configuration file and supply it with your own instances of template interfaces:

<?php
use Kekos\PrestDoc\Configuration;
use Kekos\PrestDoc\ApiTemplates\Contracts\SchemaTemplate;

return new Configuration(
    api_templates_class_map: [
        SchemaTemplate::class => new MyOwnImplementationOfSchemaTemplate(),
    ],
);

Topics menu

Prest-doc can be configured with how it should create the main API navigation, the "topics menu". Two implementations are included, but you can build your own by implementing the interface \Kekos\PrestDoc\ApiEntities\TopicsRepository. Use the Configuration class´ api_templates_class_map property to configure this.

TaggedTopicsRepository (default)

All path operations must have a tag prefixed with topic-. That tag will be used to group operations together under the name of tag, excluding topic-.

SingleTopicRepository

All paths are grouped to a single topic "Operations".

Features

  • Converts OpenAPI specifications (JSON) to HTML.
  • Allows for own HTML layout template, written in PHP.
  • Allows for own CSS and JavaScript.
  • Sort paths (topics) in an order logical for you and your app.

Bugs and improvements

Report bugs in GitHub issues or feel free to make a pull request :-)

License

MIT

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2024-03-30

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固