ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ILIAS\Data\Text\Shape\Markdown Class Reference
+ Inheritance diagram for ILIAS\Data\Text\Shape\Markdown:
+ Collaboration diagram for ILIAS\Data\Text\Shape\Markdown:

Public Member Functions

 __construct (Refinery\String\MarkdownFormattingToHTML $markdown_to_html,)
 
 toHTML (Text\Text $text)
 
 toPlainText (Text\Text $text)
 
 getMarkup ()
 
 fromString (string $text)
 
 isRawStringCompliant (string $text)
 
- Public Member Functions inherited from ILIAS\Data\Text\Shape
 fromString (string $text)
 
 isRawStringCompliant (string $text)
 
 toHTML (Text $text)
 It should almost never be required to call this directly on shape. More...
 
 toPlainText (Text $text)
 It should almost never be required to call this directly on shape. More...
 
 getMarkup ()
 

Protected Attributes

Refinery Transformation $markdown_to_html_transformation
 

Detailed Description

Definition at line 28 of file Markdown.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\Data\Text\Shape\Markdown::__construct ( Refinery\String\MarkdownFormattingToHTML  $markdown_to_html)

Definition at line 32 of file Markdown.php.

34 {
35 $this->markdown_to_html_transformation = $markdown_to_html->toHTML();
36 }

Member Function Documentation

◆ fromString()

ILIAS\Data\Text\Shape\Markdown::fromString ( string  $text)
Exceptions

InvalidArgumentException if $text is not compliant.

Implements ILIAS\Data\Text\Shape.

Definition at line 63 of file Markdown.php.

63 : Text\Markdown
64 {
65 return new Text\Markdown($this, $text);
66 }

◆ getMarkup()

ILIAS\Data\Text\Shape\Markdown::getMarkup ( )

Implements ILIAS\Data\Text\Shape.

Definition at line 58 of file Markdown.php.

58 : Markup\Markdown
59 {
60 return new Markup\Markdown();
61 }

◆ isRawStringCompliant()

ILIAS\Data\Text\Shape\Markdown::isRawStringCompliant ( string  $text)

Implements ILIAS\Data\Text\Shape.

Definition at line 68 of file Markdown.php.

68 : bool
69 {
70 return true;
71 }

◆ toHTML()

ILIAS\Data\Text\Shape\Markdown::toHTML ( Text\Text  $text)

Definition at line 38 of file Markdown.php.

38 : Text\HTML
39 {
40 if (!$text instanceof Text\Markdown) {
41 throw new \LogicException("Text does not match format.");
42 }
43 return new Text\HTML(
44 $this->markdown_to_html_transformation->transform(
45 $text->getRawRepresentation()
46 )
47 );
48 }

◆ toPlainText()

ILIAS\Data\Text\Shape\Markdown::toPlainText ( Text\Text  $text)

Definition at line 50 of file Markdown.php.

50 : Text\PlainText
51 {
52 if (!$text instanceof Text\Markdown) {
53 throw new \LogicException("Text does not match format.");
54 }
55 return new Text\PlainText($text->getRawRepresentation());
56 }

Field Documentation

◆ $markdown_to_html_transformation

Refinery Transformation ILIAS\Data\Text\Shape\Markdown::$markdown_to_html_transformation
protected

Definition at line 30 of file Markdown.php.


The documentation for this class was generated from the following file: