mix.exs: ExDoc vs Hex.PM's approach to reading the :name field

55 views
Skip to first unread message

w.m.w...@student.rug.nl

unread,
Apr 17, 2017, 11:30:28 AM4/17/17
to elixir-lang-core
Recently I found out that ExDoc allows specifying a `:name` field inside the `project` implementation that is part of the `mix.exs` file, which will be used in the generated documentation.

Interestingly, Hex uses a name that is part of the `:package` subfield.



Having two separate locations to specify the (humanly readable) name seems odd.

As these are two external packages but both closely related to elixir's core ecosystem, I thought it most appropriate to discuss about this issue here.


Ideas to conventionalize:

1. project.name is used by ExDoc, Hex and other packages that might consume a humanly readable version of the project's name. project.package.name overrides project.name for Hex.

2. project.name is used by ExDoc, Hex and other packages that might consume a humanly readable version of the project's name. project.package.name overrides project.name for Hex. project.docs.name overrides project.name for ExDoc.

3. project.name is the proper way. project.package.name is considered deprecated.


What to do?

~Qqwy

José Valim

unread,
Apr 18, 2017, 5:58:18 AM4/18/17
to elixir-l...@googlegroups.com
The reason we moved :name up to project.name is exactly so it can be used by multiple entities such as Hex and ExDoc. So my suggestion is to read the :name from the root if project.package.name is not available.



José Valim
Skype: jv.ptec
Founder and Director of R&D

--
You received this message because you are subscribed to the Google Groups "elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elixir-lang-core+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/11585076-b9ca-48c6-bd5e-ed1eae50cae7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Meadows-Jönsson

unread,
Apr 19, 2017, 12:19:56 PM4/19/17
to elixir-l...@googlegroups.com
Hex should follow ExDoc's convention and use `project.name` if `project.package.name` is not set. A great area for contribution :)


For more options, visit https://groups.google.com/d/optout.



--
Eric Meadows-Jönsson

w.m.w...@student.rug.nl

unread,
Apr 25, 2017, 3:25:48 AM4/25/17
to elixir-lang-core
Thank you, José and Eric!

For posterity, an issue for this was made on the Hex github repository: https://github.com/hexpm/hex/issues/364
Reply all
Reply to author
Forward
0 new messages