@intcreator/markdown-element
Advanced tools
Comparing version
{ | ||
"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. |
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
Unidentified License
License(Experimental) Something that seems like a license was found, but its contents could not be matched with a known license.
Found 1 instance in 1 package
11655
15.4%49
600%