Is there a way to toggle whether or not comments show up as text in a notebook? I do a fair amount of setting things up at the top of the notebook that will eventually be factored out, but I'd like to be able to add comments w/o seeing it in the notebook
not yet, been thinking about a :prose visibility setting
for now you can wrap the comments e.g. in
(
;; my comments
)thx! that's what I've been doing. Just a bit clunky. Just didn't want to miss something obvious
Is there a version of clerk/example that doesn't show the source code of the form it displays (just the results)?
Using (when nextjournal.clerk.config/*in-clerk* ...) is enough for now, but if I have a namespace that doesn't have a dependency on Clerk this will throw an unresolved symbol error, right?
if you want to go that route, you can add a resolve / ns-resolve check to your when to avoid trying to check the symbol if it isnโt defined
I have this, Iโll paste my version later / tomorrow
@afoltzm hereโs what I have on this other project:
(defmacro clerk-comment
"Evaluates the expressions in `body` showing code next to results in Clerk.
Does nothing outside of Clerk, like `clojure.core/comment`."
[& body]
(when nextjournal.clerk.config/*in-clerk*
`(nextjournal.clerk/fragment ~(vec body))))
(intern 'nextjournal.clerk (with-meta 'comment (meta #'clerk-comment)) @#'clerk-comment)let me know if this is helpful, considering to include it in clerk