david_ex

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

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

josevalim

Creator of Elixir
david_ex

david_ex

Excellent, thank you. I’ll monitor that issue :+1:

david_ex

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

josevalim

Creator of Elixir

Feel free to open up a PR as early as you want so you can collect feedback. :slight_smile:

Where Next?

Popular in Questions Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
bsollish-terakeet
Credo is smart enough to check for (something like) this: assert length(the_list) == 0 with this response: Checking if an enum is empt...
New
itssasanka
Hi all, Trying to get some more clarity over utc_datetime and naive_datetime for Ecto: https://hexdocs.pm/ecto/Ecto.Schema.html#module-...
New
fireproofsocks
I’m working on defining a simple Ecto schema for a table (in PostGres), but I don’t see where I can define a column as NOT NULL. Conside...
New
hariharasudhan94
I would like to know what is the best IDE for elixir development?
New
chensan
I have a User schema with a :from_id field set to type :string: defmodule TweetBot.Repo.Migrations.CreateUsers do use Ecto.Migration ...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? https://hexdocs.pm/ecto/Ecto.Repo.h...
New
LegitStack
I’m trying to make a websocket server in Phoenix or raw Elixir. I heard about gun, I think I could use cowboy, but since I’m not that sma...
New
chrisalley
ExUnit now has describe blocks which is a welcome addition coming from RSpec. In the docs, it states that nested hierarchies of describe ...
New

Other popular topics Top

shahryarjb
Hello, I get Persian date from my client and convert it to normal calendar like this: def jalali_string_to_miladi_english_number(persi...
New
sorentwo
Hello! tl;dr Announcing Oban, an Ecto based job processing library with a focus on reliability and historical observability. After spen...
977 41022 311
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New
grych
Hi folks, Few months ago I have announced the proof-of-concept of the library to manipulate the browsers DOM objects directly from Elixi...
639 49522 488
New
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
alice
Hey, Just curious what are the main benefits of Elixir compared to Clojure? When is Elixir more useful than Clojure and vice versa? Th...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
Nvim
Elixir appears to be a superior language to Python. I don’t see any advantage of Python over Elixir. Are there any?
New
siddhant3030
Hi, I have to write a raw query for one of my project. But till now I have used ecto queries and don’t have much experience writing raw ...
New

We're in Beta

About us Mission Statement