cable8mm / db-to-markdown
DB to markdown generator
Installs: 3
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: ^8.0.2
- cable8mm/array-flatten: ^1.0
- catfan/medoo: ^2.0
- league/html-to-markdown: ^5.0
- nesbot/carbon: ^2.72.0|^3.0
- symfony/console: ^6.0|^7.0
- vlucas/phpdotenv: ^5.0
Requires (Dev)
- fakerphp/faker: ^1.23
- laravel/pint: ^1.0
- phpunit/phpunit: ^9.0|^10.0|^11.0
README
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
Support & Tested
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
- Please fill in the database connection information in the
.env
file. You can verify it by using the composer test command. - You can create a mapping class in the
src/Mappers/
folder for input and a format class in thesrc/Formats
for output. - 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.