cable8mm/db-to-markdown

数据库到markdown生成器

安装: 1

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 1

分支: 0

开放问题: 0

类型:项目

v1.3.3 2024-03-09 15:44 UTC

This package is auto-updated.

Last update: 2024-09-09 16:48:56 UTC


README

code-style run-tests Packagist Version Packagist Downloads Packagist Dependency Version Packagist Dependency Version Packagist Stars Packagist License

此工具专门用于生成Markdown文件,尤其适用于从数据库创建Jekyll Markdown文档。您可以生成自己的Markdown,例如Jekyll、Astro、Gatsby或您喜欢的任何其他格式。

我们在网站上提供了API文档。更多信息,请访问 https://www.palgle.com/db-to-markdown/ ❤️

特性

  • 任何模式都可以生成所需格式的Markdown
  • 轻松集成自定义映射器和命令
  • 实现回调体和日期时间功能
  • 支持数据库测试

预览

Preview

支持 & 测试

安装

composer create-project cable8mm/db-to-markdown

使用方法

配置 .env 以连接到您自己的数据库。如果未提供 .env 配置,则建立SQLite连接。

bin/console seeding
# If `.env` configuration is not provided, seeding must be performed.

已建立数据库连接,

bin/console create-md
# Convert the database to markdown files in the dist folder.

bin/console create-jekyll
# Convert the database to markdown files suitable for Jekyll in the dist folder.

bin/console clean
# Clear the contents of the dist folder.

如何开发自定义命令

  1. 请在 .env 文件中填写数据库连接信息。您可以通过使用composer测试命令来验证它。
  2. 您可以在 src/Mappers/ 文件夹中创建映射类,用于输入,并在 src/Formats 中创建格式类,用于输出。
  3. 最后,您可以在 src/Command 文件夹中创建您选择的命令。

我已经准备了映射器、格式类和命令。

格式化

composer lint
# Modify all files to comply with the PSR-12.

composer inspect
# Inspect all files to ensure compliance with PSR-12.

测试

它使用内置的SQLite数据库,而不是您自己的数据库。它永远不会损害您的数据。您不必担心这一点。

composer test

许可证

DB to markdown项目是开源软件,许可协议为MIT许可证