Skip to content

Commit 5c8d4d9

Browse files
Update notebook example to include implied print
1 parent 8a80ca7 commit 5c8d4d9

1 file changed

Lines changed: 55 additions & 0 deletions

File tree

extension/example-notebooks/hello-world-idl.idlnb

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,61 @@
120120
"metadata": {},
121121
"outputs": []
122122
},
123+
{
124+
"type": "markdown",
125+
"content": [
126+
"### Notebook Cells Behave like the IDL Console"
127+
],
128+
"metadata": {},
129+
"outputs": []
130+
},
131+
{
132+
"type": "markdown",
133+
"content": [
134+
"At a high-level, notebook cells are executed like statements in the IDL Console, but with a few, positive differences.",
135+
"",
136+
"First, you can create variables and print them just by typing their names. Variables printed this way have a special semantic token coloring applied to differentiate them from procedures."
137+
],
138+
"metadata": {},
139+
"outputs": []
140+
},
141+
{
142+
"type": "code",
143+
"content": [
144+
"myAwesomeVar = 'I''m printing and I know it!'",
145+
"myAwesomeVar"
146+
],
147+
"metadata": {},
148+
"outputs": []
149+
},
150+
{
151+
"type": "markdown",
152+
"content": [
153+
"When you run the cell above, it should print out the text `I'm printing and I know it!`",
154+
"",
155+
"You can also type statements similar to the IDL Console, such as addition and they will be printed as well."
156+
],
157+
"metadata": {},
158+
"outputs": []
159+
},
160+
{
161+
"type": "code",
162+
"content": [
163+
"1 + 2 + 3"
164+
],
165+
"metadata": {},
166+
"outputs": []
167+
},
168+
{
169+
"type": "markdown",
170+
"content": [
171+
"> Pro tip: Printing statements like this only apply to code that lives outside of procedure or function definitions.",
172+
">",
173+
"> If you put the above code in a routine definition, you would get a syntax error."
174+
],
175+
"metadata": {},
176+
"outputs": []
177+
},
123178
{
124179
"type": "markdown",
125180
"content": [

0 commit comments

Comments
 (0)