Replies: 3 comments 2 replies
-
I'd like to keep the issues about things that aren't working as intended and track feature requests like this elsewhere. So I've moved it to a discussion, I hope you don't mind. I'm currently not convinced making the markdown parsing more complex with the prefixes only to support other type of comments that exist only in the doc is worth it. There's also other considerations like my Emacs will indent comments with a single Like you noted |
Beta Was this translation helpful? Give feedback.
-
I've found similar issues with "noisiness" in the rendered output, from comments which I don't necessarily intend to format as Markdown. Eg. in the following example, the FIXME comment relates to the following defn as code – semantically I think of it as part of the code and not its documentation. ;; # Calculating reciprocals
;; Numbers are fun! You can turn $x$ upside down using $\frac{1}{x}$
;; FIXME: handle division by zero
(defn reciprocal [n]
(/ 1.0 n))
;; ## Usage
(mapv reciprocal [2 3 5 7])
;; => [0.5 0.3333333333333333 0.2 0.14285714285714285] Part of the tension is that comments in source code already have several established usages and meanings - in particular Clojure handles the "commenting out" usage by the But there are other standard usages:
Notespace made this distinction explicit by requiring Markdown documentation to be written as For me personally, this would be solved by treating Possible edge case: Should this be a single code cell or two?
|
Beta Was this translation helpful? Give feedback.
-
I think it would be perfectly reasonable to treat a given comment as part of an adjacent code block if there are no empty lines between them. In the edge case above, I'd recommend a policy where the comment is part of the code block above it (mainly for parsing reasons). |
Beta Was this translation helpful? Give feedback.
-
I would like to be able to have "real" line comments. i.e comments that do not render to markdown. or, even comment out markdown if needed.
The assumption that all top level comments should be rendered causes creates noise when iterating on a notebook and wanting to comment sections using ';'.
This is worse if you happen to use parinfer because inline comments at the end of a block become top level automatically.
If others have a similar issue, it might be worth thinking of a std way to achieve this.
My suggestion would be to have some form of comment prefixes.
e.g
or
Or something similar. The latter is backwards compatible but more awkward - because most editors have comment keybindings. These are most likely to be used when really commenting code as opposed to adding comments for markdown purposes in notebooks.
To avoid breaking changes - you could use metadata to specify the prefix meanings. As an aside, this could be useful later if you decide to have alternate syntaxs or markdown options...
noting that:
<!--- comment --->
is painful#_ (comment ...whatever)
works but is not always ideal for quick editsBeta Was this translation helpful? Give feedback.
All reactions