style-guide.md (2164B)
1 # Style Guide 2 3 Having a style guide is great for having consistency. 4 5 6 ## Elixir 7 8 For Elixir (`.ex`) or Elixir script files (`.exs`), follow these guide lines: 9 10 * Keep line lengths at about 80 lines, not a hard rule. 11 * Use Unix line endings and make sure you have a <newline> character at the end 12 of the file (any decent editor will already do that). 13 * Use tabs for indentation, spaces for aligment. 14 * Don't indent the top-level code in modules and avoid nesting modules. 15 * Use trailing commas in multi-line lists, maps, functions, etc. wherever 16 possible. 17 * Prefer exclicit `do ... end` syntax over `, do: ...` syntax. 18 19 20 ## Markdown 21 22 For Markdown files (`.md`), follow these guide lines: 23 24 * Keep lines lengths at most 80 lines (unless it is in a code block, then it is 25 not a hard rule). 26 * Capitalize first letters of all the titles (except for words like and, or, of, 27 etc.) 28 * Separate all titles from each other with two blank lines. 29 * Separate a title from the immediate paragraph by a blank line. 30 * Separate a list from the before and after paragraph by a blank line. 31 * Separate a code block (not inline) from the before and after paragraph by a 32 blank line. 33 * Aling the lines breaked from a list line like this: 34 35 ``` 36 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 37 tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 38 quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 39 40 1. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 41 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad 42 minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 43 44 2. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do 45 eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad 46 minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex 47 48 * Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod 49 tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, 50 quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo 51 ```