Skip to content
This repository has been archived by the owner on May 7, 2023. It is now read-only.

Commit

Permalink
hidden examples
Browse files Browse the repository at this point in the history
  • Loading branch information
rohitanwar committed Jan 21, 2018
1 parent a693a7b commit edcac1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
**Note**:- This is in no way affiliated with the original [30-seconds-of-code](https://github.com/Chalarangelo/30-seconds-of-code/).


## Table of Content
## Table of Contents
### :books: List

<details><summary>View contents</summary> <ul><li><a href = "#chunk"><code>chunk</code></a></li>
Expand Down Expand Up @@ -67,7 +67,7 @@ chunk([1,2,3,4,5],2) # [[1,2],[3,4],5]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### compact

Expand All @@ -93,7 +93,7 @@ compact([0, 1, False, 2, '', 3, 'a', 's', 34]) # [ 1, 2, 3, 'a', 's', 34 ]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### count_occurences

Expand Down Expand Up @@ -123,7 +123,7 @@ count_occurrences([1, 1, 2, 1, 2, 3], 1) # 3
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### deep_flatten

Expand Down Expand Up @@ -162,7 +162,7 @@ deep_flatten([1, [2], [[3], 4], 5]) # [1,2,3,4,5]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### difference

Expand All @@ -188,7 +188,7 @@ difference([1, 2, 3], [1, 2, 4]) # [3]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### shuffle

Expand Down Expand Up @@ -227,7 +227,7 @@ shuffle(foo) # [2,3,1] , foo = [1,2,3]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### spread

Expand Down Expand Up @@ -258,7 +258,7 @@ spread([1,2,3,[4,5,6],[7],8,9]) # [1,2,3,4,5,6,7,8,9]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### zip

Expand Down Expand Up @@ -294,7 +294,7 @@ zip(['a'], [1, 2], [True, False], fill_value = '_') # [['a', 1, True], ['_', 2,
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

## :scroll: String

Expand Down Expand Up @@ -326,7 +326,7 @@ count_vowels('gym') # 0
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

## :heavy_division_sign: Math

Expand Down Expand Up @@ -378,7 +378,7 @@ gcd(8,36) # 4
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### lcm

Expand Down Expand Up @@ -430,7 +430,7 @@ lcm([1, 3, 4], 5) # 60
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### max_n

Expand Down Expand Up @@ -463,7 +463,7 @@ max_n([1, 2, 3], 2) # [3,2]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>

### min_n

Expand Down Expand Up @@ -495,7 +495,7 @@ min_n([1, 2, 3], 2) # [1,2]
```
</details>

<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>
<br><a href = "#table-of-contents">:arrow_up: Back to top</a>


## Credits
Expand Down
4 changes: 2 additions & 2 deletions scripts/readme.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def tagger():
end = open("static-parts/readme-end.md").read()
toAppend = ''
tag_dict = tagger()
toAppend += '## Table of Content \n'
toAppend += '## Table of Contents \n'
for category in tag_dict:
toAppend = toAppend + '### ' + EMOJIS[category] + ' ' + title_case(category) +'\n\n<details><summary>View contents</summary> <ul>'
for snippet in tag_dict[category]:
Expand All @@ -49,5 +49,5 @@ def tagger():
someFile = open("snippets/" + snippet + '.md')
fileData = someFile.read()
codeParts = re.split(codeRe,fileData)
toAppend += codeParts[0] + f'```py{codeParts[1]} \n ```' +codeParts[2] + f'<details><summary>View Examples</summary>\n\n```py\n{codeParts[3]}\n```\n</details>\n\n<br><a href = "#table-of-contents">:arrow_up: Back To Top</a>\n ' + '\n'
toAppend += codeParts[0] + f'```py{codeParts[1]} \n ```' +codeParts[2] + f'<details><summary>View Examples</summary>\n\n```py\n{codeParts[3]}\n```\n</details>\n\n<br><a href = "#table-of-contents">:arrow_up: Back to top</a>\n ' + '\n'
open("README.md",'w').write(start+toAppend+'\n'+end)

0 comments on commit edcac1f

Please sign in to comment.