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

Annotate modules visually when @moduledoc since: "..." is present #1755

Closed
whatyouhide opened this issue Aug 29, 2023 · 8 comments
Closed

Annotate modules visually when @moduledoc since: "..." is present #1755

whatyouhide opened this issue Aug 29, 2023 · 8 comments

Comments

@whatyouhide
Copy link
Member

whatyouhide commented Aug 29, 2023

We recently made @moduledoc since propagate to all the types, functions, and macros in the module (#1680), but I think it would be really nice to have the module itself annotated with this.

I was looking at PartitionSupervisor in Elixir, for example, and had to scroll through functions to know that all the functions were added in Elixir 1.14, which made me realize the whole module was added in Elixir 1.14. We can always annotate the module manually in the module-level doc (as I did in elixir-lang/elixir#12895), but I think visually showing the "since ...", like we do for functions and friends, could be nice for modules too.

There was discussion around this in #1680 itself and we opted for a simple solution (propagating), but I wanted to figure out if there is appetite for the full-fledged feature, if someone is willing to take on the visual work (I’m not good at that 😉), and so on 🙃

Worst case, we can close this out and it'll help folks read about this feature in this issue at least 😄

@viniciusmuller
Copy link
Contributor

I would like implementing this, but I'm not sure how this should look like :/
I did some experimentation locally but couldn't find a way that looks nice

  • maybe adding it on the right, but there's no background as opposed to the functions
  • maybe adding in a box below, similar to the deprecation message

@josevalim
Copy link
Member

I will go ahead and say no on this one because, we would still need to propagate it, as someone can still be linked directly to the function, so I am not that sure the additional information and clutter is worth it, given we propagate and refer to it on all entries too. :)

@josevalim josevalim closed this as not planned Won't fix, can't repro, duplicate, stale Sep 12, 2023
@whatyouhide
Copy link
Member Author

@josevalim mmm I disagree here, because:

I was looking at PartitionSupervisor in Elixir, for example, and had to scroll through functions to know that all the functions were added in Elixir 1.14, which made me realize the whole module was added in Elixir 1.14

I think this is a pretty big DX deal. Considering this feature is visually a really tiny addition, are we sure we want to let it go? 😬

@wojtekmach
Copy link
Member

wojtekmach commented Sep 13, 2023

I think it would be a nice addition and it looks good in this particular case. Here's a mockup:

image image

But it can get really busy:

image

so yeah not sure.

@whatyouhide
Copy link
Member Author

What about something like "This module is available since v..." as the first sentence of the module doc, styled slightly different?

@josevalim
Copy link
Member

Our goal is to move the search bar into the main page and, when we do so, we might move the cog icon, making it more or less cluttered, but I think right now is not the time for this. We can reevaluate in the future.

@whatyouhide
Copy link
Member Author

@josevalim maybe we can out a solution for this and then re-evaluate when we do the changes you just mentioned? Like, we go with the sentence at the start of the moduledoc to get the feature and info to users, and then re-evaluate. 🙃

@josevalim
Copy link
Member

We typically don't automatically add sentences. If that's a concern, then Elixir can add it directly to its docs. I would personally wait, there is no reason to rush and churn.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants