Make links to docs, point to the correct version
authorEran Tiktin <eran.t@mce-sys.com>
Sat, 21 Nov 2015 00:26:59 +0000 (02:26 +0200)
committerEran Tiktin <eran.t@mce-sys.com>
Sat, 21 Nov 2015 00:26:59 +0000 (02:26 +0200)
- Links to docs in the default app, pointed to the docs in the master
branch. I changed them to point to the docs that match Electron's
version.
- Added Electron's version to the header of the default app, so it will
be easier to figure out what version is currently running.

atom/browser/default_app/index.html
atom/browser/default_app/main.js

index e55cdf7..ec16a38 100644 (file)
     };
   </script>
 
-  <h2 style="-webkit-app-region: drag">Welcome to Electron</h2>
+  <h2>
+    <script>
+      document.write(`Welcome to Electron (v${process.versions.electron})`)
+    </script>
+  </h2>
 
   <p>
   To run your app with Electron, execute the following command under your
 
   <p>
   The <code>path-to-your-app</code> should be the path to your own Electron
-  app, you can read the <a href='https://github.com/atom/electron/blob/master/docs/tutorial/quick-start.md'>quick start</a>
-  guide in Electron's <a href='https://github.com/atom/electron/blob/master/docs'>docs</a>
+  app, you can read the
+  <script>
+    document.write(
+      `<a href='https://github.com/atom/electron/blob/v${process.versions.electron}/docs/tutorial/quick-start.md'>quick start</a>`
+    );
+  </script>
+  guide in Electron's
+  <script>
+    document.write(
+      `<a href='https://github.com/atom/electron/tree/v${process.versions.electron}/docs#readme'>docs</a>`
+    );
+  </script>
   on how to write one.
   </p>
 
index 3916cfb..49016c0 100644 (file)
@@ -148,7 +148,11 @@ app.once('ready', function() {
         },
         {
           label: 'Documentation',
-          click: function() { shell.openExternal('https://github.com/atom/electron/tree/master/docs#readme') }
+          click: function() {
+            shell.openExternal(
+              `https://github.com/atom/electron/tree/v${process.versions.electron}/docs#readme`
+            )
+          }
         },
         {
           label: 'Community Discussions',
@@ -249,7 +253,11 @@ if (option.file && !option.webdriver) {
   } catch(e) {
     if (e.code == 'MODULE_NOT_FOUND') {
       app.focus();
-      dialog.showErrorBox('Error opening app', 'The app provided is not a valid electron app, please read the docs on how to write one:\nhttps://github.com/atom/electron/tree/master/docs\n\n' + e.toString());
+      dialog.showErrorBox(
+        'Error opening app',
+        'The app provided is not a valid Electron app, please read the docs on how to write one:\n' +
+        `https://github.com/atom/electron/tree/v${process.versions.electron}/docs\n\n${e.toString()}`
+      );
       process.exit(1);
     } else {
       console.error('App threw an error when running', e);