Skip to content

Commit 1c0746b

Browse files
committed
README updates. Markdown cell highlight bar.
1 parent fe0172e commit 1c0746b

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

InstructorTools/javascript/InstructorToolsmnu.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ function createInstructorToolsMenu(){
1616
if (lastvalue=='Insert Data Entry Table...'){
1717
get_table_dim();
1818
}
19+
if (lastvalue=='Mark Cell as Instructions'){
20+
indicate_cell_contains_instructions();
21+
}
1922
if (lastvalue=='Protect Selected Cells'){
2023
protect_selected_cells();
2124
}
@@ -57,6 +60,9 @@ function createInstructorToolsMenu(){
5760
Instructor Tools</option>';
5861
optiontxt+='<option title="Insert cell below selected and create a \
5962
data entry table.">Insert Data Entry Table...</option>';
63+
optiontxt+='<option title="Add light blue color bar to left of \
64+
markdown cell. Used to indicate instructions.">Mark Cell as \
65+
Instructions</option>';
6066
optiontxt+='<option disabled>----</option>';
6167
optiontxt+='<option title="Prevent editing of selected cells."> \
6268
Protect Selected Cells</option>';
@@ -206,6 +212,18 @@ function insert_getnames_timestamp(){
206212
protect_selected_cells();
207213
}
208214

215+
function indicate_cell_contains_instructions(){
216+
var text = '<div style="border-color:lightblue;border-style:solid; \
217+
float:left;height:100%;margin-right:4px;"></div>\n\n';
218+
JPSLUtils.insert_text_at_beginning_of_current_cell(text);
219+
var currentcell = Jupyter.notebook.get_selected_cell();
220+
var cellindex=Jupyter.notebook.find_cell_index(currentcell);
221+
Jupyter.notebook.to_code(cellindex);
222+
Jupyter.notebook.to_markdown(cellindex);
223+
Jupyter.notebook.focus_cell();
224+
Jupyter.notebook.get_selected_cell().execute();
225+
}
226+
209227
function insert_init_boilerplate(){
210228
var mkdstr = "### You must initialize the software each time you use \
211229
this notebook.\n";

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ The menu is activated by the python command `import InstructorTools`.
2121
Jupyter kernel. Tables are viewable, but not editable in a plain vanilla
2222
Jupyter install.
2323
* This uses the `jupyter-datainputtable` package.
24+
* Add light blue highlight bar to left of a selected markdown cell to
25+
indicate it contains instructions. Can be removed by deleting the `<div>`
26+
inserted at the beginning of the cell.
2427
* Protect/unprotect selected cells. Protected cells cannot be
2528
edited or deleted by the user. This is a good way to prevent instructions
2629
and example code from being damaged by students.
@@ -134,6 +137,8 @@ Simply replace `$ pip install jupyter-instructortools` with
134137
* 0.5.3
135138
* Added options to flag cells as allowed to be hidden.
136139
* Added ability to test hide/show of cells.
140+
* Added ability to place light blue highlight bar at left of markdown
141+
cells.
137142
* README updates.
138143
* 0.5.2 Better messages and Readme updates.
139144
* 0.5.1

0 commit comments

Comments
 (0)