Skip to content

Commit

Permalink
interpret 'plaintext' cells with their new name 'raw'
Browse files Browse the repository at this point in the history
  • Loading branch information
minrk committed Mar 14, 2012
1 parent fe46a42 commit d2b70d8
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
5 changes: 5 additions & 0 deletions IPython/frontend/html/notebook/static/js/notebook.js
Expand Up @@ -1197,6 +1197,11 @@ var IPython = (function (IPython) {
var new_cell = null;
for (i=0; i<ncells; i++) {
cell_data = new_cells[i];
// handle short-lived plaintext name for raw cells
if (cell_data.cell_type === 'plaintext'){
cell_data.cell_type = 'raw';
}

new_cell = this.insert_cell_below(cell_data.cell_type);
new_cell.fromJSON(cell_data);
};
Expand Down
3 changes: 3 additions & 0 deletions IPython/nbformat/v3/nbbase.py
Expand Up @@ -114,6 +114,9 @@ def new_code_cell(input=None, prompt_number=None, outputs=None,
def new_text_cell(cell_type, source=None, rendered=None):
"""Create a new text cell."""
cell = NotebookNode()
# handle short-lived plaintext name for raw cells
if cell_type == 'plaintext':
cell_type = 'raw'
if source is not None:
cell.source = unicode(source)
if rendered is not None:
Expand Down
2 changes: 1 addition & 1 deletion IPython/nbformat/v3/nbpy.py
Expand Up @@ -68,7 +68,7 @@ def to_notebook(self, s, **kwargs):
state = u'markdowncell'
cell_lines = []
kwargs = {}
elif line.startswith(u'# <rawcell>'):
elif line.startswith(u'# <rawcell>') or line.startswith(u'# <plaintextcell>'):
cell = self.new_cell(state, cell_lines, **kwargs)
if cell is not None:
cells.append(cell)
Expand Down

0 comments on commit d2b70d8

Please sign in to comment.