I’m in the end stages of writing an API wrapper (code) for the API provided here and am struggling to provide a nice documentation experience for potential users.
For lack of a better name, the wrapper will be called ScrapyCloudEx. As you can see in the linked documentation above, the API endpoints are split across 2 areas: “app” and “storage”. These change the API calls to some degree (e.g. pagination options are different in app and storage).
I wanted my wrapper to closely follow the API documentation (so it’s easier for the user to know which function maps to which API endpoint), and each endpoint wrapper is therefore implemented in its own module such as ScrapyCloudEx.Endpoints.Storage.Items.
My issue is that this is a very long and cumbersome name. When coding this isn’t an issue (using e.g. alias among other options), but it becomes a problem when viewing the documentation generated by ExDoc: the module names in the sidebar get clipped because they are too long.
What’s the best way to address this? Is there a way to provide some sort of “alias” for the value displayed in the sidebar? Should I create a new module with a shorter name that just defdelegates to the actual implementation (e.g. ScrapyCloudEx.Itemsdefdelegateing all public functions to ScrapyCloudEx.Endpoints.Storage.Items)? Some other approach?
Btw, if you would like to give it a try, let me know and I would love to provide guidance.
I think the simplest approach is to treat each nesting alias as its own “groups_for_modules”. So when you do nest_module_aliases: [Foo.Bar], it is the same as setting groups_for_modules: ["Foo.Bar": [Foo.Bar.Baz, Bar.BazBat]].
Just a tip: if you start looking for the elixir code that renders the sidebar you’ll find out it doesn’t exist. The sidebar is rendered in javascritpt in a handlebars template somewhere. This might save you some time looking.
So I’ve taken a first stab at an implementation, which is available for comment here and I would love your feedback on what I have so far.
No tests or docs yet, as I want to ensure I’m on the right track first…
Also, how do you prefer to work in case there are several iterations? Should I keep the work in my private repo and only open a PR on ExDoc once it’s more or less finalized, or would you rather I open a PR on the ExDoc repo even if more work must be done on the branch?