/web_widget_markdown

Odoo JavaScript Widget to add markdown support to Text Field (Edit and Readonly modes).

Primary LanguageJavaScriptGNU General Public License v3.0GPL-3.0

Odoo 14.0 web widget Markdown

This widget add a markdown Editor to Text field. In Edit mode the Editor is fuly usable and in readonly mode the widget shows a naive transformation of markdown to HTML as a preview.

This module uses the JavaScript library SimpleMDE as a Markdown Editor for the client.

And the python Markdown library for backend usage.

pip install markdown

This is also the source code for the the article written on codingdodo.com about Test Driven Developement in Odoo 14 JavaScript.

Usage

In your xml view, add widget="markdown" to any Text field.

<field name="mytextfield" widget="markdown" options="{'placeholder': 'Type content here'}">

Edit mode

Markdown Editor

Readonly mode

Markdown Render

Options

In the options attribute, pass any options of SimpleMDE configuration.

Usage in report / Website templates

There is also a t-options widget markdown available for usage in PDF reports (rendered server side in python)

<div t-raw="o.content" t-options="{'widget': 'markdown'}"></div>

Bug Tracker

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback.

Do not contact contributors directly about support or help with technical issues.

Credits

Big thanks to the authors of SimpleMDE.

Widget Author

Coding Dodo