HTML:
-
<head>
<title>CodeMirror: Code Folding Demo</title>
<meta charset=”utf-8″>
<link rel=”stylesheet” href=”../doc/docs.css”><style>
.some-css {
color: red;
line-height: 2;
}
</style><link rel=”stylesheet” href=”../lib/codemirror.css”>
<link rel=”stylesheet” href=”../addon/fold/foldgutter.css”>
http://../lib/codemirror.js
http://../addon/fold/foldcode.js
http://../addon/fold/foldgutter.js
http://../addon/fold/brace-fold.js
http://../addon/fold/xml-fold.js
http://../addon/fold/indent-fold.js
http://../addon/fold/markdown-fold.js
http://../addon/fold/comment-fold.js
http://../mode/javascript/javascript.js
http://../mode/xml/xml.js
http://../mode/css/css.js
http://../mode/htmlmixed/htmlmixed.js
http://../mode/python/python.js
http://../mode/markdown/markdown.js
<style type=”text/css”>
.CodeMirror {border-top: 1px solid black; border-bottom: 1px solid black;}
</style>
</head><body>
<article>
<h2>Code Folding Demo</h2>
<form>JavaScript:HTML:Python:
def foo():
do_some_stuff()
here
return Noneclass Bar:
__init__(self):
if True:
print(“True”)
else:
print(“False”)this_code_makes_no_sense():
pass# A comment
Markdown:</form>
</article>
</body>
The blog I need help with is: (visible only to logged in users)
-
/*
* Demonstration of code folding
*/
window.onload = function() {
var te = document.getElementById(“code”);
var sc = document.getElementById(“script”);
te.value = (sc.textContent || sc.innerText || sc.innerHTML).replace(/^s*/, “”);
sc.innerHTML = “”;
var te_html = document.getElementById(“code-html”);
te_html.value = document.documentElement.innerHTML;
var te_python = document.getElementById(“code-python”);
var te_markdown = document.getElementById(“code-markdown”);
te_markdown.value = “# Foon## Barnnblah blahnn## Baznnblah blahnn# Quuxnnblah blahn”window.editor = CodeMirror.fromTextArea(te, {
mode: “javascript”,
lineNumbers: true,
lineWrapping: true,
extraKeys: {“Ctrl-Q”: function(cm){ cm.foldCode(cm.getCursor()); }},
foldGutter: true,
gutters: [“CodeMirror-linenumbers”, “CodeMirror-foldgutter”]
});
editor.foldCode(CodeMirror.Pos(13, 0));window.editor_html = CodeMirror.fromTextArea(te_html, {
mode: “text/html”,
lineNumbers: true,
lineWrapping: true,
extraKeys: {“Ctrl-Q”: function(cm){ cm.foldCode(cm.getCursor()); }},
foldGutter: true,
gutters: [“CodeMirror-linenumbers”, “CodeMirror-foldgutter”]
});
editor_html.foldCode(CodeMirror.Pos(0, 0));
editor_html.foldCode(CodeMirror.Pos(34, 0));window.editor_python = CodeMirror.fromTextArea(te_python, {
mode: “python”,
lineNumbers: true,
extraKeys: {“Ctrl-Q”: function(cm){ cm.foldCode(cm.getCursor()); }},
foldGutter: true,
gutters: [“CodeMirror-linenumbers”, “CodeMirror-foldgutter”]
});window.editor_markdown = CodeMirror.fromTextArea(te_markdown, {
mode: “markdown”,
lineNumbers: true,
lineWrapping: true,
extraKeys: {“Ctrl-Q”: function(cm){ cm.foldCode(cm.getCursor()); }},
foldGutter: true,
gutters: [“CodeMirror-linenumbers”, “CodeMirror-foldgutter”]
});
}; -
def foo():
do_some_stuff()
here
return Noneclass Bar:
__init__(self):
if True:
print(“True”)
else:
print(“False”)this_code_makes_no_sense():
pass# A comment
-
-
WordPress.COM users have code restrictions. No JavaScript, no form codes, except these https://en.support.wordpress.com/forms/contact-form https://en.support.wordpress.com/forms/, no tracking codes, no advertising codes, and no unsupported embeds of iframes can be used on any wordpress.COM hosted sites.
Please read:
https://en.support.wordpress.com/code/
allowed HTML tags list – https://en.support.wordpress.com/code/#html-tags
https://en.support.wordpress.com/code/#javascript
https://en.support.wordpress.com/code/#flash-and-other-embedsSee: Moving to Self-Hosted WordPress
https://move.wordpress.com/WordPress.COM and WordPress.ORG are completely separate and have different username accounts, logins, features, run different versions of some themes with the same names, and have separate support documentation and separate support forums. Read the differences here http://en.support.wordpress.com/com-vs-org/
If you don’t have a username account at WordPress.ORG account, then click http://wordpress.org/support/ and register one on the top right-hand corner of the page that opens, https://wordpress.org/support/register.php so you can post to the support forums there.
Resetting your WordPress.ORG password http://codex.wordpress.org/Resetting_Your_Password
WordPress.org support docs are at https://codex.wordpress.org/Main_Page
See also https://apps.wordpress.org/support/
- The topic ‘HTML:’ is closed to new replies.
