forked from themsaid/ibis
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #17 from Hi-Folks/feat/15-aside-markdown
Feat/15 aside markdown
- Loading branch information
Showing
10 changed files
with
289 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
|
||
namespace Ibis\Markdown\Extensions; | ||
|
||
use League\CommonMark\Node\Block\AbstractBlock; | ||
|
||
class Aside extends AbstractBlock | ||
{ | ||
final public const TYPE_NOTE = "note"; | ||
|
||
final public const TYPE_CAUTION = "caution"; | ||
|
||
final public const TYPE_TIP = "tip"; | ||
|
||
final public const TYPE_DANGER = "danger"; | ||
|
||
private readonly string $title; | ||
|
||
public function __construct(private $type = self::TYPE_NOTE, $title = "") | ||
{ | ||
$this->title = $title === "" ? ucwords((string) $this->type) : $title; | ||
|
||
parent::__construct(); | ||
} | ||
|
||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
public function getTitle(): string | ||
{ | ||
return $this->title; | ||
} | ||
|
||
} |
Oops, something went wrong.