Git Product home page Git Product logo

markdownpanel's Introduction

MATLAB FEX Minimum Version

MarkdownPanel

Control which displays markdown as HTML within a MATLAB control


This control utilizes the Showdown javascript library to convert markdown into HTML and then uses MATLAB's own HTMLBrowserPanel to display this HTML.

It behaves like any other graphics object within MATLAB in that all properties can either be set upon object construction

h = MarkdownPanel('Parent', figure, 'Content', '# Hello World!');

Or after object creation using the returned handle

h = MarkdownPanel();
h.Parent = gcf;
set(h, 'Position', [0, 0, 0.5, 0.5])

To set the actual Markdown content, use the Content property. You can provide either a string, or a cell array of strings which will automatically create a multi-line entry

set(h, 'Content', '#Hello World')
set(h, 'Content', {'#Hello World', 'This is a test...'})

You can use the Options property to modify options that are specific to how Showdown renders the markdown. By default, we use all of the default settings except that we enable support for tables.

h.Options.tables = true;

The Options property is simply a struct where the fieldnames are the option names and the value is the option value. You can modify this struct to adjust an option.

% Enable support for tasklists
h.Options.taskslists = true

A complete list of options can be found in the Showdown documentation


Usage

panel = MarkdownPanel();

Outputs

panel, Graphics Object, The graphics handle that can be used to manipulate the appearance of the control


Demo

A demo application has been bundled with this code to show how to use some of the features. To run this demo, simply type the following into the MATLAB console.

MarkdownPanel.demo()

Markdown Demo Application


Attribution

Copyright (c) <2016> Jonathan Suever.
All rights reserved

This software is licensed under the BSD license

markdownpanel's People

Contributors

suever avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.