Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "xsavo/markdown-blog",
"name": "apxcde/markdown-blog",
"description": "Markdown-powered blog package for Laravel apps",
"type": "library",
"license": "proprietary",
Expand All @@ -15,21 +15,21 @@
},
"autoload": {
"psr-4": {
"xsavo\\MarkdownBlog\\": "src/"
"apxcde\\MarkdownBlog\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"xsavo\\MarkdownBlog\\Tests\\": "tests/"
"apxcde\\MarkdownBlog\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"xsavo\\MarkdownBlog\\MarkdownBlogServiceProvider"
"apxcde\\MarkdownBlog\\MarkdownBlogServiceProvider"
],
"aliases": {
"MarkdownBlog": "xsavo\\MarkdownBlog\\Facades\\MarkdownBlog"
"MarkdownBlog": "apxcde\\MarkdownBlog\\Facades\\MarkdownBlog"
}
}
},
Expand Down
4 changes: 2 additions & 2 deletions src/ArticleRepository.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace xsavo\MarkdownBlog;
namespace apxcde\MarkdownBlog;

use Carbon\Carbon;
use Illuminate\Contracts\Filesystem\FileNotFoundException;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Str;
use xsavo\MarkdownBlog\Support\FrontmatterParser;
use apxcde\MarkdownBlog\Support\FrontmatterParser;

class ArticleRepository
{
Expand Down
8 changes: 4 additions & 4 deletions src/Facades/MarkdownBlog.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
<?php

namespace xsavo\MarkdownBlog\Facades;
namespace apxcde\MarkdownBlog\Facades;

use Illuminate\Support\Facades\Facade;

/**
* @see \xsavo\MarkdownBlog\MarkdownBlog
* @see \apxcde\MarkdownBlog\MarkdownBlog
*
* @method static \Illuminate\Support\Collection all()
* @method static array|null findBySlug(string $slug)
* @method static \xsavo\MarkdownBlog\ArticleRepository repository()
* @method static \apxcde\MarkdownBlog\ArticleRepository repository()
*/
class MarkdownBlog extends Facade
{
protected static function getFacadeAccessor(): string
{
return \xsavo\MarkdownBlog\MarkdownBlog::class;
return \apxcde\MarkdownBlog\MarkdownBlog::class;
}
}
2 changes: 1 addition & 1 deletion src/MarkdownBlog.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace xsavo\MarkdownBlog;
namespace apxcde\MarkdownBlog;

use Illuminate\Support\Collection;

Expand Down
4 changes: 2 additions & 2 deletions src/MarkdownBlogServiceProvider.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace xsavo\MarkdownBlog;
namespace apxcde\MarkdownBlog;

use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
use xsavo\MarkdownBlog\Support\FrontmatterParser;
use apxcde\MarkdownBlog\Support\FrontmatterParser;

class MarkdownBlogServiceProvider extends PackageServiceProvider
{
Expand Down
27 changes: 25 additions & 2 deletions src/Support/FrontmatterParser.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,30 @@
<?php

namespace xsavo\MarkdownBlog\Support;

namespace apxcde\MarkdownBlog\Support;

/**
* Minimal frontmatter parser supporting a small, deliberate subset of YAML.
*
* This is intentionally NOT a full YAML parser. Supported syntax inside the
* leading `---` ... `---` block is limited to scalar `key: value` pairs, one
* per line:
*
* - values may be unquoted, single-quoted, or double-quoted (surrounding
* quotes are stripped; no escape-sequence processing is performed)
* - every value is returned as a string ('true', '42', etc. are not cast)
* - blank lines and lines starting with '#' are skipped
*
* Everything else is silently ignored, including:
*
* - lists / sequences (`- item` lines, or inline `[a, b]` kept as a literal string)
* - nested maps and indentation-based structure
* - multiline scalars (block `|` / folded `>` styles)
* - anchors, aliases, tags, and multi-document markers
* - lines without a colon
*
* If richer metadata is needed, keep frontmatter flat and scalar, or parse
* the value (e.g. a comma-separated list) in the consumer.
*/
class FrontmatterParser
{
private const UTF8_BOM = "\xEF\xBB\xBF";
Expand Down
4 changes: 2 additions & 2 deletions tests/ArticleRepositoryTest.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use xsavo\MarkdownBlog\ArticleRepository;
use xsavo\MarkdownBlog\MarkdownBlog;
use apxcde\MarkdownBlog\ArticleRepository;
use apxcde\MarkdownBlog\MarkdownBlog;

beforeEach(function () {
config()->set('markdown-blog.articles_path', __DIR__.'/Fixtures/articles');
Expand Down
2 changes: 1 addition & 1 deletion tests/FrontmatterParserTest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

use xsavo\MarkdownBlog\Support\FrontmatterParser;
use apxcde\MarkdownBlog\Support\FrontmatterParser;

it('parses frontmatter from utf8 bom-prefixed markdown', function () {
$raw = "\xEF\xBB\xBF---\n"
Expand Down
2 changes: 1 addition & 1 deletion tests/Pest.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

use xsavo\MarkdownBlog\Tests\TestCase;
use apxcde\MarkdownBlog\Tests\TestCase;

uses(TestCase::class)->in(__DIR__);
4 changes: 2 additions & 2 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace xsavo\MarkdownBlog\Tests;
namespace apxcde\MarkdownBlog\Tests;

use Orchestra\Testbench\TestCase as Orchestra;
use xsavo\MarkdownBlog\MarkdownBlogServiceProvider;
use apxcde\MarkdownBlog\MarkdownBlogServiceProvider;

class TestCase extends Orchestra
{
Expand Down
Loading