Skip to content
This repository has been archived by the owner on Nov 24, 2021. It is now read-only.
/ zf-form-markdown Public archive

Provides Form Element 'Markdown', to be used within Zend Framework 3 with Zend Form.

License

Notifications You must be signed in to change notification settings

rkeet/zf-form-markdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ZF Form Element Markdown

Provides the ability to use markdown as a type of input element.

Setup

Require module

To install the latest release, using Composer, run:

composer require rkeet/zf-form-markdown

Enable modules

To enable this module, enable both this module and AssetManager. In modules.config.php add the following:

'AssetManager',
'Keet\Markdown',

Usage in Form / Fieldset

Element provides an HTML <textarea> element and paired <div> element to render a preview of whatever is entered in text area.

use Keet\Markdown\Form\Element\Markdown;

...

$this->add(
    [
        'name'       => 'body',
        'type'       => Markdown::class,
        'options'    => [
            'label' => 'Body',
        ],
        'attributes' => [
            'rows'  => 4,
        ],
    ]
);

Module requirements:

Features

  • Provides Service (MarkdownService) for handling markdown conversion server-side
  • Provides a ZF Form Element (Markdown) for Form input
    • Provides Showdown to client when using Markdown Form Element

TODO's

  • Create better preview - possibly:
    • option: inject some overridable default styling
    • option: side-by-side preview instead of above/below
    • option: minimum (overridable) styling to always have a visible preview container
  • Figure out incompatibilities between Parsedown and ShowdownJS