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/ Source markdown for documentation. |
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. |
| 23 │ │ |
| 24 │ ├───┬ views/ Mustache templates. |
| 25 │ │ ├───┬ doc/ Generated HTML. Modify /app/doc/ files instead
. |
| 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 Syntax highlighting styles. |
| 36 │ ├──── _variables.scss Variables for theming bootstrap. |
| 37 │ └ style.scss Main stylesheet. |
| 38 │ |
| 39 ├───┬ test/ Tests for app functionality. |
| 40 │ └──── ... |
| 41 │ |
| 42 ├───┬ third_party/ External dependencies used by the app. |
| 43 │ └──── ... |
| 44 │ |
| 45 ├──── _config.yml Jekyll configuration. |
| 46 ├──── Procfile Process to be run with Foreman. |
| 47 ├──── test.py Runs all tests. |
| 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```. |
| 54 |
| 55 ### Prerequisites |
20 | 56 |
21 The server is written in Python and intended to run on Google App Engine. To run | 57 The server is written in Python and intended to run on Google App Engine. To run |
22 it locally, perform the following steps: | 58 it locally, perform the following steps: |
23 | 59 |
24 * Install the [App Engine SDK][] for Python. | 60 1. Install the [App Engine SDK][] for Python. |
25 * Make sure the SDK is on your `$PATH`.<sup>1</sup> | 61 1. Make sure the SDK is on your `$PATH`.<sup>1</sup> |
26 * Install required packages.<sup>2</sup> | 62 1. Install required packages.<sup>2</sup> |
27 | 63 |
28 pip install beautifulsoup4 pycrypto webtest | 64 pip install beautifulsoup4 pycrypto webtest |
29 | 65 |
| 66 [app engine sdk]: https://developers.google.com/appengine/downloads |
| 67 |
| 68 ### Running the server |
| 69 |
30 * From the root directory of this repository, run: | 70 * From the root directory of this repository, run: |
31 | 71 |
32 dev_appserver.py app | 72 dev_appserver.py app |
33 | 73 |
34 [app engine sdk]: https://developers.google.com/appengine/downloads | |
35 | |
36 * Open your browser to <http://localhost:8080/> to see that it works. | 74 * Open your browser to <http://localhost:8080/> to see that it works. |
37 | 75 |
38 * To run tests: | 76 ### Running tests |
| 77 |
| 78 * To run tests, run: |
39 | 79 |
40 ./test.py | 80 ./test.py |
41 | 81 |
42 * To publish packages to your local test server, visit <http://localhost:8080/
admin> | 82 ### Publishing packages locally |
43 (sign in as administrator), go to the "Private Key" tab & enter any string | 83 |
| 84 * To publish packages to your local test server, visit |
| 85 <http://localhost:8080/admin> |
| 86 (sign in as administrator), go to the "Private Key" tab & enter any string |
44 into the private key field. | 87 into the private key field. |
45 | 88 |
46 <sup>1</sup> This might have been done already if you allowed the Google App | 89 <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`. | 90 Engine launcher to add symbolic links to your `$PATH`. |
48 | 91 |
49 <sup>2</sup> On installing packages: | 92 <sup>2</sup> On installing packages: |
| 93 |
50 * Beautiful Soup & WebTest are only required for running tests. | 94 * Beautiful Soup & WebTest are only required for running tests. |
51 * Some Linux distributions come with PyCrypto installed by default. Make sure | 95 * Some Linux distributions come with PyCrypto installed by default. Make sure |
52 at least version 2.6 installed. | 96 at least version 2.6 installed. |
53 * If using Mac and `pip` is not available, install [brew](http://brew.sh) and | 97 * If using Mac and `pip` is not available, install [brew](http://brew.sh) and |
54 run `brew install python`. | 98 run `brew install python`. |
55 | 99 |
56 ### Deploying | 100 ## Deploying to production |
57 | 101 |
58 See the docs on [branches and versions][]. | 102 See the docs on [branches and versions][]. |
59 | 103 |
60 [branches and versions]: https://github.com/dart-lang/pub-dartlang/wiki/Branches
-and-Versions | 104 [branches and versions]: |
| 105 https://github.com/dart-lang/pub-dartlang/wiki/Branches-and-Versions |
61 | 106 |
62 ### Modifying the CSS and Documentation | 107 ## Modifying the CSS and documentation |
63 | 108 |
64 The CSS files are generated from the source [Sass][] files using [Compass][]. | 109 * The [CSS files](app/static/style.css) are generated from the source |
65 The HTML documentation files are generated from the source [Markdown][] using | 110 [Sass][] files using [Compass][]. |
66 [Jekyll][]. To get ready to make changes, you'll need [Ruby][] and [Python][]. | 111 |
| 112 * The [HTML documentation files](app/views/doc/) are generated from the source |
| 113 [Markdown][] using [Jekyll][]. |
| 114 |
| 115 To get ready to make changes, you'll need [Ruby][] and [Python][]. |
67 Then: | 116 Then: |
68 | 117 |
69 [ruby]: http://ruby-lang.org | 118 [ruby]: http://ruby-lang.org |
70 [python]: http://python.org | 119 [python]: http://python.org |
71 [sass]: http://sass-lang.com | 120 [sass]: http://sass-lang.com |
72 [compass]: http://compass-style.org | 121 [compass]: http://compass-style.org |
73 [markdown]: http://daringfireball.net/projects/markdown/ | 122 [markdown]: http://daringfireball.net/projects/markdown/ |
74 [jekyll]: http://jekyllrb.com/ | 123 [jekyll]: http://jekyllrb.com/ |
75 | 124 |
76 1. Ensure you have bundler installed: | 125 1. Ensure you have bundler installed: |
77 | 126 |
78 gem install bundler | 127 gem install bundler |
79 | 128 |
80 2. Run this to install the dependencies: | 129 2. Run this to install the dependencies: |
81 | 130 |
82 bundle install | 131 bundle install |
83 | 132 |
84 3. Run this to install the latest version of Pygments for syntax highlighting: | 133 3. Run this to install the latest version of Pygments for syntax highlighting: |
85 | 134 |
86 sudo pip install --upgrade pygments | 135 sudo pip install --upgrade pygments |
87 | 136 |
88 Note that this is only needed on your development machine to iterate on the CSS | 137 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 | 138 and documentation. The deployed server just uses the pre-compiled CSS and HTML |
90 and only requires Python. | 139 and only requires Python. |
91 | 140 |
92 Once you have everything installed, to modify the styles and documentation: | 141 Once you have everything installed, to modify the styles and documentation: |
93 | 142 |
94 1. Run [Foreman][] to automatically regenerate the CSS and HTML files when any | 143 1. Run [Foreman][] to automatically regenerate the CSS and HTML files when any |
95 Sass or Markdown files change: | 144 Sass or Markdown files change: |
96 | 145 |
97 bundle exec foreman start | 146 bundle exec foreman start |
98 | 147 |
99 1. Edit the `.scss` files under `css/sass` and the `.markdown` files under | 148 1. Edit the `.scss` files under `css/sass` and the `.markdown` files under |
100 `doc`. | 149 `doc`. |
101 | 150 |
102 [foreman]: http://ddollar.github.com/foreman/ | 151 [foreman]: http://ddollar.github.com/foreman/ |
103 | 152 |
104 When you make changes to SCSS or Markdown files, make sure to check in the | 153 **When you make changes to SCSS or Markdown files, make sure to check in the |
105 generated CSS or HTML files with them. | 154 generated CSS or HTML files with them.** |
OLD | NEW |