Skip to content

Commit

Permalink
Merge pull request #374 from thatHexa/master
Browse files Browse the repository at this point in the history
Automatic language listing & CONTRIBUTING.md
  • Loading branch information
leachim6 committed Feb 12, 2017
2 parents 1183727 + 68aaa83 commit 510f849
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Contributing
============

When adding new "Hello World" programs, please name the file according to the language it was written in, don't abbreviate the language name too much (so use "JavaScript", not "JS") but don't make it TOO long (so use "CSS" not "Cascading Style Sheets". Use hyphens ("-") as word seperators, and only use a single dot (for seperating the filename from the extension). For exmaple, a "Hello World" program in Objective C should be named "Objective-C.m, and the one in HTML should be named HTML.html.

Use
```bash
cat README_nolist.md > README.md; echo >> README.md; echo "### This repository currently contains "Hello World" programs in the following languages:" >> README.md; ruby list_langs.rb >> README.md
```
for updating the list of languages in `README.md` (make sure you are in the repository's root directory when invoking those commands).
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@ Hello, World!

Hello world in every programming language.

Inspired by[Helloworldcollection.de](http://helloworldcollection.de/)
Inspired by [Helloworldcollection.de](http://helloworldcollection.de/)

As I watch the collection expand, this project has blown up more than I ever thought possible.
Thanks to everyone who continues to contribute, new languages are created every day!


Spin-Off project smartly suggested and implemented by @zenware
Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-world](https://github.com/leachim6/hello-world)
12 changes: 12 additions & 0 deletions README_nolist.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Hello, World!
=============

Hello world in every programming language.

Inspired by [Helloworldcollection.de](http://helloworldcollection.de/)

As I watch the collection expand, this project has blown up more than I ever thought possible.
Thanks to everyone who continues to contribute, new languages are created every day!

Spin-Off project smartly suggested and implemented by @zenware
Meet [FizzBuzz](https://github.com/zenware/FizzBuzz) the evolution of [hello-world](https://github.com/leachim6/hello-world)
13 changes: 13 additions & 0 deletions list_langs.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Dir.foreach "." do |odir|
next if odir == "." or odir == ".." or not File.directory?(odir)
Dir.foreach odir do |dir|
next if dir == "." or dir == ".."
currdirname = ""
dir.split(".")[0].gsub("-", " ").split(" ").each do |str|
currdirname << str.capitalize + " "
end
currdirname.chomp(currdirname[-1])
puts "* #{currdirname}"
end
end

0 comments on commit 510f849

Please sign in to comment.