Mix Proposal: Change the 'installation' part in the generated README.md to start/end on separate lines

34 views
Skip to first unread message

Wiebe-Marten Wijnja

unread,
Jul 8, 2016, 2:14:02 PM7/8/16
to elixir-lang-core
When you create a new project using Mix, it generates a standard README.md, which is really useful if you upload the project to an open source Git(Hub) repository.

It looks like this:

# ProjectName

**TODO: Add description**

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:

  1. Add `project_name` to your list of dependencies in `mix.exs`:

    ```elixir
    def deps do
      [{:project_name, "~> 0.1.0"}]
    end
    ```

  2. Ensure `project_name` is started before your application:

    ```elixir
    def application do
      [applications: [:project_name]]
    end
    ```


I would like to propose that this autogenerated readme be altered slightly, to:

# ProjectName

**TODO: Add description**

## Installation

If [available in Hex](https://hex.pm/docs/publish), the package can be installed as:

  1. Add `project_name` to your list of dependencies in `mix.exs`:

    ```elixir
    def deps do
      [
        {:project_name, "~> 0.1.0"}
      ]
    end
    ```

  2. Ensure `project_name` is started before your application:

    ```elixir
    def application do
      [applications: [:project_name]]
    end
    ```


This would make it easier to copy the dependency tuple.

We might want to also change the generated mix.exs, so its dependency list also starts and ends on separate lines (possibly with a comment in-between), to make it easier to add dependencies, and gently push developers to adding new dependencies on separate lines, which would improve readability:

  defp deps do
    [
      # add dependencies here
    ]
  end


Sincerely,

~Wiebe-Marten Wijnja

José Valim

unread,
Jul 8, 2016, 2:22:50 PM7/8/16
to elixir-l...@googlegroups.com
We should keep it according to the standard and recommended way of indenting data structures in Elixir today, which is the format currently generated by the README.



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-co...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/c50ae0b2-c476-4dc3-b10b-1fec6771d326%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Henrik N

unread,
Jul 9, 2016, 3:46:24 AM7/9/16
to elixir-lang-core
Wiebe-Marten,

You're not alone: I've suggested basically the same thing: https://github.com/phoenixframework/phoenix/pull/1007

I think it would be interesting to discuss the merits of the formats, beyond keeping a convention because it's the current convention, but I suspect this doesn't register as a pain point to the core team. (Which is completely reasonable. People are different.)

Sean Tan

unread,
Jul 10, 2016, 10:47:41 PM7/10/16
to elixir-lang-core
This is actually the very first thing I do when I generate a new Elixir/Phoenix project, putting things onto their own lines such that individual changes can be better tracked with git.
Reply all
Reply to author
Forward
0 new messages