elixir-cldr / cldr_trans

Cldr-based fork of the most excellent "trans" library
Other
10 stars 3 forks source link

Filter generated modules from docs #9

Closed ArthurClemens closed 9 months ago

ArthurClemens commented 9 months ago

My doc files get polluted with generated Translations and Translations.Fields over which I don't have any control. Adding @moduledoc false would solve this problem.

kipcole9 commented 9 months ago

Good suggestion, done! I'll publish a new release in the next hour.

kipcole9 commented 9 months ago

I've published ex_cldr_trans version 1.1.1 with the following changelog entry:

Bug Fixes

Enhancements

ArthurClemens commented 9 months ago

The problem is not solved completely: I still get doc files for MyApp.MyModule.Translations.

kipcole9 commented 9 months ago

Oh, I should have mentioned that use of generate_docs: false on your CLDR backend. Something like:

defmodule MyApp.Cldr do
  use Cldr,
    locales: [.....],
    default_locale: "en",
    generate_docs: false

end

Can you give that a try and report back?

ArthurClemens commented 9 months ago

generate_docs: false removes almost all of the Cldr documentation files, but still generates those X.Translations files. I also get doc warnings such as documentation references function "Elixir.MyApp.Cldr.get_locale/0" but it is hidden. Having Cldr docs is fine for me, but those empty X.Translations doc files don't bring any value.

kipcole9 commented 9 months ago

Thanks for your patience. It took me a long time to work out that Ecto is generating that module based upon the way the embedded schema is defined and I currently I have no way to @moduledoc false on it.

I can define the embedded schema a different way and add @moduledoc false but it's getting late where I am so I will do that in the morning.

kipcole9 commented 9 months ago

I have published ex_cldr_trans version 1.1.2 with the following changelog entry. I believe this now means that no docs are generated for the generated modules (Translations and Translations.Fields).

Bug Fixes

ArthurClemens commented 9 months ago

Thanks!