Permalink
Newer
100644
60 lines (38 sloc)
1.69 KB
|
da067aa
|
||
| 1 | ## Go by Example | |
|
19b98e7
|
||
| 2 | ||
|
1a871c9
|
||
| 3 | Content and build toolchain for [Go by Example](https://gobyexample.com), | |
|
d3d265b
|
||
| 4 | a site that teaches Go via annotated example programs. | |
|
44d4ed6
|
||
| 5 | ||
|
cc6cf63
|
||
| 6 | ||
|
c38a8df
|
||
| 7 | ### Overview | |
|
cc6cf63
|
||
| 8 | ||
|
1a871c9
|
||
| 9 | The Go by Example site is built by extracting code and | |
|
0c1a735
|
||
| 10 | comments from source files in `examples` and rendering | |
|
1a871c9
|
||
| 11 | them via the `templates` into a static `public` | |
| 12 | directory. The programs implementing this build process | |
| 13 | are in `tools`, along with some vendor'd dependencies | |
| 14 | in `vendor`. | |
|
c38a8df
|
||
| 15 | ||
|
1a871c9
|
||
| 16 | The built `public` directory can be served by any | |
| 17 | static content system. The production site uses S3 and | |
| 18 | CloudFront, for example. | |
|
c38a8df
|
||
| 19 | ||
| 20 | ||
|
0c1a735
|
||
| 21 | ### Building | |
|
07f8742
|
||
| 22 | ||
|
4d13040
|
||
| 23 | To build the site you'll need Go and Python installed. Run: | |
|
01e071b
|
||
| 24 | ||
|
44d4ed6
|
||
| 25 | ```console | |
|
780888b
|
||
| 26 | $ go get github.com/russross/blackfriday | |
|
f313b49
|
||
| 27 | $ tools/build | |
|
72b2276
|
||
| 28 | $ open public/index.html | |
|
c4f1cb5
|
||
| 29 | ``` | |
|
01e071b
|
||
| 30 | ||
|
bdadb40
|
||
| 31 | To build continuously in a loop: | |
| 32 | ||
| 33 | ```console | |
|
f313b49
|
||
| 34 | $ tools/build-loop | |
|
bdadb40
|
||
| 35 | ``` | |
| 36 | ||
|
da067aa
|
||
| 37 | ||
|
01e071b
|
||
| 38 | ### License | |
| 39 | ||
|
96e55fd
|
||
| 40 | This work is copyright Mark McGranaghan and licensed under a | |
| 41 | [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/). | |
| 42 | ||
|
572d7e3
|
||
| 43 | The Go Gopher is copyright [Renée French](http://reneefrench.blogspot.com/) and licensed under a | |
|
0c1a735
|
||
| 44 | [Creative Commons Attribution 3.0 Unported License](http://creativecommons.org/licenses/by/3.0/). | |
|
b13edb8
|
||
| 45 | ||
| 46 | ||
|
370a81f
|
||
| 47 | ### Translations | |
| 48 | ||
| 49 | Contributor translations of the Go by Example site are available in: | |
| 50 | ||
|
2a88bcc
|
||
| 51 | * [Chinese](http://gobyexample.everyx.in/) by [everyx](https://github.com/everyx) | |
|
d9e992f
|
||
| 52 | * [Spanish](http://goconejemplos.com) by the [Go Mexico community](https://github.com/dabit/gobyexample) | |
|
6bf518a
|
||
| 53 | * [Italian](http://gobyexample.it) by the [Golang Italian community](https://github.com/golangit/gobyexample-it) | |
|
370a81f
|
||
| 54 | ||
|
b13edb8
|
||
| 55 | ### Thanks | |
| 56 | ||
| 57 | Thanks to [Jeremy Ashkenas](https://github.com/jashkenas) | |
| 58 | for [Docco](http://jashkenas.github.com/docco/), which | |
| 59 | inspired this project. |