-
Notifications
You must be signed in to change notification settings - Fork 91
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
Document how to escape arbitrary text for a doc comment #1161
Comments
I think the best way would be if OCaml could escape it, and pass it to odoc directly in the Currently, I don't know if there is a proper way. We need a way to escape it in odoc, that also escapes it in OCaml. What are the hacky ways you found? My editor is putting |
Do you mean unescape? This is generated code, and I don’t think the comments follow any particular markup language.
The hacky solution is to mangle the input in some way.
That still runs into OCaml strings being interpreted inside comments. I’m not sure what the best solution to that is. |
OCaml supports escaping in comments using the string literal syntaxes: (**
"*)"
{delim|
*)
|}
|delim}
*) Perhaps Odoc should parse that and turn it into a code span or code block ? |
When adding more protocols to @talex5’s pure-OCaml Wayland implementation, I found that building certain protocols failed. In one case, this turned out to be because the code generator copies a free-form description from the XML source into a documentation comment, and the XML contained
*)
, which was interpreted as a close comment by OCaml.There are many hacky ways to solve the issue, but I’d like to know what the proper way to solve it is.
The text was updated successfully, but these errors were encountered: