david_ex
ExDoc: long module names in sidebar getting clipped -> what to do?
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.Items defdelegateing all public functions to ScrapyCloudEx.Endpoints.Storage.Items)? Some other approach?
Most Liked
tmbb
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.
josevalim
There is an open issue here: https://github.com/elixir-lang/ex_doc/issues/834
david_ex
Excellent, thank you. I’ll monitor that issue 
david_ex
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?
josevalim
Feel free to open up a PR as early as you want so you can collect feedback. 








