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

[Feature request] Strip module-path components from the front of generated docs #21

Open
ELLIOTTCABLE opened this issue Apr 11, 2021 · 0 comments

Comments

@ELLIOTTCABLE
Copy link

I'd love the ability to "leave out" chunks of the module-path.

For example, in a project named bs-slash-create, BuckleScript by default 'namespaces' the project's modules underneath a module of the same name, SlashCreate. In simple projects with only one root module, this can result in a doubled module-path, i.e. SlashCreate.SlashCreate.

When running bsdoc build SlashCreate in such a project, a directory-structure like this is produced:

./bs-slash-create $ tree docs
docs
└── SlashCreate
    └── SlashCreate
        ...
        ├── SlashCommand
        │   ├── Option
        │   │   └── index.html
        │   └── index.html
        ├── SlashCreator
        │   └── index.html
        ├── User
        │   └── index.html
        ├── UserFlags
        │   └── index.html
        └── index.html

When published to GitHub Pages, this results in URLs like:

https://by.elliottcable.name/bs-slash-create/SlashCreate/SlashCreate/index.html

Ideally, bsdoc would allow me to explicitly strip particular components, and then discard any modules that are inaccessible by the newly-stripped path (i.e. bsdoc build SlashCreate --strip SlashCreate.SlashCreate producing SlashCommand, User, etc at the top-level of the docs.)

Alternatively, at the least, it'd be nice if bsdoc respected the "namespace" field in bsconfig.json:

{
   "$schema": "https://raw.githubusercontent.com/rescript-lang/rescript-compiler/master/docs/docson/build-schema.json",
   "name": "bs-slash-create",
   "namespace": false,
   "sources": [{
      "dir": "src",
      "subdirs": true
   }],
   // ...

... and didn't produce an additional top-level SlashCreate when that is thusly configured.

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