UNPKG

alpaca

Version:

Alpaca provides the easiest and fastest way to generate interactive forms for the web and mobile devices. It runs simply as HTML5 or more elaborately using Bootstrap, jQuery Mobile or jQuery UI. Alpaca uses Handlebars to process JSON schema and provide

58 lines (47 loc) 1.25 kB
<!doctype html> <html lang="en-US"> <head> <meta charset="UTF-8"> <title></title> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/require.js/2.1.10/require.min.js"></script> <script type="text/javascript"> require(["../lib/beautify-html"],function(html_beautify){ var input = document.getElementById("input").value; var output = html_beautify.html_beautify(input); document.getElementById("output").innerHTML = output; }); </script> <style type="text/css"> #output{ border: 1px solid black; height: 300px; width: 100%; } #input{ width: 100%; height: 300px; } </style> </head> <body> <h1>RequireJS test</h1> <p> This example loads the html-beautifier by using a relative path in the require call to the beautify-html.js file. (also works works with absolute paths) </p> <pre> require(["../lib/beautify-html"],function(html_beautify){ var input = document.getElementById("input").value; var output = html_beautify.html_beautify(input); document.getElementById("output").innerHTML = output; }); </pre> <h2>Input</h2> <textarea name="" id="input"> <ul><li><a href="test"></a></li></ul> </textarea> <h2>Output</h2> <textarea name="" id="output"> </textarea> </body> </html>