Skip to content

Commit

Permalink
Fix error in index script
Browse files Browse the repository at this point in the history
  • Loading branch information
righettod committed Jan 11, 2019
1 parent 201e15f commit 103d157
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Index.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**14** cheat sheets available.
**32** cheat sheets available.

*Icons beside the cheat sheet name indicate in which language(s) code snippet(s) are provided.*

Expand Down
4 changes: 3 additions & 1 deletion scripts/Update_CheatSheets_Index.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,21 @@ def extract_languages_snippet_provided(cheatsheet):

# Scan all CS files
index = {}
cs_count = 0
cheatsheets = [f.name for f in os.scandir("../cheatsheets") if f.is_file()]
for cheatsheet in cheatsheets:
letter = cheatsheet[0].upper()
if letter not in index:
index[letter] = [cheatsheet]
else:
index[letter].append(cheatsheet)
cs_count += 1
index = OrderedDict(sorted(index.items()))

# Generate the index file
with open("../Index.md", "w") as index_file:
index_count = len(index)
index_file.write(cs_count_template % index_count)
index_file.write(cs_count_template % cs_count)
index_file.write("\n\n*Icons beside the cheat sheet name indicate in which language(s) code snippet(s) are provided.*")
index_file.write("\n\n")
# Generate the top menu
Expand Down

0 comments on commit 103d157

Please sign in to comment.