PHPackages                             schumacherfm/mage2-markdown - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. schumacherfm/mage2-markdown

ActiveMagento2-module[Utility &amp; Helpers](/categories/utility)

schumacherfm/mage2-markdown
===========================

Markdown or Parsedown for Magento2

1.0.0(7y ago)4142OSL-3.0PHP

Since Jun 8Pushed 7y ago1 watchersCompare

[ Source](https://github.com/SchumacherFM/Magento2-Markdown)[ Packagist](https://packagist.org/packages/schumacherfm/mage2-markdown)[ RSS](/packages/schumacherfm-mage2-markdown/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (2)Used By (0)

Magento2 Markdown Template Engine
=================================

[](#magento2-markdown-template-engine)

Markdown template engine for Magento2.

This template engine is meant to be used additionally to the `.phtml` files and does not provide any `.md` template file.

A use case would be to replace some simple `.phtml` files with Markdown or uses the Markdown template files as some kind of CMS.

You can write any PHP in the Markdown files. After PHP has been executed the template will be transformed from Markdown to HTML.

Events &amp; Configuration
--------------------------

[](#events--configuration)

The Markdown template engine class dispatches one event which lets you modify the current parser.

Event name: `markdown_init` with event object: `engine`.

Configuration options can be found Stores -&gt; Settings -&gt; Configuration -&gt; Advanced -&gt; Developer -&gt; Markdown.

You can choose from one of the three engines:

- Michelf (Markdown)
- MichelfExtra (Markdown Extra)
- ParseDown

Default engine is the first one.

Frontend Integration
--------------------

[](#frontend-integration)

Example use case: Disable WYSIWYG editor and switch the content from the product tables to full Markdown support.

We're deactivating the WYSIWYG editor completely in the backend via the option

`Stores -> Configuration -> General -> Content Management -> WYSIWYG Options` with value `Disable completely`. As a side effect you backend loads much faster ;-(

Your template files must have the file extension `.md` to get automatically recognized.

In your theme change `catalog_product_view.xml` to

```

            getShortDescription
            short_description
            overview
            none
            Overview
            itemprop="description"

```

Note: We are only changing the template extension.

```

            getDescription
            description
            description
            none
            Details

```

@todo figure out best method to easily change the template name for those blocks.

These changes mean that product short description and long description will now be parsed with Markdown!

#### Example attribute.phtml converted to attribute.md

[](#example-attributephtml-converted-to-attributemd)

[Click here to view the original attribute.phtml](https://github.com/magento/magento2/blob/develop/app%2Fcode%2FMagento%2FCatalog%2Fview%2Ffrontend%2Ftemplates%2Fproduct%2Fview%2Fattribute.phtml)

The next excerpt is from `attribute.md` which only shows the last six lines:

```
... PHP stuff ...
