Merge pull request #386 from thatHexa/master
Updated the language listing and fixed some typos
This commit is contained in:
@@ -4,6 +4,8 @@ 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
|
||||
```./genreadme.sh
|
||||
```bash
|
||||
./list_langs.py
|
||||
```
|
||||
for updating the list of languages in `README.md` (make sure you are in the repository's root directory when invoking those commands).
|
||||
for updating the list of languages in `README.md` (make sure you are in the repository's root directory when running the script).
|
||||
**NOTE THAT THIS SCRIPT MUST BE EXECUTED ON PYTHON 3.6+!** If your default isn't 3.6+, use `python3 list_langs.py`.
|
||||
|
||||
@@ -3,12 +3,12 @@ Hello, World!
|
||||
|
||||
Hello world in every programming language.
|
||||
|
||||
Inspired by [Helloworldcollection.de](http://helloworldcollection.de/)
|
||||
Inspired by [The Hello World Collection](https://helloworldcollection.github.io/)
|
||||
|
||||
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!
|
||||
|
||||
Make sure to see CONTRIBUTING.md for instructions on contributing to the project!
|
||||
|
||||
Spin-Off project smartly suggested and implemented by @zenware
|
||||
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)
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
#!/bin/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
|
||||
25
list_langs.py
Executable file
25
list_langs.py
Executable file
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env python
|
||||
|
||||
import os
|
||||
|
||||
readme = open('README.md', 'w')
|
||||
|
||||
# Copy template to README
|
||||
with open('README_nolist.md', 'r') as temp:
|
||||
for line in temp:
|
||||
readme.write(line)
|
||||
|
||||
# Write title
|
||||
readme.write('\n### This repository currently contains "Hello World" programs in the following languages:\n')
|
||||
|
||||
# List the available languages
|
||||
for dir in os.listdir('.'):
|
||||
if not (dir == '.' or dir == '..' or dir[0] == '.' or os.path.isfile(dir)):
|
||||
for file in os.listdir(dir):
|
||||
if os.path.isfile(f"{dir}/{file}"):
|
||||
lang = ''
|
||||
for str in file[0:(len(file) if file.find('.') == -1 else file.find('.'))].replace('-', ' ').replace('_', ' ').split():
|
||||
lang += str.capitalize() + ' '
|
||||
readme.write('* ' + lang[:-1] + '\n') # Cut trailing space
|
||||
|
||||
readme.close()
|
||||
@@ -1,13 +0,0 @@
|
||||
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("-", " ").gsub("_", " ").split(" ").each do |str|
|
||||
currdirname << str.capitalize + " "
|
||||
end
|
||||
currdirname.chomp(currdirname[-1])
|
||||
puts "* #{currdirname}"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user