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: Deeply nested modules do not fit in sidebar · Issue #834 · elixir-lang/ex_doc · GitHub
david_ex
Excellent, thank you. I’ll monitor that issue ![]()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









