cable8mm/db-to-markdown

DB to markdown generator

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

This package is auto-updated.

Last update: 2024-04-09 16:04:28 UTC


README

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

This tool is specialized in generating Markdown files, particularly designed for creating Jekyll Markdown documents from a database. You can generate your own Markdown, such as Jekyll, Astro, Gatsby, or any other format you prefer.

We have provided the API Documentation on the web. For more information, please visit https://www.palgle.com/db-to-markdown/ ❤️

Features

  • Any schema can generate Markdown in any desired format
  • Effortlessly incorporate your custom mapper and command
  • Implement callback body and datetime functionality
  • Database testing is supported

Preview

Preview

Support & Tested

Versions PHP 8.0.2 PHP 8.1.* PHP 8.2.* PHP 8.3.*
Available

Installation

composer create-project cable8mm/db-to-markdown

Usage

Configure .env to connect to your own database. If .env configuration is not provided, SQLite connection is established.

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

Database connection is established,

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.

How to Develop Custom Commands

  1. Please fill in the database connection information in the .env file. You can verify it by using the composer test command.
  2. You can create a mapping class in the src/Mappers/ folder for input and a format class in the src/Formats for output.
  3. Finally, you can create a command of your choice in the src/Command folder.

I have already prepared the mapper, format class, and command.

Formatting

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

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

Test

It uses the built-in SQLite database, not your own database. It will never cause harm to your data. You don't need to worry about that.

composer test

License

The DB to markdown project is open-sourced software licensed under the MIT license.