Skip to content
This repository was archived by the owner on Jun 15, 2023. It is now read-only.
This repository was archived by the owner on Jun 15, 2023. It is now read-only.

Module scope docstring support #579

Closed
@ryyppy

Description

@ryyppy

There should be dedicated docstring parsing / printing for module level docs.

Example:

// Utils.resi
/**
This module contains convenience functions for strings, arrays and dates.
(this is a docstring attached to the toplevel scope of the `Utils` module)
*/

/**
Date utils (This docstring should apply to the submodule `Date`)
*/
module Date = {
  /** Formats a date in a human-readable way (YYYY-MM-DD) (This is a normal value doc string) */
  let formatDate: (Js.Date.t) => string;
}

We are currently using @ns.doc as the internal presentation of value-level docstrings, so we could think about using a @@ns.doc decorator for module level usage.

Probably worth noting that ocamldoc used a @@ocaml.text attribute for module level documentation. Needs more investigation why that is, but ideally we'd like to keep the number of attribute names low for simplicity.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions