Skip to content

Preserve code layout in .mli files #680

Closed
@aantron

Description

@aantron

While writing the docs for Dream, I needed control over width. For example, this function

val run :
  ?interface:string ->
  ?port:int ->
  ?stop:unit promise ->
  ?debug:bool ->
  ?error_handler:error_handler ->
  ?secret:string ->
  ?old_secrets:string list ->
  ?prefix:string ->
  ?https:true ->
  ?certificate_file:string ->
  ?key_file:string ->
  ?builtins:bool ->
  ?greeting:bool ->
  ?adjust_terminal:bool ->
    handler -> unit

ought to be set like that, or in some similar way. By contrast, current odoc sets functions on one wrapped line no matter how wide the signature is. See here for an example. Ideally, I would have control over width even for the latter layout, the odoc default, but for Dream's two-column layout, width control is critical.

To work around this, Dream's doc generation process applies about 1400 lines of hand-written patches to odoc output.

It would be much more convenient if odoc would preserve the layout in the source to the greatest extent possible, since then the .mli file could be used to control and tweak the appearance of the docs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions