@@ -102,14 +102,16 @@ function parse_doc(document::AbstractString, format::MarkupInput)
102102 if m. captures[1 ] == nothing
103103 optionString = " "
104104 else
105- optionString= strip ( m. captures[1 ])
105+ optionString= m. captures[1 ]
106106 end
107107
108108 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
113115 end
114116 haskey (options, :label ) && (options[:name ] = options[:label ])
115117 haskey (options, :name ) || (options[:name ] = nothing )
@@ -260,17 +262,26 @@ function parse_doc(document::String, format::NotebookInput)
260262 document = replace (document, " \r\n " => " \n " )
261263 nb = JSON. parse (document)
262264 parsed = Any[]
263- options = Dict {Symbol,Any} ()
264265 opt_string = " "
265266 docno = 1
266267 codeno = 1
267268
268269 for cell in nb[" cells" ]
269270 srctext = " \n " * join (cell[" source" ], " " )
271+ options = Dict {Symbol,Any} ()
270272
271273 if cell[" cell_type" ] == " code"
272274 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
274285 opt_string = join (opt_strings, " , " )
275286 chunk = CodeChunk (rstrip (srctext), codeno, 0 , opt_string, options)
276287 push! (parsed, chunk)
0 commit comments