Skip to content

Commit fe46a42

Browse files
committed
rename plaintext cell -> raw cell
1 parent 3912ea7 commit fe46a42

9 files changed

Lines changed: 38 additions & 38 deletions

File tree

‎IPython/frontend/html/notebook/static/js/menubar.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ var IPython = (function (IPython) {
130130
this.element.find('#to_markdown').click(function () {
131131
IPython.notebook.to_markdown();
132132
});
133-
this.element.find('#to_plaintext').click(function () {
134-
IPython.notebook.to_plaintext();
133+
this.element.find('#to_raw').click(function () {
134+
IPython.notebook.to_raw();
135135
});
136136
this.element.find('#to_heading1').click(function () {
137137
IPython.notebook.to_heading(undefined, 1);

‎IPython/frontend/html/notebook/static/js/notebook.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,8 @@ var IPython = (function (IPython) {
140140
that.control_key_active = false;
141141
return false;
142142
} else if (event.which === 84 && that.control_key_active) {
143-
// To Plaintext = t
144-
that.to_plaintext();
143+
// To Raw = t
144+
that.to_raw();
145145
that.control_key_active = false;
146146
return false;
147147
} else if (event.which === 49 && that.control_key_active) {
@@ -523,8 +523,8 @@ var IPython = (function (IPython) {
523523
cell = new IPython.MarkdownCell(this);
524524
} else if (type === 'html') {
525525
cell = new IPython.HTMLCell(this);
526-
} else if (type === 'plaintext') {
527-
cell = new IPython.PlaintextCell(this);
526+
} else if (type === 'raw') {
527+
cell = new IPython.RawCell(this);
528528
} else if (type === 'heading') {
529529
cell = new IPython.HeadingCell(this);
530530
};
@@ -557,8 +557,8 @@ var IPython = (function (IPython) {
557557
cell = new IPython.MarkdownCell(this);
558558
} else if (type === 'html') {
559559
cell = new IPython.HTMLCell(this);
560-
} else if (type === 'plaintext') {
561-
cell = new IPython.PlaintextCell(this);
560+
} else if (type === 'raw') {
561+
cell = new IPython.RawCell(this);
562562
} else if (type === 'heading') {
563563
cell = new IPython.HeadingCell(this);
564564
};
@@ -640,14 +640,14 @@ var IPython = (function (IPython) {
640640
};
641641

642642

643-
Notebook.prototype.to_plaintext = function (index) {
643+
Notebook.prototype.to_raw = function (index) {
644644
var i = this.index_or_selected(index);
645645
if (this.is_valid_cell_index(i)) {
646646
var source_element = this.get_cell_element(i);
647647
var source_cell = source_element.data("cell");
648648
var target_cell = null;
649-
if (!(source_cell instanceof IPython.PlaintextCell)) {
650-
target_cell = this.insert_cell_below('plaintext',i);
649+
if (!(source_cell instanceof IPython.RawCell)) {
650+
target_cell = this.insert_cell_below('raw',i);
651651
var text = source_cell.get_text();
652652
if (text === source_cell.placeholder) {
653653
text = '';

‎IPython/frontend/html/notebook/static/js/quickhelp.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ var IPython = (function (IPython) {
4141
{key: 'Ctrl-m k', help: 'move cell up'},
4242
{key: 'Ctrl-m y', help: 'code cell'},
4343
{key: 'Ctrl-m m', help: 'markdown cell'},
44-
{key: 'Ctrl-m t', help: 'plaintext cell'},
44+
{key: 'Ctrl-m t', help: 'raw cell'},
4545
{key: 'Ctrl-m 1-6', help: 'heading 1-6 cell'},
4646
{key: 'Ctrl-m p', help: 'select previous'},
4747
{key: 'Ctrl-m n', help: 'select next'},

‎IPython/frontend/html/notebook/static/js/textcell.js‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -237,33 +237,33 @@ var IPython = (function (IPython) {
237237
};
238238

239239

240-
// PlaintextCell
240+
// RawCell
241241

242-
var PlaintextCell = function (notebook) {
242+
var RawCell = function (notebook) {
243243
this.placeholder = "Type plain text and LaTeX: $\\alpha^2$";
244244
this.code_mirror_mode = 'rst';
245245
IPython.TextCell.apply(this, arguments);
246-
this.cell_type = 'plaintext';
246+
this.cell_type = 'raw';
247247
};
248248

249249

250-
PlaintextCell.prototype = new TextCell();
250+
RawCell.prototype = new TextCell();
251251

252252

253-
PlaintextCell.prototype.render = function () {
253+
RawCell.prototype.render = function () {
254254
this.rendered = true;
255255
this.edit();
256256
};
257257

258258

259-
PlaintextCell.prototype.select = function () {
259+
RawCell.prototype.select = function () {
260260
IPython.Cell.prototype.select.apply(this);
261261
this.code_mirror.refresh();
262262
this.code_mirror.focus();
263263
};
264264

265265

266-
PlaintextCell.prototype.at_top = function () {
266+
RawCell.prototype.at_top = function () {
267267
var cursor = this.code_mirror.getCursor();
268268
if (cursor.line === 0) {
269269
return true;
@@ -273,7 +273,7 @@ var IPython = (function (IPython) {
273273
};
274274

275275

276-
PlaintextCell.prototype.at_bottom = function () {
276+
RawCell.prototype.at_bottom = function () {
277277
var cursor = this.code_mirror.getCursor();
278278
if (cursor.line === (this.code_mirror.lineCount()-1)) {
279279
return true;
@@ -353,7 +353,7 @@ var IPython = (function (IPython) {
353353
IPython.TextCell = TextCell;
354354
IPython.HTMLCell = HTMLCell;
355355
IPython.MarkdownCell = MarkdownCell;
356-
IPython.PlaintextCell = PlaintextCell;
356+
IPython.RawCell = RawCell;
357357
IPython.HeadingCell = HeadingCell;
358358

359359

‎IPython/frontend/html/notebook/static/js/toolbar.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ var IPython = (function (IPython) {
113113
IPython.notebook.to_code();
114114
} else if (cell_type === 'markdown') {
115115
IPython.notebook.to_markdown();
116-
} else if (cell_type === 'plaintext') {
117-
IPython.notebook.to_plaintext();
116+
} else if (cell_type === 'raw') {
117+
IPython.notebook.to_raw();
118118
} else if (cell_type === 'heading1') {
119119
IPython.notebook.to_heading(undefined, 1);
120120
} else if (cell_type === 'heading2') {

‎IPython/frontend/html/notebook/templates/notebook.html‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@
107107
<hr/>
108108
<li id="to_code"><a href="#">Code</a></li>
109109
<li id="to_markdown"><a href="#">Markdown </a></li>
110-
<li id="to_plaintext"><a href="#">Plaintext</a></li>
110+
<li id="to_raw"><a href="#">Raw</a></li>
111111
<li id="to_heading1"><a href="#">Heading 1</a></li>
112112
<li id="to_heading2"><a href="#">Heading 2</a></li>
113113
<li id="to_heading3"><a href="#">Heading 3</a></li>
@@ -171,7 +171,7 @@
171171
<select id="cell_type">
172172
<option value="code">Code</option>
173173
<option value="markdown">Markdown</option>
174-
<option value="plaintext">Plaintext</option>
174+
<option value="raw">Raw</option>
175175
<option value="heading1">Heading 1</option>
176176
<option value="heading2">Heading 2</option>
177177
<option value="heading3">Heading 3</option>

‎IPython/nbformat/v3/nbpy.py‎

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,11 @@ def to_notebook(self, s, **kwargs):
6868
state = u'markdowncell'
6969
cell_lines = []
7070
kwargs = {}
71-
elif line.startswith(u'# <plaintextcell>'):
71+
elif line.startswith(u'# <rawcell>'):
7272
cell = self.new_cell(state, cell_lines, **kwargs)
7373
if cell is not None:
7474
cells.append(cell)
75-
state = u'plaintextcell'
75+
state = u'rawcell'
7676
cell_lines = []
7777
kwargs = {}
7878
elif line.startswith(u'# <headingcell'):
@@ -113,10 +113,10 @@ def new_cell(self, state, lines, **kwargs):
113113
text = self._remove_comments(lines)
114114
if text:
115115
return new_text_cell(u'markdown',source=text)
116-
elif state == u'plaintextcell':
116+
elif state == u'rawcell':
117117
text = self._remove_comments(lines)
118118
if text:
119-
return new_text_cell(u'plaintext',source=text)
119+
return new_text_cell(u'raw',source=text)
120120
elif state == u'headingcell':
121121
text = self._remove_comments(lines)
122122
level = kwargs.get('level',1)
@@ -172,10 +172,10 @@ def writes(self, nb, **kwargs):
172172
lines.extend([u'# <markdowncell>',u''])
173173
lines.extend([u'# ' + line for line in input.splitlines()])
174174
lines.append(u'')
175-
elif cell.cell_type == u'plaintext':
175+
elif cell.cell_type == u'raw':
176176
input = cell.get(u'source')
177177
if input is not None:
178-
lines.extend([u'# <plaintextcell>',u''])
178+
lines.extend([u'# <rawcell>',u''])
179179
lines.extend([u'# ' + line for line in input.splitlines()])
180180
lines.append(u'')
181181
elif cell.cell_type == u'heading':

‎IPython/nbformat/v3/tests/nbexamples.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
))
3434

3535
ws.cells.append(new_text_cell(
36-
u'plaintext',
36+
u'raw',
3737
source='A random array',
3838
))
3939

@@ -106,7 +106,7 @@
106106
107107
# A random array
108108
109-
# <plaintextcell>
109+
# <rawcell>
110110
111111
# A random array
112112

‎IPython/nbformat/v3/tests/test_nbbase.py‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,14 +59,14 @@ def test_markdown_cell(self):
5959
self.assertEquals(tc.source, u'hi')
6060
self.assertEquals(tc.rendered, u'hi')
6161

62-
def test_empty_plaintext_cell(self):
63-
tc = new_text_cell(u'plaintext')
64-
self.assertEquals(tc.cell_type, u'plaintext')
62+
def test_empty_raw_cell(self):
63+
tc = new_text_cell(u'raw')
64+
self.assertEquals(tc.cell_type, u'raw')
6565
self.assertEquals(u'source' not in tc, True)
6666
self.assertEquals(u'rendered' not in tc, True)
6767

68-
def test_plaintext_cell(self):
69-
tc = new_text_cell(u'plaintext', 'hi', 'hi')
68+
def test_raw_cell(self):
69+
tc = new_text_cell(u'raw', 'hi', 'hi')
7070
self.assertEquals(tc.source, u'hi')
7171
self.assertEquals(tc.rendered, u'hi')
7272

0 commit comments

Comments
 (0)