diff --git a/echo_kernel/kernel.py b/echo_kernel/kernel.py index eebb51d..c7b07e8 100644 --- a/echo_kernel/kernel.py +++ b/echo_kernel/kernel.py @@ -33,6 +33,12 @@ def do_execute(self, code, silent, store_history=True, stream_content = {'name': 'stdout', 'text': code} self.send_response(self.iopub_socket, 'stream', stream_content) + # Quarto executes inline code via user_expressions + user_expr_results = {} + if user_expressions: + for key, expression in user_expressions.items(): + user_expr_results[key] = dict(status='ok', data={'text/plain': expression}, metadata={}) + # in this example, we are using a very simple way to # detect if a cell is a setup cell. In a real kernel, you # would want to use a more robust method to detect setup cells @@ -53,5 +59,5 @@ def do_execute(self, code, silent, store_history=True, # The base class increments the execution count 'execution_count': self.execution_count, 'payload': [], - 'user_expressions': {}, + 'user_expressions': user_expr_results, }