Skip to content

Latest commit

 

History

History
92 lines (75 loc) · 2.72 KB

README.md

File metadata and controls

92 lines (75 loc) · 2.72 KB
permalink title
pat/texteditor/
Text Editor

Text Editor pattern.

Show a code editor.


Deprecated

This pattern is deprecated. Use Patternslib's pat-code-editor instead.


Configuration

Option Type Default Description
theme string null Theme to use with editor. defaults to whatever it ships with.
mode string What type of syntax is it? text
width integer 500 Width of the editor.
height integer 200 Height of the editor.
tabSize integer 4 TODO
softTabs boolean true Use spaces for tabs.
wrapMode boolean false Wrap text.
showGutter boolean TODO true
showPrintMargin boolean Show print margin. false
readOnly boolean Read only editor. false

Examples

Default

foobar
<pre class="pat-texteditor" data-pat-texteditor="theme:clouds">
foobar
</pre>

Different theme

var foo = 'bar';
function foobar() {
 return foo;
}
<pre class="pat-texteditor" data-pat-texteditor="mode:javascript;theme:dawn;">
var foo = 'bar';
function foobar() {
 return foo;
}
</pre>

Different options

var foo = 'bar';
function foobar() {
 return foo;
}
<pre
    class="pat-texteditor"
    data-pat-texteditor="mode:javascript;
                  theme:ambiance;
                  tabSize:2;
                  showGutter:false;
                  showPrintMargin:true;"
>
var foo = 'bar';
function foobar() {
 return foo;
}
</pre>