A PHP library to abstract a SKILL.md file.
composer require stolt/skill-md
SKILL.md representation from an array $skillMdData = [
'name' => 'Code Review',
'description' => 'Performs automated code reviews.',
'body' => '# Some longer, skill describing Markdown content.',
'version' => '1.0.0',
'tags' => ['php', 'qa'],
];
$skillMd = SkillMd::fromArray($skillMdData);
SKILL.md representation via class properties$skillMd = new SkillMd(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content.',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);
$skillMdViaFactory = SkillMd::create(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content.',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);
SKILL.md data$skillName = $skillMd->name();
$skillDescription = $skillMd->description();
$skillBody = $skillMd->body();
$skillVersion = $skillMd->version();
$skillTags = $skillMd->tags();
$skillLicense = $skillMd->get('license');
if ($skill->has('unsupported-field') === false) {
echo 'This field is not supported.';
}
if ($skill->get('unsupported-field') === null) {
echo 'This field is not supported and has no value.';
}
SKILL.md representation into MarkdownThe programmatical representation:
$skillMd = new SkillMd(
'Code Review',
'Performs automated code reviews.',
'# Some longer, skill describing Markdown content',
['version' => '1.0.0', 'license' => 'MIT', 'tags' => ['php', 'qa']]
);
$markdown = $skillMd->toMarkdown();
The Markdown representation:
---
name: code-review
description: Performs automated code reviews.
version: 1.0.0
license: MIT
tags:
- php
- qa
---
# Some longer, skill describing Markdown content
composer test
This library is licensed under the MIT license. Please see LICENSE.md for more details.
Please see CHANGELOG.md for more details.
Please see CONTRIBUTING.md for more details.
How can I help you explore Laravel packages today?