Skip to content
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

Formatting of code blocks inside documentation comments #478

Closed
ghost opened this issue Oct 31, 2018 · 3 comments · Fixed by #941
Closed

Formatting of code blocks inside documentation comments #478

ghost opened this issue Oct 31, 2018 · 3 comments · Fixed by #941
Assignees

Comments

@ghost
Copy link

ghost commented Oct 31, 2018

It would be nice if code blocks inside documentation comments where formatted just like normal code so that they don't have to be formatted manually.

@jberdine
Copy link
Collaborator

This sounds like a good idea to me.

If someone wants to manually format a code block, either an attribute could be added to disable ocamlformat, or perhaps a verbatim block could be used. I wonder if it is possible to attach an attribute on the docstring in the source file, or if it is necessary to put the attribute in the code block. The latter would be preferable I think. But either way, I think the first step is to format code blocks, and later see how pressing a disabling solution is.

@ghost
Copy link
Author

ghost commented Nov 1, 2018

Agreed. Personally, I'd be happy to make sure the code snippets are always valid OCaml code so that they can be automatically formatted.

@gpetiot
Copy link
Collaborator

gpetiot commented Apr 15, 2019

To do after #721

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants