Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/germanmtzmx/prism-markdown-element

A LitElement that renders markdown with syntax highlight support
https://github.com/germanmtzmx/prism-markdown-element

commonmark litelement markdown prismjs webcomponent

Last synced: 2 months ago
JSON representation

A LitElement that renders markdown with syntax highlight support

Awesome Lists containing this project

README

        

# \

[![Published on webcomponents.org](https://img.shields.io/badge/webcomponents.org-published-blue.svg)](https://www.webcomponents.org/element/prism-markdown-element)

**prism-markdown-element** is `LitElement` component inspired from [markdown-element](https://github.com/intcreator/markdown-element) but with extra sugar properties

It allows render markdown to html with the help of `prismjs` and `commonmark` libraries

**Install**

```shell
npm i prism-markdown-element
```

**import it**

```js
import 'prism-markdown-element/prism-markdown-element.js';
```

## Features
* Support highlight code syntax
* Support the default themes from `prismjs`
* Support custom theme from any url or path (should be a style link and a prismjs theme)

## Properties

* **mdsrc** markdown source url
* **markdown** markdown text (string)
* **theme** any `prismjs` theme ('coy', 'dark', 'funky', 'okaidia','solarizedlight', 'tomorrow', 'twilight')
* **customtheme** custom theme url (should be a prismjs css )

## Usage

**No theme (prism as default) and remote markdown**

```html

```

**customtheme example**

``` html

```

**markdown string and prismtheme**

```html

```