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

Support more listings (a la {!modules:..}) #1098

Open
xvw opened this issue Mar 27, 2024 · 0 comments
Open

Support more listings (a la {!modules:..}) #1098

xvw opened this issue Mar 27, 2024 · 0 comments

Comments

@xvw
Copy link
Contributor

xvw commented Mar 27, 2024

When writing manuals in .mld files, the {!modules:...} directive is very useful and I think it would be really handy to support more listing directives, to encourage writing manuals in mld that support references (and code block execution via mdx).

Here is a list of guidelines that I would find potentially useful (but there are probably others).
Ideally, the "title" of the item listed would be a link to the resource.

  • {!type:...} which would display a type and the first paragraph of its documentation block (which would introduce a notion of synopsis in the documentation blocks attached to types). This primitive is useful because, for example, in a textbook, it makes it easy to list the different types used to solve a particular problem. ie: "For this task, we will essentially be using the following types: [newline] {!types: Foo.t Bar.t}"

  • {!values:...} (or maybe {!vals:...}) which will display a list of values with their types and the first paragraph of their documentation block (also introducing a notion of synopsis for values, so that, for example, examples of how the function is used are not imported). I think this primitive is useful because, a bit like types, it allows you to synthesise the functions you're going to use to solve a specific task.

  • {!pages:...} which simplifies the generalisation of summaries/tables of contents and which would probably use the first paragraph after heading-0 as the synopsis (the link is required here)

  • {!modules-types:...}: directive, which would have the same form as the {!modules:...}, but for module-types and offering the same advantages as the modules (and types).

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

No branches or pull requests

1 participant