| OLD | NEW |
| 1 # DOM Distiller | 1 # DOM Distiller |
| 2 | 2 |
| 3 DOM Distiller aims to provide a better reading experience by distilling the | 3 DOM Distiller aims to provide a better reading experience by distilling the |
| 4 content of the page. This distilled content can then be used in a variety of | 4 content of the page. This distilled content can then be used in a variety of |
| 5 ways. | 5 ways. |
| 6 | 6 |
| 7 The current efforts that are or will be powered by DOM Distiller: | 7 The current efforts that are or will be powered by DOM Distiller: |
| 8 | 8 |
| 9 - Reader mode: a mobile-friendly viewing mode for Chrome mobile | 9 - Reader mode: a mobile-friendly viewing mode for Chrome mobile |
| 10 - [Simplify page for print] | 10 - [Simplify page for print] |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 182 `ant` is the tool we use to build, and the available targets can be listed using | 182 `ant` is the tool we use to build, and the available targets can be listed using |
| 183 `ant -p`, but the typical targets you might use when you work on this project | 183 `ant -p`, but the typical targets you might use when you work on this project |
| 184 is: | 184 is: |
| 185 | 185 |
| 186 - `ant test` Runs all tests. | 186 - `ant test` Runs all tests. |
| 187 - `ant test -Dtest.filter=$FILTER_PATTERN` where `$FILTER_PATTERN` is a | 187 - `ant test -Dtest.filter=$FILTER_PATTERN` where `$FILTER_PATTERN` is a |
| 188 [gtest\_filter pattern] | 188 [gtest\_filter pattern] |
| 189 (https://code.google.com/p/googletest/wiki/AdvancedGuide#Running_a_Subset_of
_the_Tests). | 189 (https://code.google.com/p/googletest/wiki/AdvancedGuide#Running_a_Subset_of
_the_Tests). |
| 190 For example `*.FilterTest.*:*Foo*-*Bar*` would run all tests containing | 190 For example `*.FilterTest.*:*Foo*-*Bar*` would run all tests containing |
| 191 `.FilterTest.` and `Foo`, but not those with `Bar`. | 191 `.FilterTest.` and `Foo`, but not those with `Bar`. |
| 192 - `ant gwtc` compiles .class+.java files to JavaScript. Standalone JavaScript | 192 - `ant gwtc` compiles .class + .java files to JavaScript. Standalone JavaScrip
t |
| 193 is available at `war/domdistiller/domdistiller.nocache.js`. | 193 is available at `war/domdistiller/domdistiller.nocache.js`. |
| 194 - `ant gwtc.jstests` creates a standalone JavaScript for the tests. | 194 - `ant gwtc.jstests` creates a standalone JavaScript for the tests. |
| 195 - `ant extractjs` creates standalone JavaScript from output of ant gwtc. The |
| 196 compiled JavaScript file is available at `out/domdistiller.js`. |
| 197 - `ant extractjs.jstests` creates a standalone JavaScript for the tests. |
| 195 - `ant package` Copies the main build artifacts into the `out/package` folder, | 198 - `ant package` Copies the main build artifacts into the `out/package` folder, |
| 196 typically the extracted JS and protocol buffer files. | 199 typically the extracted JS and protocol buffer files. |
| 197 | 200 |
| 198 # Contributing | 201 # Contributing |
| 199 | 202 |
| 200 You can use regular `git` command when developing in this project and use `git | 203 You can use regular `git` command when developing in this project and use `git |
| 201 cl` for collaboration. | 204 cl` for collaboration. |
| 202 | 205 |
| 203 ## Uploading a CL for review | 206 ## Uploading a CL for review |
| 204 | 207 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 375 ```bash | 378 ```bash |
| 376 distill http://example.com/article.html | 379 distill http://example.com/article.html |
| 377 ``` | 380 ``` |
| 378 | 381 |
| 379 # Debug Code | 382 # Debug Code |
| 380 | 383 |
| 381 ## Interactive debugging | 384 ## Interactive debugging |
| 382 | 385 |
| 383 You can use the Chrome Developer Tools to debug DOM Distiller: | 386 You can use the Chrome Developer Tools to debug DOM Distiller: |
| 384 | 387 |
| 385 - Update the test JavaScript by running `ant gwtc.jstests` or `ant test`. | 388 - Update the test JavaScript by running `ant extractjs.jstests` or `ant test`. |
| 386 - Open `war/test.html` in Chrome desktop | 389 - Open `war/test.html` in Chrome desktop |
| 387 - Open the `Console` panel in Developer Tools (**Ctrl-Shift-J**). On Mac OS X | 390 - Open the `Console` panel in Developer Tools (**Ctrl-Shift-J**). On Mac OS X |
| 388 you can use **⌥-⌘-I** (uppercase `I`) as the shortcut. | 391 you can use **⌥-⌘-I** (uppercase `I`) as the shortcut. |
| 389 - Run all tests by calling: | 392 - Run all tests by calling: |
| 390 | 393 |
| 391 ```javascript | 394 ```javascript |
| 392 org.chromium.distiller.JsTestEntry.run() | 395 org.chromium.distiller.JsTestEntry.run() |
| 393 ``` | 396 ``` |
| 394 | 397 |
| 395 - To run only a subset of tests, you can use a regular expression that matches | 398 - To run only a subset of tests, you can use a regular expression that matches |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 aliases for easy access later. For example, Nexus 4 would be: | 469 aliases for easy access later. For example, Nexus 4 would be: |
| 467 | 470 |
| 468 ``` | 471 ``` |
| 469 --user-agent="Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) Ap
pleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" | 472 --user-agent="Mozilla/5.0 (Linux; Android 4.2.1; en-us; Nexus 4 Build/JOP40D) Ap
pleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Mobile Safari/535.19" |
| 470 ``` | 473 ``` |
| 471 | 474 |
| 472 Steps 1-3 in the guide above can typically be done in a stable version of | 475 Steps 1-3 in the guide above can typically be done in a stable version of |
| 473 Chrome, whereas the rest of the steps is typically done in your own build of | 476 Chrome, whereas the rest of the steps is typically done in your own build of |
| 474 Chrome (hence the "(Re)" in step 4). Besides speed, this also facilitates | 477 Chrome (hence the "(Re)" in step 4). Besides speed, this also facilitates |
| 475 side-by-side comparison. | 478 side-by-side comparison. |
| OLD | NEW |