Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

Commit

Permalink
Merge pull request #37 from atom/docs
Browse files Browse the repository at this point in the history
Docs Time!
  • Loading branch information
Jessica Lord committed Mar 10, 2016
2 parents 11ca990 + c7b7faa commit 95934db
Show file tree
Hide file tree
Showing 6 changed files with 96 additions and 16 deletions.
24 changes: 24 additions & 0 deletions CODE_OF_CONDUCT.md
@@ -0,0 +1,24 @@
# Contributor Code of Conduct

As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities.

We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality.

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other's private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team.

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting a project maintainer at [atom@github.com](mailto:atom@github.com). All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter of an incident.

This Code of Conduct is adapted from the Contributor Covenant, version 1.3.0, available from http://contributor-covenant.org/version/1/3/0/
2 changes: 2 additions & 0 deletions ISSUE_TEMPLATE.md
@@ -0,0 +1,2 @@
* What operating system are you using?
* What version of Node.js is on your system?
33 changes: 21 additions & 12 deletions README.md
@@ -1,25 +1,34 @@
# electron-demo
WIP Electron API Demo App in Electron. META.
# electron-api-demos
This is a desktop app that interactively and with sample code demonstrates core features of the [Electron.js](http://electron.atom.io) API. It's built with Electron, too, of course. This app works on Windows, OS X and Linux operating systems.

## What
Use this app to see what you can do with Electron.js and use the source code to learn how to create a basic Electron app.

This is an Electron app that provides documentation and interaction with the Electron API. See this [existing project](https://github.com/craigshoemaker/electron-api-demos) for an idea of what this means.
---

## Goals
This project adheres to the Contributor Covenant [code of conduct](CODE_OF_CONDUCT.md).
By participating, you are expected to uphold this code. Please report unacceptable
behavior to atom@github.com.

Next-level documentation that helps developers build Electron apps.
Follow [@ElectronJS](https://twitter.com/electronjs) on Twitter for important
announcements. Visit the [electron website](http://electron.atom.io).

This will demonstrate how to use the API and can be used to see the API in action on each platform. It will also serve to be a demonstration of basic Electron app structure and best practices.
## To Use

**Follow along in the [issues](https://github.com/atom/electron-demo/issues).**
You can [download the latest release](https://github.com/atom/electron-api-demos/releases) for your operating system or build it yourself.

## Development
### To build

To use while it's under development:
You'll need [Node.js](https://nodejs.org) installed on your computer in order to build this app.

```bash
$ git clone https://github.com/atom/electron-demo
$ cd electron-demo
$ git clone https://github.com/atom/electron-api-demos
$ cd electron-api-demos
$ npm install
$ npm start
```

If you don't wish to clone, you can [download the source code](https://github.com/atom/electron-api-demos/archive/master.zip).

#### See the [contributing doc]() on how to contribute.

#### Reads the [docs]() to learn more about how this app is built.
Binary file added assets/img/diagram.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
45 changes: 45 additions & 0 deletions docs.md
@@ -0,0 +1,45 @@
# Documentation

This app has been developed to be a lightweight Electron app, demonstrating how to create a basic Electron app with a few exceptions that have been made for the sake of code organization in regards the the demos themselves.

All of the sample code shown in the app _is the actual code used in the app_. These JavaScript bits have been pulled out into their own file and organized by process (main or renderer) and then by section (communication, menus, native UI, printing, system, windows).

This was done for maintainability—code updates only have to be made in one place—and organization—it's easy to find the sample code you're looking for.

All of the pages (or views) are separate `.html` files which are appended onto the `index.html` using [HTML imports](http://www.html5rocks.com/en/tutorials/webcomponents/imports/).

## Folder Structure

![Digram of App Structure and Operations](/assets/img/diagram.png)

#### `assets`
This directory contains assets for the app itself: CSS, fonts, images and shared JavaScript libraries or helpers.

#### `main-process`
This directory contains sub folders for each demo section that requires JavaScript in the main process. This structure is mirrored in the `renderer-process` directory.

The `main.js` file, located in the root, takes each `.js` file in these directories and executes them.

#### `renderer-process`
This directory contains sub folders for each demo section that requires JavaScript in the renderer process. This structure is mirrored in the `main-process` directory.

Each of the HTML page views requires the corresponding renderer-process `.js` files that it needs for its demo.

Each page view reads the content of its relevant main and renderer process files and adds them to the page for the snippets.

#### `sections`
This directory contains sub folders for each demo section. These subfolders contain the HTML files for each of the demo pages. Each of these files is appended to `index.html`, located at the root.

#### `index.html`
This is the main view in the app. It contains the sidebar with navigation and uses [HTML imports](http://www.html5rocks.com/en/tutorials/webcomponents/imports/) to append each section HTML page to the `body`.

#### `main.js`
This file contains the lifecycle instructions for the app like how to start and quit, it is the app's main process. It grabs every `.js` file in the `main-process` directory and executes.

The `package.json` sets this file as the `main` file.

#### `package.json`
This file is required when using `npm` and Electron.js. It contains details on the app: the author, dependencies, repository and points to `main.js` as the application's main process file.

#### Docs
The files: `CODE_OF_CONDUCT`, `README`, `docs` and `CONTRIBUTING` files make up the documentation for the project.
8 changes: 4 additions & 4 deletions package.json
@@ -1,5 +1,5 @@
{
"name": "electron-demo",
"name": "electron-api-demos",
"version": "1.0.0",
"description": "Electron interactive API demos",
"main": "main.js",
Expand All @@ -20,7 +20,7 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/atom/electron-demo.git"
"url": "git+https://github.com/atom/electron-api-demos.git"
},
"keywords": [
"Electron",
Expand All @@ -30,9 +30,9 @@
"author": "GitHub",
"license": "MIT",
"bugs": {
"url": "https://github.com/atom/electron-demo/issues"
"url": "https://github.com/atom/electron-api-demos/issues"
},
"homepage": "https://github.com/atom/electron-demo#readme",
"homepage": "https://github.com/atom/electron-api-demos#readme",
"devDependencies": {
"chai": "^3.4.1",
"chai-as-promised": "^5.1.0",
Expand Down

0 comments on commit 95934db

Please sign in to comment.