com.vaadin.polymer.marked.MarkedElementElement Maven / Gradle / Ivy
/*
* This code was generated with Vaadin Web Component GWT API Generator,
* from marked-element project by The Polymer Project Authors (https://polymer.github.io/AUTHORS.txt)
* that is licensed with https://polymer.github.io/LICENSE.txt license.
*/
package com.vaadin.polymer.marked;
import com.vaadin.polymer.elemental.*;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArray;
import jsinterop.annotations.JsOverlay;
import jsinterop.annotations.JsProperty;
import jsinterop.annotations.JsType;
/**
* Element wrapper for the marked library.
* <marked-element>
accepts Markdown source and renders it to a child
element with the class markdown-html
. This child element can be styled
as you would a normal DOM element. If you do not provide a child element
with the markdown-html
class, the Markdown source will still be rendered,
but to a shadow DOM child that cannot be styled.
* Markdown Content
* The Markdown source can be specified several ways:
* Use the markdown
attribute to bind markdown
* <marked-element markdown="`Markdown` is _awesome_!">
* <div class="markdown-html"></div>
* </marked-element>
*
*
*
Use <script type="text/markdown">
element child to inline markdown
* <marked-element>
* <div class="markdown-html"></div>
* <script type="text/markdown">
* Check out my markdown!
*
* We can even embed elements without fear of the HTML parser mucking up their
* textual representation:
*
* ```html
* <awesome-sauce>
* <div>Oops, I'm about to forget to close this div.
* </awesome-sauce>
* ```
* </script>
* </marked-element>
*
*
*
Use <script type="text/markdown" src="URL">
element child to specify remote markdown
* <marked-element>
* <div class="markdown-html"></div>
* <script type="text/markdown" src="../guidelines.md"></script>
* </marked-element>
*
*
*
Note that the <script type="text/markdown">
approach is static. Changes to
the script content will not update the rendered markdown!
* Though, you can data bind to the src
attribute to change the markdown.
* <marked-element>
* <div class="markdown-html"></div>
* <script type="text/markdown" src$="[[source]]"></script>
* </marked-element>
* ...
* <script>
* ...
* this.source = '../guidelines.md';
* </script>
*
* Styling
* If you are using a child with the markdown-html
class, you can style it
as you would a regular DOM element:
* .markdown-html p {
* color: red;
* }
*
* .markdown-html td:first-child {
* padding-left: 24px;
* }
*
*
*
*/
@JsType(isNative=true)
public interface MarkedElementElement extends HTMLElement {
@JsOverlay public static final String TAG = "marked-element";
@JsOverlay public static final String SRC = "marked-element/marked-element.html";
/**
* Enable GFM line breaks (regular newlines instead of two spaces for breaks)
*
* JavaScript Info:
* @property breaks
* @type Boolean
*
*/
@JsProperty boolean getBreaks();
/**
* Enable GFM line breaks (regular newlines instead of two spaces for breaks)
*
* JavaScript Info:
* @property breaks
* @type Boolean
*
*/
@JsProperty void setBreaks(boolean value);
/**
* A reference to the XMLHttpRequest instance used to generate the
network request.
*
* JavaScript Info:
* @property xhr
* @type XMLHttpRequest
*
*/
@JsProperty JavaScriptObject getXhr();
/**
* A reference to the XMLHttpRequest instance used to generate the
network request.
*
* JavaScript Info:
* @property xhr
* @type XMLHttpRequest
*
*/
@JsProperty void setXhr(JavaScriptObject value);
/**
* Conform to obscure parts of markdown.pl as much as possible. Don’t fix any of the original markdown bugs or poor behavior.
*
* JavaScript Info:
* @property pedantic
* @type Boolean
*
*/
@JsProperty boolean getPedantic();
/**
* Conform to obscure parts of markdown.pl as much as possible. Don’t fix any of the original markdown bugs or poor behavior.
*
* JavaScript Info:
* @property pedantic
* @type Boolean
*
*/
@JsProperty void setPedantic(boolean value);
/**
* Sanitize the output. Ignore any HTML that has been input.
*
* JavaScript Info:
* @property sanitize
* @type Boolean
*
*/
@JsProperty boolean getSanitize();
/**
* Sanitize the output. Ignore any HTML that has been input.
*
* JavaScript Info:
* @property sanitize
* @type Boolean
*
*/
@JsProperty void setSanitize(boolean value);
/**
* Use “smart” typographic punctuation for things like quotes and dashes.
*
* JavaScript Info:
* @property smartypants
* @type Boolean
*
*/
@JsProperty boolean getSmartypants();
/**
* Use “smart” typographic punctuation for things like quotes and dashes.
*
* JavaScript Info:
* @property smartypants
* @type Boolean
*
*/
@JsProperty void setSmartypants(boolean value);
/**
* Callback function invoked by Marked after HTML has been rendered.
It must take two arguments: err and text and must return the resulting text.
*
* JavaScript Info:
* @property callback
* @type Function
*
*/
@JsProperty Function getCallback();
/**
* Callback function invoked by Marked after HTML has been rendered.
It must take two arguments: err and text and must return the resulting text.
*
* JavaScript Info:
* @property callback
* @type Function
*
*/
@JsProperty void setCallback(Function value);
/**
* Function used to customize a renderer based on the API specified in the Marked
library.
It takes one argument: a marked renderer object, which is mutated by the function.
*
* JavaScript Info:
* @property renderer
* @type Function
*
*/
@JsProperty Function getRenderer();
/**
* Function used to customize a renderer based on the API specified in the Marked
library.
It takes one argument: a marked renderer object, which is mutated by the function.
*
* JavaScript Info:
* @property renderer
* @type Function
*
*/
@JsProperty void setRenderer(Function value);
/**
* The markdown source that should be rendered by this element.
*
* JavaScript Info:
* @property markdown
* @type String
*
*/
@JsProperty String getMarkdown();
/**
* The markdown source that should be rendered by this element.
*
* JavaScript Info:
* @property markdown
* @type String
*
*/
@JsProperty void setMarkdown(String value);
/**
* Unindents the markdown source that will be rendered.
*
* JavaScript Info:
* @method unindent
* @param {} text
*
*
*/
void unindent(Object text);
/**
* Renders markdown
into this element’s DOM.
* This is automatically called whenever the markdown
property is changed.
* The only case where you should be calling this is if you are providing
markdown via <script type="text/markdown">
after this element has been
constructed (or updating that markdown).
*
* JavaScript Info:
* @method render
*
*
*/
void render();
}