José Valim <jose.va...@gmail.com> schrieb am Mo., 22. Jan. 2018 um 21:07 Uhr:
> My concern is that it is best if the documentation does not have the > ```elixir tags, since from context, it is expected that most code is > written in Elixir. The notation just adds noise. One should prefer to > indent by 4 spaces. > In my opinion, codeblocks by indentation should be removed from the MD spec at all, they are not unambigous. Sometimes I want to have distinct code blocks next to each other because they show different ways of implementing the same: def foo, do: 1 def foo do 1 end With indention based code blocks one can't tell if those blocks are meant to belong together or not, but with codefences this is easy: ```ex def foo, do: 1 ``` ```ex def foo do 1 end ``` Not only I can clearly mark beginning and end of each codeblock, I get a(n optional) language annotation for free. Of course, we do not need that annotation in elixirs documentation, as it will probably not contain (or at least very rarely contain) non exlir code. But if it does, its annotated and even better, it can be highlighted appropriately as soon as the necessary tools are available, just thinking about :makeup here… We could even embed meta comments in those fences, eg.: ```iex nodoctest This way we could provide consistent examples, that all look like they were straight from an iex session, but wouldn't have failing doctests because of missing context. Plenty of options, just by using fences… I do accept though, if you do not consider any of those for the future of elixir. > > On the other hand, formatting of the code indented by four spaces requires > partial implementation of a markdown processor and that sounds a bit > outside of the scope of the formatter. > > > > *José Valimwww.plataformatec.com.br > <http://www.plataformatec.com.br/>Founder and Director of R&D* > > On Mon, Jan 22, 2018 at 8:17 PM, Yordis Prieto <yordis.pri...@gmail.com> > wrote: > >> It would be nice if `mix format` could take into consideration the >> comments as well. >> >> Would parse for >> >> ```elixir >> >> ``` >> >> and then extract the code and format it >> >> What do you think about it >> >> -- >> 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+unsubscr...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/elixir-lang-core/a93b4c72-d749-479e-8fd0-48560f306615%40googlegroups.com >> <https://groups.google.com/d/msgid/elixir-lang-core/a93b4c72-d749-479e-8fd0-48560f306615%40googlegroups.com?utm_medium=email&utm_source=footer> >> . >> For more options, visit https://groups.google.com/d/optout. >> > > -- > 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+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LuSihA%3DNT43q5PVC2FBU7dH73tkDFNYPNsRbAGgEGYpA%40mail.gmail.com > <https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4LuSihA%3DNT43q5PVC2FBU7dH73tkDFNYPNsRbAGgEGYpA%40mail.gmail.com?utm_medium=email&utm_source=footer> > . > For more options, visit https://groups.google.com/d/optout. > -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/elixir-lang-core/CA%2BbCVsuyFwi5tOK9W3m7Ntxo_YbArrT2YTNm-EpWwCVYUdY8-Q%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.