CONTRIBUTING.md 8.2 KB
Newer Older
1
*Read this in other languages: [简体中文](CONTRIBUTING-zh.md)、[繁體中文](CONTRIBUTING-zh-TW.md)、[فارسی](CONTRIBUTING-fa_IR.md).*
bluetata's avatar
bluetata 已提交
2

3
## Contributor License Agreement
E
eric 已提交
4
By contributing you agree to the [LICENSE](https://github.com/EbookFoundation/free-programming-books/blob/master/LICENSE) of this repository.
5

6
## Contributor Code of Conduct
E
eric 已提交
7
By contributing you agree to respect the [Code of Conduct](https://github.com/EbookFoundation/free-programming-books/blob/master/CODE_OF_CONDUCT.md) of this repository.
8

V
Victor Felder 已提交
9
## In a nutshell
10
1. "A link to easily download a book" is not always a link to a *free* book. Please only contribute free content. Make sure it's free. We do not accept links to pages that *require* working email addresses to obtain books, but we welcome listings that request them.
bluetata's avatar
bluetata 已提交
11 12
2. You don't have to know Git: if you found something of interest which is *not already in this repo*, please open an [Issue](https://github.com/EbookFoundation/free-programming-books/issues) with your links propositions.
    - If you know Git, please Fork the repo and send pull requests.
13
3. We have 5 kinds of lists. Choose the right one:
V
victor felder 已提交
14

V
Victor Felder 已提交
15
    - *Books* : PDF, HTML, ePub, a gitbook.io based site, a Git repo, etc.
E
eshellman 已提交
16
    - *Courses* : A course is a learning material which is not a book. [This is a course](http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-006-introduction-to-algorithms-fall-2011/).
V
Victor Felder 已提交
17
    - *Interactive Tutorials* : An interactive website which lets the user type code or commands and evaluates the result (by "evaluate" we don't mean "grade"). e.g.: [Try Haskell](http://tryhaskell.org), [Try Github](http://try.github.io).
E
eshellman 已提交
18
    - *Podcasts and Screencasts* : Podcasts and screencasts.
V
Victor Felder 已提交
19
    - *Problem Sets & Competitive Programming* : A website or software which lets you assess your programming skills by solving simple or complex problems, with or without code review, with or without comparing the results with other users.
20

bluetata's avatar
bluetata 已提交
21
4. Make sure to follow the [guidelines below](#guidelines) and respect the [Markdown formatting](#formatting) of the files.
22

E
eshellman 已提交
23 24
5. Travis CI will run tests to make sure your lists are alphabetized and formatting rules are followed. Be sure to check that your changes pass the tests.

V
Victor Felder 已提交
25
### Guidelines
E
eshellman 已提交
26
- make sure a book is free. Double-check if needed. It helps the admins if you comment in the PR as to why you think the book is free.
27
- we don't accept files hosted on google drive, dropbox, mega, scribd, issuu and other similar file upload platforms
28 29
- insert your links in alphabetical order. If you see a misplaced link, please reorder it and submit a PR
- use the link with the most authoritative source (meaning author's website is better than editor's website is better than third party website)
V
Victor Felder 已提交
30
    + no file hosting services (this includes (but is not limited to) Dropbox and Google Drive links)
31 32 33 34 35 36 37 38 39 40 41 42
- always prefer a `https` link over a `http` one -- as long as they are on the same domain and serve the same content
- on root domains, strip the trailing slash: `http://example.com` instead of `http://example.com/`
- always prefer the shortest link: `http://example.com/dir/` is better than `http://example.com/dir/index.html`
    + no URL shortener links
- usually prefer the "current" link over the "version" one: `http://example.com/dir/book/current/` is better than `http://example.com/dir/book/v1.0.0/index.html`
- if a link has an expired certificate/self-signed certificate/SSL issue of any other kind:
  1. *replace it* with its `http` counterpart if possible (because accepting exceptions can be complicated on mobile devices)
  2. *leave it* if no `http` version but link still accessible through `https` by adding an exception to the browser or ignoring the warning
  3. *remove it* otherwise
- if a link exists in multiple format, add a separate link with a note about each format
- if a resource exists at different places on the Internet
    + use the link with the most authoritative source (meaning author's website is better than editor's website is better than third party website)
43
    + if they link to different editions and you judge these editions are different enough to be worth keeping them, add a separate link with a note about each edition (see [Issue #2353](https://github.com/EbookFoundation/free-programming-books/issues/2353) to contribute to the discussion on formatting.)
44
- prefer atomic commits (one commit by addition/deletion/modification) over bigger commits. No need to squash your commits before submitting a PR. (We will never enforce this rule as it's just a matter of convenience for the maintainers)
bluetata's avatar
bluetata 已提交
45
- if the book is older, include the publication date with the title.
E
eshellman 已提交
46
- include the author name or names where appropriate. You can shorten author lists with "et al."
47
- if the book is not finished, and is still being worked on, add the "in process" notation, as described [below.](#in_process)
48
- if an email address or account setup is requested before download is enabled, add language-appropriate notes in parentheses, e.g.: `(email address *requested*, not required)`
49 50

### Formatting
V
Victor Felder 已提交
51
- All lists are `.md` files. Try to learn [Markdown](https://guides.github.com/features/mastering-markdown/) syntax. It's simple!
52 53
- All the lists start with an Index. The idea is to list and link all sections and subsections there. Keep it in alphabetical order.
- Sections are using level 3 headings (`###`), and subsections are level 4 headings (`####`).
54 55

The idea is to have
56 57 58 59 60 61
- `2` empty lines between last link and new section
- `1` empty line between heading & first link of its section
- `0` empty line between two links
- `1` empty line at the end of each `.md` file

Example:
62

63
    [...]
V
Victor Felder 已提交
64
    * [An Awesome Book](http://example.com/example.html)
V
Victor Felder 已提交
65 66
                                    (blank line)
                                    (blank line)
V
Victor Felder 已提交
67
    ### Example
V
Victor Felder 已提交
68
                                    (blank line)
V
Victor Felder 已提交
69 70
    * [Another Awesome Book](http://example.com/book.html)
    * [Some Other Book](http://example.com/other.html)
71

bluetata's avatar
bluetata 已提交
72
- Don't put spaces between `]` and `(`:
V
victor felder 已提交
73

V
Victor Felder 已提交
74 75 76 77
```
BAD : * [Another Awesome Book] (http://example.com/book.html)
GOOD: * [Another Awesome Book](http://example.com/book.html)
```
78

bluetata's avatar
bluetata 已提交
79
- If you include the author, use ` - ` (a dash surrounded by single spaces):
80

V
Victor Felder 已提交
81
```
V
Victor Felder 已提交
82 83
BAD : * [Another Awesome Book](http://example.com/book.html)- John Doe
GOOD: * [Another Awesome Book](http://example.com/book.html) - John Doe
V
Victor Felder 已提交
84
```
85

bluetata's avatar
bluetata 已提交
86
- Put a single space between the link and its format:
87

V
Victor Felder 已提交
88
```
89 90
BAD : * [A Very Awesome Book](https://example.org/book.pdf)(PDF)
GOOD: * [A Very Awesome Book](https://example.org/book.pdf) (PDF)
V
Victor Felder 已提交
91
```
92

V
Victor Felder 已提交
93
- Author comes before format:
94

V
Victor Felder 已提交
95
```
bluetata's avatar
bluetata 已提交
96
BAD : * [A Very Awesome Book](https://example.org/book.pdf)- (PDF) Jane Roe
97
GOOD: * [A Very Awesome Book](https://example.org/book.pdf) - Jane Roe (PDF)
V
Victor Felder 已提交
98
```
99 100 101 102 103 104 105 106

- Multiple formats:

```
BAD : * [Another Awesome Book](http://example.com/)- John Doe (HTML)
BAD : * [Another Awesome Book](https://downloads.example.org/book.html)- John Doe (download site)
GOOD: * [Another Awesome Book](http://example.com/) - John Doe (HTML) [(PDF, EPUB)](https://downloads.example.org/book.html)
```
E
eshellman 已提交
107 108 109 110

- Include publication year in title for older books:

```
bluetata's avatar
bluetata 已提交
111
BAD : * [A Very Awesome Book](https://example.org/book.html) - Jane Roe - 1970
112 113 114 115
GOOD: * [A Very Awesome Book (1970)](https://example.org/book.html) - Jane Roe
```

<a name="in_process"></a>
bluetata's avatar
bluetata 已提交
116
- In-process books:
117 118 119

```
GOOD: * [Will Be Awesome Soon Book](http://example.com/book2.html) - John Doe (HTML) (:construction: *in process*)
E
eshellman 已提交
120
```
B
borgified 已提交
121 122 123 124 125 126 127 128 129 130 131 132

### Automation
- Formatting rules enforcement is automated via [Travis CI](https://travis-ci.com) using [fpb-lint](https://github.com/vhf/free-programming-books-lint) (see [.travis.yml](.travis.yml))
- URL validation uses [awesome_bot](https://github.com/dkhamsing/awesome_bot)
- To trigger URL validation, push a commit that includes a commit message containing `check_urls=file_to_check`:

```
check_urls=free-programming-books.md free-programming-books-en.md
```

- You may specify more than one file to check, using a single space to separate each entry.
- If you specify more than one file, results of the build is based on the result of the last file checked. You should be aware that you may get passing green builds due to this so be sure to inspect the build log at the end of the pull request by clicking on "Show all checks" -> "Details".