-
Notifications
You must be signed in to change notification settings - Fork 241
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Early implementation of formatting comments with Markdown. #738
Conversation
Thanks for taking a look at this! Without looking too much at the implementation yet (since parts are likely to change), here are some of my high-level thoughts:
This alone makes me think we should not consider On the other hand, it's easy to rationalize doing this for
I agree with this. My typography-loving side thinks there would be a lot of value to letting the user specify a smaller width, like roughly 66, for comments even if the column limit is more. There are subtleties we'd need to consider, like that we don't mean the comment ends at that column number but rather that its width is no more than that (so a doc comment indented at column 8 could go to column 72, not 66), but we'd still have to make sure it never exceeded the total width. I think the way the code is written now and the way the Markdown library handles reflowing makes that pretty straightforward, but it's still probably better saved for a separate future change, just to keep things scoped tighter. When re-rendering text, how does the Markdown library handle parts of the syntax that might have more than one possible form? For example, if I emphasize with either
Does it keep the bullets I used or force them all to a single form? |
I agree. Commented-out code blocks have to be left intact.
Interesting idea, although it might not make much difference in the end. Worth playing around with though.
They get canonicalized to a single form. Lists get a |
Did you have something different in mind? Curious what your thoughts were here.
That works for me! I was worried lists might get something like |
What was the status of this? It was still in Draft mode the last time I checked, so I wasn't sure it was ready for deeper review yet. |
@allevato I actually wanted to have a discussion to nail down some of the desired behavior around the edge cases of both doc and regular comments. Things like block comments (with and without ASCII art) and indentation level changes, mixtures of different comment types, etc. What is the best place to discuss topics like this? |
I think this PR would be fine to discuss those, especially if the discussion needs to happen in the context of the changes you're making in the PR. |
@allevato I wanted to check if this is roughly what you had in mind for comment formatting. Maybe you'd be interested in playing with it a bit. I'm very interested in hearing your thoughts on how you see a feature like this working! A few random thoughts so far:
\
to force line breaks gets re-rendered as double space.line
comments, but aside from the two issues above it could just be an issue with applying it to an existing codebase. Possibly a separate flag, or maybe individual comment sections could have a way to opt in/out?