OLD | NEW |
---|---|
1 This is the server that will be used on `pub.dartlang.org` as the default | 1 This is the server that will be used on `pub.dartlang.org` as the default |
2 package repository for the Pub package manager. | 2 package repository for the Pub package manager. |
3 | 3 |
4 For license information, please see LICENSE. | 4 For license information, please see [LICENSE](LICENSE). |
5 | 5 |
6 ### Repository Structure | 6 ## Repository structure |
7 | 7 |
8 pub_dartlang.py» The entry point for running the app. | 8 ┐ |
9 app.yaml» » App Engine configuration. | 9 ├───┬ app/ The app engine app. |
10 third_party/» External dependencies, included in the repo so that App | 10 │ ├───┬ doc/ Documentation and articles. |
Bob Nystrom
2013/11/26 19:00:11
"Source markdown for documentation"
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
11 » » » Engine will see them. | 11 │ │ └─... |
12 handlers/» » Code that handles HTTP requests. | 12 │ ├───┬ handlers/ Core web server code. |
13 models/» » Models for persisting data to the App Engine Datastore. | 13 │ │ └─... |
14 views/» » Mustache templates. | 14 │ ├───┬ models/ Models for persisting data to the datastore. |
15 │ │ └─... | |
16 │ ├───┬ static/ Static assets. | |
17 │ │ ├───┬ img/ | |
18 │ │ │ └─... | |
19 │ │ ├───┬ js/ | |
20 │ │ │ └─... | |
21 │ │ ├──── favicon.ico | |
22 │ │ └──── style.css Generated stylesheet. Modify /stylesheets/styl e.scss instead. | |
Bob Nystrom
2013/11/26 19:00:11
Long line, here and below.
nweiz
2013/11/27 00:58:59
I think long lines in code blocks are reasonable i
Andrei Mouravski
2013/11/29 21:21:21
Ack.
Andrei Mouravski
2013/11/29 21:21:21
Ack.
| |
23 │ │ | |
24 │ ├───┬ views/ Mustache templates. | |
25 │ │ ├───┬ doc/ Generated HTML. Modify /app/doc/ files instead . | |
Bob Nystrom
2013/11/26 19:00:11
Ditto.
Andrei Mouravski
2013/11/29 21:21:21
Ack.
| |
26 │ │ │ └─... | |
27 │ │ └─... | |
28 │ ├──── app.yaml AppEngine configuration. | |
29 │ ├──── appengine_config.py Python module configuration. | |
30 │ ├──── pub_dartlang.py Entrypoint for app. Use dev_appserver.py to ru n. | |
31 │ └─... | |
32 │ | |
33 ├───┬ stylesheets/ | |
34 │ └───┬ partials/ | |
35 │ ├──── _syntax.scss Dart language syntax styles. | |
Bob Nystrom
2013/11/26 19:00:11
Technically, this applies to other languages too,
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
36 │ ├──── _variables.scss Variables for theming. | |
37 │ └ style.scss Main stylesheet. | |
38 │ | |
39 ├───┬ test/ Tests for app functionality. | |
40 │ └──── ... | |
41 │ | |
42 ├───┬ third_party/ External dependencies to be include in the app . | |
Bob Nystrom
2013/11/26 19:00:11
"to be include in" -> "used by"
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
43 │ └──── ... | |
44 │ | |
45 ├──── _config.yml Jekyll configuration. | |
46 ├──── Procfile Process to be run with Foreman. | |
47 ├──── test.py Tests the app. | |
Bob Nystrom
2013/11/26 19:00:11
"Runs all tests."
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
48 ├──── config.rb Compass configuration. | |
49 └──── ... | |
15 | 50 |
16 test.py» » The entry point for testing the app. | 51 ## Running the server locally |
17 tests/» » Code for testing the app. | |
18 | 52 |
19 ### Running the Server Locally | 53 **tl;dr:** Run the app with ```dev_appserver.py app```. |
20 | 54 |
55 ### Prerequisites | |
nweiz
2013/11/27 00:58:59
Nit: newline after this.
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
21 The server is written in Python and intended to run on Google App Engine. To run | 56 The server is written in Python and intended to run on Google App Engine. To run |
22 it locally, perform the following steps: | 57 it locally, perform the following steps: |
23 | 58 |
24 * Install the [App Engine SDK][] for Python. | 59 1. Install the [App Engine SDK][] for Python. |
25 * Make sure the SDK is on your `$PATH`.<sup>1</sup> | 60 * Make sure the SDK is on your `$PATH`.<sup>1</sup> |
26 * Install required packages.<sup>2</sup> | 61 * Install required packages.<sup>2</sup> |
Bob Nystrom
2013/11/26 19:00:11
Convert the other bullets to numeric too.
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
27 | 62 |
28 pip install beautifulsoup4 pycrypto webtest | 63 pip install beautifulsoup4 pycrypto webtest |
29 | 64 |
65 [app engine sdk]: https://developers.google.com/appengine/downloads | |
66 | |
67 ### Running server | |
nweiz
2013/11/27 00:58:59
Nit: "Running the server"
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
68 | |
30 * From the root directory of this repository, run: | 69 * From the root directory of this repository, run: |
31 | 70 |
32 dev_appserver.py app | 71 dev_appserver.py app |
33 | 72 |
34 [app engine sdk]: https://developers.google.com/appengine/downloads | |
35 | |
36 * Open your browser to <http://localhost:8080/> to see that it works. | 73 * Open your browser to <http://localhost:8080/> to see that it works. |
37 | 74 |
38 * To run tests: | 75 ### Running tests |
76 | |
77 * To run tests, run: | |
39 | 78 |
40 ./test.py | 79 ./test.py |
41 | 80 |
81 ### Publishing packages locally | |
82 | |
42 * To publish packages to your local test server, visit <http://localhost:8080/ admin> | 83 * To publish packages to your local test server, visit <http://localhost:8080/ admin> |
43 (sign in as administrator), go to the "Private Key" tab & enter any string | 84 (sign in as administrator), go to the "Private Key" tab & enter any string |
44 into the private key field. | 85 into the private key field. |
45 | 86 |
46 <sup>1</sup> This might have been done already if you allowed the Google App | 87 <sup>1</sup> This might have been done already if you allowed the Google App |
47 Engine launcher to add symbolic links to your `$PATH`. | 88 Engine launcher to add symbolic links to your `$PATH`. |
48 | 89 |
49 <sup>2</sup> On installing packages: | 90 <sup>2</sup> On installing packages: |
91 | |
50 * Beautiful Soup & WebTest are only required for running tests. | 92 * Beautiful Soup & WebTest are only required for running tests. |
51 * Some Linux distributions come with PyCrypto installed by default. Make sure | 93 * Some Linux distributions come with PyCrypto installed by default. Make sure |
52 at least version 2.6 installed. | 94 at least version 2.6 installed. |
53 * If using Mac and `pip` is not available, install [brew](http://brew.sh) and | 95 * If using Mac and `pip` is not available, install [brew](http://brew.sh) and |
54 run `brew install python`. | 96 run `brew install python`. |
55 | 97 |
56 ### Deploying | 98 ## Deploying to the web |
Bob Nystrom
2013/11/26 19:00:11
"the web" -> "production"
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
57 | 99 |
58 See the docs on [branches and versions][]. | 100 See the docs on [branches and versions][]. |
59 | 101 |
60 [branches and versions]: https://github.com/dart-lang/pub-dartlang/wiki/Branches -and-Versions | 102 [branches and versions]: https://github.com/dart-lang/pub-dartlang/wiki/Branches -and-Versions |
61 | 103 |
62 ### Modifying the CSS and Documentation | 104 ## Modifying the CSS and documentation |
63 | 105 |
64 The CSS files are generated from the source [Sass][] files using [Compass][]. | 106 * The [CSS files](app/static/style.css) are generated from the source [Sass][] f iles using [Compass][]. |
65 The HTML documentation files are generated from the source [Markdown][] using | 107 |
66 [Jekyll][]. To get ready to make changes, you'll need [Ruby][] and [Python][]. | 108 * The [HTML documentation files](app/views/doc/) are generated from the source [ Markdown][] using |
109 [Jekyll][]. | |
Bob Nystrom
2013/11/26 19:00:11
Long lines.
Andrei Mouravski
2013/11/29 21:21:21
Done.
| |
110 | |
111 To get ready to make changes, you'll need [Ruby][] and [Python][]. | |
67 Then: | 112 Then: |
68 | 113 |
69 [ruby]: http://ruby-lang.org | 114 [ruby]: http://ruby-lang.org |
70 [python]: http://python.org | 115 [python]: http://python.org |
71 [sass]: http://sass-lang.com | 116 [sass]: http://sass-lang.com |
72 [compass]: http://compass-style.org | 117 [compass]: http://compass-style.org |
73 [markdown]: http://daringfireball.net/projects/markdown/ | 118 [markdown]: http://daringfireball.net/projects/markdown/ |
74 [jekyll]: http://jekyllrb.com/ | 119 [jekyll]: http://jekyllrb.com/ |
75 | 120 |
76 1. Ensure you have bundler installed: | 121 1. Ensure you have bundler installed: |
77 | 122 |
78 gem install bundler | 123 gem install bundler |
79 | 124 |
80 2. Run this to install the dependencies: | 125 2. Run this to install the dependencies: |
81 | 126 |
82 bundle install | 127 bundle install |
83 | 128 |
84 3. Run this to install the latest version of Pygments for syntax highlighting: | 129 3. Run this to install the latest version of Pygments for syntax highlighting: |
85 | 130 |
86 sudo pip install --upgrade pygments | 131 sudo pip install --upgrade pygments |
87 | 132 |
88 Note that this is only needed on your development machine to iterate on the CSS | 133 This is only needed on your development machine to iterate on the CSS |
89 and documentation. The deployed server just uses the pre-compiled CSS and HTML | 134 and documentation. The deployed server just uses the pre-compiled CSS and HTML |
90 and only requires Python. | 135 and only requires Python. |
91 | 136 |
92 Once you have everything installed, to modify the styles and documentation: | 137 Once you have everything installed, to modify the styles and documentation: |
93 | 138 |
94 1. Run [Foreman][] to automatically regenerate the CSS and HTML files when any | 139 1. Run [Foreman][] to automatically regenerate the CSS and HTML files when any |
95 Sass or Markdown files change: | 140 Sass or Markdown files change: |
96 | 141 |
97 bundle exec foreman start | 142 bundle exec foreman start |
98 | 143 |
99 1. Edit the `.scss` files under `css/sass` and the `.markdown` files under | 144 1. Edit the `.scss` files under `css/sass` and the `.markdown` files under |
100 `doc`. | 145 `doc`. |
101 | 146 |
102 [foreman]: http://ddollar.github.com/foreman/ | 147 [foreman]: http://ddollar.github.com/foreman/ |
103 | 148 |
104 When you make changes to SCSS or Markdown files, make sure to check in the | 149 **When you make changes to SCSS or Markdown files, make sure to check in the |
105 generated CSS or HTML files with them. | 150 generated CSS or HTML files with them.** |
OLD | NEW |