You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP →

@intcreator/markdown-element

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@intcreator/markdown-element - npm Package Compare versions

Comparing version

to
0.2.1

{
"description": "A Markdown renderer that uses the Commonmark spec",
"name": "@intcreator/markdown-element",
"version": "0.2.0",
"version": "0.2.1",
"author": "Brandon der Blätter (https://intcreator.com)",

@@ -6,0 +6,0 @@ "main": "markdown-element.js",

@@ -5,4 +5,46 @@ # <markdown-element>

## Usage
### `markdown` attribute
The markdown source is taken directly from the `markdown` attribute supplied to the element. The markdown supplied can be dynamically updated to change the rendered markdown.
```html
<markdown-element markdown="This **demo** uses the `markdown` _attribute_, not `src`">
<div slot="markdown-html"></div>
</markdown-element>
```
### `src` attribute
The `src` attribute can be used to load a markdown file through AJAX. It overrides the `markdown` attribute. The source can be dynamically updated to change the markdown file displayed.
```html
<markdown-element src="./demo.md">
<div slot="markdown-html"></div>
</markdown-element>
```
### `<script>` tag
A `<script>` tag can be inserted inside of the `<markdown-element>` to provide the markdown source. It overrides the `markdown` and `src` attributes. Support for changing this markdown source dynamically is not yet implemented.
```html
<markdown-element>
<div slot="markdown-html"></div>
<script type="text/markdown">
This demo uses a `<script>` tag.
</script>
</markdown-element>
```
## Roadmap to 1.0
Here are a few issues that need to be resolved before the 1.0 release:
- Is it possible to get rid of the `<div slot="markdown-html"></div>` and still allow users to easily style the contents of `<markdown-element>` with custom styles?
- Dynamically update markdown when changed in the script tag (if possible) or find another way to dynamically update multiline-markdown
## Contributing
Open an issue or contact me on the Polymer Slack, Twitter, etc. @intcreator.