@@ -102,14 +102,16 @@ function parse_doc(document::AbstractString, format::MarkupInput)
102
102
if m. captures[1 ] == nothing
103
103
optionString = " "
104
104
else
105
- optionString= strip ( m. captures[1 ])
105
+ optionString= m. captures[1 ]
106
106
end
107
107
108
108
options = Dict {Symbol,Any} ()
109
- if length (optionString) > 0
110
- expr = Meta. parse (optionString)
111
- Base. Meta. isexpr (expr,:(= )) && (options[expr. args[1 ]] = expr. args[2 ])
112
- Base. Meta. isexpr (expr,:toplevel ) && map (pushopt,fill (options,length (expr. args)),expr. args)
109
+ if ! isempty (optionString)
110
+ map (strip .(split (optionString, ' ,' ))) do opt
111
+ expr = Meta. parse (opt)
112
+ Base. Meta. isexpr (expr,:(= )) && (options[expr. args[1 ]] = expr. args[2 ])
113
+ Base. Meta. isexpr (expr,:toplevel ) && map (pushopt,fill (options,length (expr. args)),expr. args)
114
+ end
113
115
end
114
116
haskey (options, :label ) && (options[:name ] = options[:label ])
115
117
haskey (options, :name ) || (options[:name ] = nothing )
@@ -260,17 +262,26 @@ function parse_doc(document::String, format::NotebookInput)
260
262
document = replace (document, " \r\n " => " \n " )
261
263
nb = JSON. parse (document)
262
264
parsed = Any[]
263
- options = Dict {Symbol,Any} ()
264
265
opt_string = " "
265
266
docno = 1
266
267
codeno = 1
267
268
268
269
for cell in nb[" cells" ]
269
270
srctext = " \n " * join (cell[" source" ], " " )
271
+ options = Dict {Symbol,Any} ()
270
272
271
273
if cell[" cell_type" ] == " code"
272
274
opt_strings = String[]
273
- haskey (cell[" metadata" ], " jupyter" ) && get (cell[" metadata" ][" jupyter" ], " source_hidden" , false ) && (push! (opt_strings, " echo = false" ))
275
+ if haskey (cell[" metadata" ], " jupyter" )
276
+ if get (cell[" metadata" ][" jupyter" ], " source_hidden" , false )
277
+ push! (opt_strings, " echo = false" )
278
+ options[:echo ] = false
279
+ end
280
+ if get (cell[" metadata" ][" jupyter" ], " outputs_hidden" , false )
281
+ push! (opt_strings, " suppress_output = true" )
282
+ options[:suppress_output ] = true
283
+ end
284
+ end
274
285
opt_string = join (opt_strings, " , " )
275
286
chunk = CodeChunk (rstrip (srctext), codeno, 0 , opt_string, options)
276
287
push! (parsed, chunk)
0 commit comments