odoc icon indicating copy to clipboard operation
odoc copied to clipboard

Anonymous includes

Open rizo opened this issue 6 years ago • 6 comments

How useful is it to have special UI support in odoc for anonymous includes?

Consider this example:

(* x.mli *)

include module type of struct
  include Pervasives
end

This is currently done in the new Stdlib module and here's how the output looks:

stdlib-include

I don't think include module type of sig ... end is informative or useful in any way. I suggest we inline this type of includes in the original module.

Of course a counterargument is that technically it is not inlined and that should be made explicit.

(Rendered version: https://nojb.github.io/ocaml-manual/odoc/stdlib/Stdlib/index.html)

rizo avatar Jul 17 '18 11:07 rizo

includes of structure/signatures should indeed always be inlined by default.

We currently haven't gone that way yet because substitution (for example with type _ t := int) isn't properly implemented, and inlining the include can sometimes cause information to disappear.

I'd suggest waiting for the backend to be rewritten before adding this specific support, but won't mind to much if people want to go ahead with this right away (as there's always the option to change the default when invoking odoc, or on a case by case basis with @open/closed tags).

trefis avatar Jul 17 '18 11:07 trefis

Hello! I am not sure if this is the right place to ask this question, but in general, it would be good to be able to control how include S should rendered. (I can imagine three choices: show only include S in the output; show only the content of the signature S; or show both). Does odoc offer this feature today? If not, is it planned? Thanks!

fpottier avatar Mar 26 '20 14:03 fpottier

It does, see https://ocaml-doc.github.io/octavius/syntax.html (in particular: the "new tags" section).

trefis avatar Mar 26 '20 15:03 trefis

Thanks!

fpottier avatar Mar 26 '20 15:03 fpottier

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

github-actions[bot] avatar May 01 '20 15:05 github-actions[bot]

This is not implemented currently and I think makes sense to do.

Julow avatar Mar 30 '23 14:03 Julow