You are here

MarkdownHelp.php in Markdown 8

File

src/Plugin/Block/MarkdownHelp.php
View source
<?php

namespace Drupal\markdown\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Provides the MarkdownHelp block.
 *
 * @Block(
 *   id = "markdown_help",
 *   admin_label = @Translation("Markdown filter tips")
 * )
 */
class MarkdownHelp extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {
    $build = [];
    $build['#title'] = t('Markdown filter tips');
    $build['#markup'] = $this
      ->markdownHelpContent();
  }
  protected function markdownHelpContent() {
    return '<pre>' . t("\n## Header 2 ##\n### Header 3 ###\n#### Header 4 ####\n##### Header 5 #####\n(Hashes on right are optional)\n\nLink [Drupal](http://drupal.org)\n\nInline markup like _italics_,\n **bold**, and `code()`.\n\n> Blockquote. Like email replies\n>> And, they can be nested\n\n* Bullet lists are easy too\n- Another one\n+ Another one\n\n1. A numbered list\n2. Which is numbered\n3. With periods and a space\n\nAnd now some code:\n    // Code is indented text\n    is_easy() to_remember();") . '</pre>';
  }

}

Classes

Namesort descending Description
MarkdownHelp Provides the MarkdownHelp block.