在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:matthias-schuetz/HTMLiveCode开源软件地址:https://github.com/matthias-schuetz/HTMLiveCode开源编程语言:JavaScript 85.1%开源软件介绍:HTMLiveCodeA browser-based editor for real-time HTML/CSS/JS prototypingHTMLiveCode is a simple editor which is built on top of HTML, CSS and JavaScript. It was made for the editing of these languages and can be used for rapid prototyping. The editor can be customized in its appearance so there are themes and some other editor options. HTMLiveCode is based on CodeMirror and makes use of JSLint and HTML5's localStorage. UsageAfter loading all necessary files of the folders "js" and "css" in your main file, HTMLiveCode is available in the global namespace and must be instantiated as an object. You don't need any HTML markup as the editor will be attached to the <body> element. You don't need to specify any options since HTMLiveCode can be started with default settings. The editor should be instantiated when the DOM is ready. For example, use the "DOMContentLoaded" event to make sure that everything has been loaded. Defaults/*
* HTMLiveCode instantiation (all arguments are optional)
*
* @param Object settings Object which contains all options
* settings:
* @param Boolean gutter Toggles gutter and line numbers
* @param Boolean wordWrap Toggles word wrapping
* @param String theme Sets color theme (either "bright" or "dark")
* @param String imageProxyPath Only works when HTMLiveCode is used locally!
* Virtual path prefix for CSS and IMG urls
* (e.g. "C:/Images/") so you can set a "background-image" url
* to "button.png" and it will virtually be routed to
* "file:///C:/Images/button.png"
*/
var liveEditor = new HTMLiveCode(settings); Examples// Default settings
window.addEventListener("DOMContentLoaded", function() {
window.liveEditor = new HTMLiveCode();
window.liveEditor.init();
});
// Custom options
window.addEventListener("DOMContentLoaded", function() {
window.liveEditor = new HTMLiveCode({
gutter: false,
wordWrap: false,
theme: "dark",
imageProxyPath: "C:/Images/" // only works when HTMLiveCode is used locally
});
window.liveEditor.init();
}); ShortcutsHTMLiveCode comes with some default shortcuts:
Notes
LicenseHTMLiveCode is released under the MIT license. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论