UNPKG

@patternslib/patternslib

Version:

Patternslib is a JavaScript library that enables designers to build rich interactive prototypes without the need for writing any Javascript. All events are triggered by classes and other attributes in the HTML, without abusing the HTML as a programming la

66 lines (58 loc) 1.49 kB
<!DOCTYPE html> <html> <head> <title>Demo page</title> <meta charset="utf-8" /> <link href="/style/common.css" rel="stylesheet" /> <script src="/bundle.min.js"></script> </head> <body> <h3>The content below is rendered from Markdown</h3> <hr /> <article class="pat-rich"> <div class="pat-markdown"> # Header 1 ## Header 2 Some _other_ __markdown__ ___content___. And a list numbered list: 1. one 2. two 3. three 7. four | Felis | dui | porttitor | |-------|-----------|-----------| | dui | porttitor | eros | Some code: ```javascript const pattern = registry.patterns[name]; if (pattern.transform) { try { pattern.transform($content); } catch (e) { if (dont_catch) { throw(e); } log.error("Transform error for pattern" + name, e); } } ``` </div> <hr /> <ol> <li><a class="pat-inject" href="content/content" data-pat-inject="target: #target; data-type: markdown" >Inject markdown content with data-type declaration.</a></li> <li><a class="pat-inject" href="content/content.md" data-pat-inject="target: #target" >Inject markdown content, automatically detected as markdown based on the file name extension.</a></li> </ol> <div id="target"> The content rendered from markdown will appear here. </div> </article> </body> </html>