interface ParsedMarkdownInterface in Markdown 8.2
Interface parsed markdown instances.
Hierarchy
- interface \Drupal\Component\Render\MarkupInterface extends \Drupal\Component\Render\JsonSerializable; interface \Drupal\Core\Cache\RefinableCacheableDependencyInterface
- interface \Drupal\markdown\Render\ParsedMarkdownInterface extends \Drupal\markdown\Render\Countable \Drupal\markdown\Render\Serializable
Expanded class hierarchy of ParsedMarkdownInterface
All classes that implement ParsedMarkdownInterface
2 files declare their use of ParsedMarkdownInterface
- Markdown.php in src/
Markdown.php - MarkdownInterface.php in src/
MarkdownInterface.php
File
- src/
Render/ ParsedMarkdownInterface.php, line 14
Namespace
Drupal\markdown\RenderView source
interface ParsedMarkdownInterface extends \Countable, \Serializable, MarkupInterface, RefinableCacheableDependencyInterface {
/**
* Indicates the item should never be removed unless explicitly deleted.
*/
const PERMANENT = CacheBackendInterface::CACHE_PERMANENT;
/**
* Creates new ParsedMarkdown object.
*
* @param string $markdown
* The raw markdown.
* @param string $html
* The parsed HTML from $markdown.
* @param \Drupal\Core\Language\LanguageInterface|null $language
* The language of the parsed markdown, if known.
*
* @return static
*/
public static function create($markdown = '', $html = '', LanguageInterface $language = NULL);
/**
* Normalizes markdown.
*
* @param string $markdown
* The markdown to normalize.
*
* @return string
* The normalized markdown.
*/
public static function normalizeMarkdown($markdown);
/**
* Retrieves the UNIX timestamp for when this object should expire.
*
* Note: this method should handle the use case of a string being set to
* indicate a relative future time.
*
* @param int $from_time
* A UNIX timestamp used to expire from. This will only be used when the
* expire value has been set to a relative time in the future, e.g. day,
* week, month, etc. If not set, this current request time will be used.
*
* @return int
* The UNIX timestamp.
*/
public function getExpire($from_time = NULL);
/**
* Retrieves the parsed HTML.
*
* @return string
* The parsed HTML.
*/
public function getHtml();
/**
* Retrieves the identifier for this object.
*
* Note: if no identifier is currently set, a unique hash based on the
* contents of the parsed HTML will be used.
*
* @return string
* The identifier for this object.
*/
public function getId();
/**
* Retrieves the human-readable label for this object.
*
* Note: if no label is currently set, the identifier for the object is
* returned instead.
*
* @return string
* The label for this object.
*/
public function getLabel();
/**
* Retrieves the raw markdown source.
*
* @return string
* The markdown source.
*/
public function getMarkdown();
/**
* Retrieves the file size of the parsed HTML.
*
* @param bool $formatted
* Flag indicating whether to retrieve the formatted, human-readable,
* file size.
* @param int $decimals
* The number of decimal points to use if $formatted is TRUE.
*
* @return int|string
* The raw file size in bytes or the formatted human-readable file size.
*/
public function getSize($formatted = FALSE, $decimals = 2);
/**
* Compares whether the provided markdown matches this object.
*
* @param string|\Drupal\markdown\Render\ParsedMarkdownInterface $markdown
* An external markdown source.
*
* @return bool
* TRUE or FALSE
*/
public function matches($markdown);
/**
* Sets the object's expiration timestamp.
*
* @param int|string $expire
* A UNIX timestamp or a string indicating a relative time in the future of
* when this object is to expire, e.g. "1+ day".
*
* @return static
*/
public function setExpire($expire = Cache::PERMANENT);
/**
* Sets the object's identifier.
*
* @param string $id
* An identifier.
*
* @return static
*/
public function setId($id);
/**
* Sets the object's label.
*
* @param string $label
* A human-readable label.
*
* @return static
*/
public function setLabel($label);
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyInterface:: |
public | function | The cache contexts associated with this object. | 34 |
CacheableDependencyInterface:: |
public | function | The maximum age for which this object may be cached. | 34 |
CacheableDependencyInterface:: |
public | function | The cache tags associated with this object. | 27 |
MarkupInterface:: |
public | function | Returns markup. | 4 |
ParsedMarkdownInterface:: |
public static | function | Creates new ParsedMarkdown object. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the UNIX timestamp for when this object should expire. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the parsed HTML. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the identifier for this object. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the human-readable label for this object. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the raw markdown source. | 1 |
ParsedMarkdownInterface:: |
public | function | Retrieves the file size of the parsed HTML. | 1 |
ParsedMarkdownInterface:: |
public | function | Compares whether the provided markdown matches this object. | 1 |
ParsedMarkdownInterface:: |
public static | function | Normalizes markdown. | 1 |
ParsedMarkdownInterface:: |
constant | Indicates the item should never be removed unless explicitly deleted. | ||
ParsedMarkdownInterface:: |
public | function | Sets the object's expiration timestamp. | 1 |
ParsedMarkdownInterface:: |
public | function | Sets the object's identifier. | 1 |
ParsedMarkdownInterface:: |
public | function | Sets the object's label. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds a dependency on an object: merges its cacheability metadata. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache contexts. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Adds cache tags. | 1 |
RefinableCacheableDependencyInterface:: |
public | function | Merges the maximum age (in seconds) with the existing maximum age. | 1 |