Skip to content

Commit 4cdf870

Browse files
authored
Merge pull request #1 from vinta/master
拉取最新内容
2 parents d3c37eb + 9aadfc7 commit 4cdf870

File tree

10 files changed

+1179
-886
lines changed

10 files changed

+1179
-886
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
## What is this Python project?
2+
3+
Describe features.
4+
5+
## What's the difference between this Python project and similar ones?
6+
7+
Enumerate comparisons.
8+
9+
--
10+
11+
Anyone who agrees with this pull request could vote for it by adding a :+1: to it, and usually, the maintainer will merge it when votes reach **20**.

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
11
.DS_Store
2+
23
*.py[co]
4+
5+
docs/index.md
6+
site/

.travis.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
language: ruby
2+
3+
rvm:
4+
- 2.2
5+
6+
before_script:
7+
- gem install awesome_bot
8+
9+
script:
10+
- awesome_bot README.md --allow-dupe --white-list pyparsing,graphviz.org

CONTRIBUTING.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@ Your contributions are always welcome!
44

55
## Guidelines
66

7-
* Add section if needed.
8-
* Add section description.
9-
* Add section title to Table of contents.
7+
* Add one link per Pull Request.
8+
* Add the link: `* [project-name](http://example.com/) - A short description ends with a period.`
9+
* Keep descriptions concise.
10+
* Add a section if needed.
11+
* Add the section description.
12+
* Add the section title to Table of Contents.
1013
* Search previous suggestions before making a new one, as yours may be a duplicate.
11-
* Add your links: `* [project-name](http://example.com/) - A short description ends with a dot.`
1214
* Don't mention `Python` in the description as it's implied.
1315
* Check your spelling and grammar.
14-
* Make sure your text editor is set to remove trailing whitespace.
15-
* Send a Pull Request.
16+
* Remove any trailing whitespace.
17+
* Send a Pull Request with the reason why the library is awesome.

Makefile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
BASEDIR=$(CURDIR)
2+
DOCDIR=$(BASEDIR)/docs
3+
4+
install:
5+
pip install mkdocs==0.16.3
6+
pip install mkdocs-material==1.12.2
7+
8+
link:
9+
ln -sf $(BASEDIR)/README.md $(DOCDIR)/index.md
10+
11+
preview: link
12+
mkdocs serve
13+
14+
deploy: link
15+
mkdocs gh-deploy --clean

README.md

Lines changed: 1038 additions & 880 deletions
Large diffs are not rendered by default.

docs/CNAME

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
awesome-python.com

docs/extra.css

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
.bs-sidebar.well {
2+
/* margin-bottom: 0; */
3+
}
4+
5+
.bs-sidebar .nav > li > a:hover,
6+
.bs-sidebar .nav > li > a:focus {
7+
border: none;
8+
border-left: 2px solid;
9+
}
10+
11+
.bs-sidebar .nav > .active > a,
12+
.bs-sidebar .nav > .active:hover > a,
13+
.bs-sidebar .nav > .active:focus > a {
14+
border: none;
15+
border-left: 2px solid;
16+
}
17+
18+
@media (min-width: 992px) {
19+
.bs-sidebar.affix {
20+
/* top: 60px; */
21+
/* bottom: 0px; */
22+
top: 80px;
23+
bottom: 23px;
24+
overflow: auto;
25+
}
26+
}
27+
28+
@media (min-width: 1200px) {
29+
.bs-sidebar.affix-bottom,
30+
.bs-sidebar.affix {
31+
width: 280px;
32+
}
33+
34+
.container > .col-md-9 {
35+
padding-left: 40px;
36+
}
37+
}

mkdocs.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
site_name: 'Awesome Python'
2+
site_url: 'https://awesome-python.com'
3+
site_description: 'A curated list of awesome Python frameworks, libraries and software'
4+
site_author: 'Vinta Chen'
5+
repo_name: 'vinta/awesome-python'
6+
repo_url: 'https://github.com/vinta/awesome-python'
7+
theme: 'material'
8+
extra:
9+
feature:
10+
tabs: false
11+
palette:
12+
primary: 'red'
13+
accent: 'pink'
14+
social:
15+
- type: 'github'
16+
link: 'https://github.com/vinta'
17+
- type: 'twitter'
18+
link: 'https://twitter.com/vinta'
19+
- type: 'linkedin'
20+
link: 'https://www.linkedin.com/in/vinta'
21+
google_analytics:
22+
- 'UA-510626-7'
23+
- 'auto'
24+
pages:
25+
- "Life is short, you need Python.": "index.md"

sort.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,33 @@
1313
and flattening the end structure into a list of lines. Revision 2 maybe ^.^.
1414
"""
1515

16+
def sort_blocks():
17+
# First, we load the current README into memory
18+
with open('README.md', 'r') as read_me_file:
19+
read_me = read_me_file.read()
20+
21+
# Separating the 'table of contents' from the contents (blocks)
22+
table_of_contents = ''.join(read_me.split('- - -')[0])
23+
blocks = ''.join(read_me.split('- - -')[1]).split('\n# ')
24+
for i in range(len(blocks)):
25+
if i == 0:
26+
blocks[i] = blocks[i] + '\n'
27+
else:
28+
blocks[i] = '# ' + blocks[i] + '\n'
29+
30+
# Sorting the libraries
31+
inner_blocks = sorted(blocks[0].split('##'))
32+
for i in range(1 , len(inner_blocks)):
33+
if inner_blocks[i][0] != '#':
34+
inner_blocks[i] = '##' + inner_blocks[i]
35+
inner_blocks=''.join(inner_blocks)
36+
37+
# Replacing the non-sorted libraries by the sorted ones and gathering all at the final_README file
38+
blocks[0] = inner_blocks
39+
final_README = table_of_contents + '- - -' + ''.join(blocks)
40+
41+
with open('README.md', 'w+') as sorted_file:
42+
sorted_file.write(final_README)
1643

1744
def main():
1845
# First, we load the current README into memory as an array of lines
@@ -45,6 +72,9 @@ def main():
4572
# And the result is written back to README.md
4673
sorted_file.write(''.join(blocks))
4774

75+
# Then we call the sorting method
76+
sort_blocks()
77+
4878

4979
if __name__ == "__main__":
5080
main()

0 commit comments

Comments
 (0)