-
Notifications
You must be signed in to change notification settings - Fork 94
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
@-tags include everything after them #1138
Comments
I think it's useful to see the existing bits of code that might be affected by this change. I did a very naive run of the docs ci on the latest version of every package with some very basic instrumentation to detect more than one |
I went through those examples of the affected code, though not exhaustively -- there are a lot! I did find instances where the change would not be good, but I also found many more where the change would make the docs better. So I'm in favour of the suggestion of having a blank line end the tag. We might also want to consider other ways to end it, like a heading? I wouldn't suggest all block markup as there are some instances in the above of e.g. lists being used sensibly in @param and @return tags. |
I think it should be all blocks but introduce a way for making multiple blocks if you saw it needed. I can see two possibilities here:
Solution 2. looks cleaner to me. |
Thanks for going through the list, that was a lot of work! I'm fine with either options 1 or 2, though I lean ever so slightly in favour of 2 rather than 1. |
I'd be more in favour of 1. Unless I'm mistaken in the current language:
and
are strictly equivalent. If we adopt 2. that would no longer be the case in @-tag contexts. I don't find this to be a desirable property. |
I have investigated, and finally found something that add grist to my mill! Ocamlformat (with the
Becomes
However, it assumes that it is safe to add newlines between lists when needed:
is formatted as
So, ocamlformat assumed it is safe to add a newline (and it was). Going with option 2., ocamlformat would change the meaning of the docstring when formatting. This is not a discriminating reason to chose 2. over 1., but that's comforting me in my preference for 1. |
We discussed this during the dev meeting and decided to go for 1:
I'll start implementing this soon. |
While implementing this, I was surprised by how the implicit ending of list light syntax work. So, blank lines, section headings, closing bracket and tags end a list item:
However, other blocks (eg code blocks, media blocks, ...) do not end the list item:
A quick search shows that this is indeed used in the wild. If we implement the tag as planned (takes a single block, without constraint), this creates some strange interaction. For instance:
This inconsistency is problematic. It seems to make sense to have the same rule for implicit ending of both tags and light syntax list. |
They are not necessarily at the end anymore, and the end similarly as light syntax list: on new lines or heading. This is a breaking change, which according to ocaml#1138 is fixing more things than breaking them. It will allow using custom tags and tags in mld files.
They are not necessarily at the end anymore, and the end similarly as light syntax list: on new lines or heading. This is a breaking change, which according to ocaml#1138 is fixing more things than breaking them. It will allow using custom tags and tags in mld files.
I'm quite happy with being consistent with the way lists are terminated, that's one less thing to have to remember. Having said that I think we'll still need to have a way to have multi-paragraph tags (and lists, for that matter), so issue #1226 is still important. |
They are not necessarily at the end anymore, and the end similarly as light syntax list: on new lines or heading. This is a breaking change, which according to #1138 is fixing more things than breaking them. It will allow using custom tags and tags in mld files.
They are not necessarily at the end anymore, and the end similarly as light syntax list: on new lines or heading. This is a breaking change, which according to ocaml#1138 is fixing more things than breaking them. It will allow using custom tags and tags in mld files.
I'm pretty sure I implemented this behaviour once upon a time and I did so to match ocamldoc's existing behaviour. But I wonder if it is a mistake to have
@
tags extend onwards until either the end of the comment or another@
tag. I just found something like:and it seems a very reasonable thing to write, but it gets rendered very badly because everything after
@param
is considered part of the tag. (Also #329 is right, the markup for tags is bad).Perhaps we should take a blank line as ending the tag? I think the actual tags we support would be fine only taking a single paragraph as input.
The text was updated successfully, but these errors were encountered: