From f7cf3ad8674dc61acda985e4e18d54d68f72b13e Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 30 Apr 2014 14:52:58 +0800 Subject: [PATCH] Restructure the docs to put more tutorials. --- docs/README.md | 6 +++--- docs/api/browser/browser-window.md | 19 ++++++------------- docs/{ => tutorial}/quick-start.md | 0 .../use-native-node-module.md} | 2 +- 4 files changed, 10 insertions(+), 17 deletions(-) rename docs/{ => tutorial}/quick-start.md (100%) rename docs/{use-native-modules.md => tutorial/use-native-node-module.md} (98%) diff --git a/docs/README.md b/docs/README.md index 671e1fd4bc..8fa0685160 100644 --- a/docs/README.md +++ b/docs/README.md @@ -1,9 +1,9 @@ # Atom-Shell Documentations -## Guides +## Tutorials -* [Quick start](quick-start.md) -* [Use native modules](use-native-modules.md) +* [Quick start](tutorial/quick-start.md) +* [Use native node modules](tutorial/use-native-node-modules.md) ## Development diff --git a/docs/api/browser/browser-window.md b/docs/api/browser/browser-window.md index 19fcb2591a..7768e0b86d 100644 --- a/docs/api/browser/browser-window.md +++ b/docs/api/browser/browser-window.md @@ -113,14 +113,8 @@ window.onbeforeunload = function(e) { ### Event: 'closed' -Emitted when the window is closed. At the time of this event, window is not -destroyed yet so you can still do some operations to the window (but you -shouldn't!). - -### Event: 'destroyed' - -Emitted when the memory taken by the native window is released. Usually you -should dereference the javascript object when received this event. +Emitted when the window is closed. After you have received this event you should +remove the reference to the window and avoid using it anymore. ### Event: 'unresponsive' @@ -159,12 +153,11 @@ Get the `WebContents` of devtools of this window. ### BrowserWindow.destroy() -Destroy the window and free the memory without closing it. +Force closing the window, the `unload` and `beforeunload` event won't be emitted +for the web page, and `close` event would also not be emitted for this window, +but it would gurrantee the `closed` event to be emitted. -**Note:** Usually you should always call `Window.close()` to close the window, -**which will emit `beforeunload` and `unload` events for DOM. Only use -**`Window.destroy()` when the window gets into a very bad state and you want -**to force closing it. +You should only use this method when the web page has crashed. ### BrowserWindow.close() diff --git a/docs/quick-start.md b/docs/tutorial/quick-start.md similarity index 100% rename from docs/quick-start.md rename to docs/tutorial/quick-start.md diff --git a/docs/use-native-modules.md b/docs/tutorial/use-native-node-module.md similarity index 98% rename from docs/use-native-modules.md rename to docs/tutorial/use-native-node-module.md index ae7481183d..7caed97cf1 100644 --- a/docs/use-native-modules.md +++ b/docs/tutorial/use-native-node-module.md @@ -1,4 +1,4 @@ -# Use native modules +# Use native node modules Since atom-shell is using a different V8 version from the official node, you need to build native module against atom-shell's headers to use them.