Description
Currently ModuleAlias
is defined in DocExtraction.docItem
as:
| ModuleAlias of {
id: string;
docstring: string list;
name: string;
items: docItem list;
}
While this differentiates between a module implementation and an alias, there is no way of knowing if 2 aliases reference the same target.
E.g:
// Root.res
module A = Core.Array // {id: "Root.A", name: "A",...}
module B = Core.Array // {id: "Root.B", name: "B",...}
While the above is obviously bad interface design, it becomes more important if we were to extract docs from several different modules, which alias the same module.
When generating documentation for a complete project we most likely want to be able to avoid duplication.
If we were to run doc extraction on every module (file) in the example below, it would be nice to have an id stating the aliased module is the same as the one from another extracted json.
src/
Pkg__A.res
Pkg__B.res
Pkg.res // aliases Pkg__A & Pkg__B
Therefore we need a way to uniquely identify a target module.
P.S: I guess we could compare identities by content of the json structures, but a simple id string is easier to handle.