You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.
This is Bad both for performance reasons and legibility reasons. Tracking the provenance of re-exports is difficult, and exploding everything onto a page is bad. On the other hand, presenting only a link doesn't allow you to understand the "index" of that module - everything that is exported from it.
So - let's talk about possible designs for improving the situation.
Goals
Flexible: You can pick and choose how you want a re-exported module to show up.
Indexable: You should be able to see everything exported by a module, even if the totality of the documentation isn't rendered out.
Structured: If documentation is exploded into the current scope, it should try to retain the structure of the original module.
Status Quo
We have essentially two status quo situations: Linking a module (if the module is exported intact and without a shared alias), and totally verbose and unorganized (dumping the docs for the module in whatever order makes sense).
Linking a module isn't great, because we can't know at-a-glance (or Ctrl-F) what a module contains and allows you to use.
Dumping the entire module contents isn't great, because it's totally disorganized (and also can be huge - one of our Prelude-ish modules exploded to 250MB of HTML, hundreds of pages printed as a PDF).
Options
Expand Alias and Link Complete Modules
One easy change that would require little modification would be to "expand" an alias and provide links where possible.
With this option enabled, a module would contain an 'index' of everything the module exports, even if the module is linked. The index can take the form of the current "index pages" - just a list of items, paired with the module that brought it into scope (+ maybe the module that defined it?)
This would require more work than the prior two choices, since we'd be adding stuff to the page, rather than "reinterpreting" the export items.
Link with Changes
With this option enabled, a module re-export that alters the exports would show a link and report what was changed.
Currently if you re export a module with an alias, it dumps all of the contents of that module directly.
This can quite quickly cause performance issues, particularly if you re-export these things.
Even if you re-export with the original module name, if you
hide
anything or only import a specific list, you get a dump of everything:This is Bad both for performance reasons and legibility reasons. Tracking the provenance of re-exports is difficult, and exploding everything onto a page is bad. On the other hand, presenting only a link doesn't allow you to understand the "index" of that module - everything that is exported from it.
Related:
module X (module X, ...) where
.So - let's talk about possible designs for improving the situation.
Goals
Status Quo
We have essentially two status quo situations: Linking a module (if the module is exported intact and without a shared alias), and totally verbose and unorganized (dumping the docs for the module in whatever order makes sense).
Linking a module isn't great, because we can't know at-a-glance (or
Ctrl-F
) what a module contains and allows you to use.Dumping the entire module contents isn't great, because it's totally disorganized (and also can be huge - one of our Prelude-ish modules exploded to 250MB of HTML, hundreds of pages printed as a PDF).
Options
Expand Alias and Link Complete Modules
One easy change that would require little modification would be to "expand" an alias and provide links where possible.
If this option were enabled, Hadock would do the same thing as if you wrote this:
Instead of dumping
Prelude
andBigModule
's contents directly, you'd get a link to those two modules.Modified Modules are Grouped
If this option is enabled, then a modified module is "grouped" with a section. A module like this:
would be rendered as though the user wrote:
Searchable Indexes
With this option enabled, a module would contain an 'index' of everything the module exports, even if the module is linked. The index can take the form of the current "index pages" - just a list of items, paired with the module that brought it into scope (+ maybe the module that defined it?)
This would require more work than the prior two choices, since we'd be adding stuff to the page, rather than "reinterpreting" the export items.
Link with Changes
With this option enabled, a module re-export that alters the exports would show a link and report what was changed.
The above module should generate documentation looking something like:
Seems reasonable to make this two options: link with explicit import, link with explicit hiding.
The text was updated successfully, but these errors were encountered: