Hello, John Kitchin writes:
> This is doable with a hook and advice I think. The hook will hide the > results if you use :results hide in the header. > > I had to use the advice to remove the results before hand, so that you > toggle the visibility off. This is pretty lightly tested. you could > eliminate > > (defun hide-results (&optional &rest args) > (let ((results (cdr (assoc :results (third (org-babel-get-src-block-info > 'light)))))) > (when (string-match "hide" results) > (org-babel-hide-result-toggle t)))) > > (add-hook 'org-babel-after-execute-hook 'hide-results) > > (advice-add 'org-babel-execute-src-block :before (lambda (&rest args) > (org-babel-remove-result))) > > I guess there are other ways that might work too. > > #+BEGIN_SRC jupyter-python :results hide > print(5) > #+END_SRC > > #+RESULTS: > : 5 That works very well. Many thanks. Roger