1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-28 07:20:06 +02:00

refactor(core): Parser API's refactoring #288

This commit is contained in:
Awilum
2019-11-11 16:53:10 +03:00
parent 4b275f7c19
commit 64264c8061
5 changed files with 10 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
# The title of the website
title: Flextype
title: Flextype1
# The description of the website
description: Build fast, flexible, easier to manage websites with Flextype.
@@ -70,7 +70,7 @@ entries:
#
# - display: Display errors or not.
errors:
display: false
display: true
# Cache
#

View File

@@ -18,7 +18,7 @@ use function ltrim;
use function preg_split;
use function trim;
class FrontmatterParser
class Frontmatter
{
/**
* Front matter parser

View File

@@ -13,7 +13,7 @@ namespace Flextype;
use ParsedownExtra;
class MarkdownParser
class Markdown
{
/**

View File

@@ -74,7 +74,7 @@ class Parser
{
switch ($parser) {
case 'frontmatter':
return FrontmatterParser::encode($input);
return Parser::encode($input);
break;
case 'json':
@@ -111,12 +111,12 @@ class Parser
return $data_from_cache;
}
$data = FrontmatterParser::decode($input);
$data = Frontmatter::decode($input);
$this->flextype['cache']->save($key, $data);
return $data;
} else {
return FrontmatterParser::decode($input);
return Frontmatter::decode($input);
}
break;
@@ -162,12 +162,12 @@ class Parser
return $data_from_cache;
}
$data = MarkdownParser::parse($input);
$data = Markdown::parse($input);
$this->flextype['cache']->save($key, $data);
return $data;
} else {
return MarkdownParser::parse($input);
return Markdown::parse($input);
}
break;

View File

@@ -44,6 +44,6 @@ class MarkdownTwigExtension extends Twig_Extension
*/
public function markdown($value) : string
{
return MarkdownParser::parse($value);
return Markdown::parse($value);
}
}