×

Electron 教程

Electron 教程简介Electron 快速入门Electron 桌面环境集成Electron 在线/离线事件探测Electron 进程支持的 Chrome 命令行开关Electron 环境变量Electron 支持的平台Electron 应用部署Mac App Store 应用提交向导Electron 应用打包Electron 使用原生模块Electron 主进程调试使用 Selenium 和 WebDriverElectron DevTools扩展使用 Pepper Flash 插件使用 Widevine CDM 插件Electron 术语表Electron 离屏渲染Electron 交互式解释器 (REPL)Electron 自动更新功能autoUpdater

Electron API

Electron DOM File对象Electron DOM <webview>Electron window.open 函数

在主进程内可用的模块

Electron app 模块Electron autoUpdater 模块Electron BrowserWindow 模块Electron contentTracing 模块Electron dialog 模块Electron global-shortcut 模块Electron ipcMain 模块Electron menu 模块Electron MenuItem 模块Electron powerMonitor 模块Electron powerSaveBlockerElectron protocol 模块Electron session 模块Electron webContents 模块Electron Tray 模块Electron Locales

在渲染进程(网页)可用模块

Electron desktopCapturer模块Electron ipcRenderer 模块Electron remote 模块Electron webFrame 模块

两种进程都可用的模块

Electron clipboard 模块Electron crashReporter 模块Electron nativeImage 模块Electron screen 模块Electron shell 模块

Electron 开发

Electron 编码规范Electron 源码目录结构Electron 和 NW.js技术上的差异Electron 构建系统概览Electron 构建步骤 (OS X)Electron 构建步骤 (Windows)Electron 构建步骤 (Linux)调试中使用 Symbol ServerElectron 常见问题Electron 版本管理electron window 提交指南自动化持续集成系统(CI)测试Electron 文档风格指南

Electron 编码规范


以下是 Electron 项目的编码规范。

C++ 和 Python

对于 C++ 和 Python,我们遵循 Chromium 的编码规范。你可以使用 script/cpplint.py 来检验文件是否符合要求。

我们目前使用的 Pyhton 版本是 Python 2.7。

C++ 代码中用到了许多 Chromium 中的接口和数据类型,所以希望你能熟悉它们。Chromium 中的重要接口和数据结构就是一篇不错的入门文档,里面提到了一些特殊类型、域内类型(退出作用域时自动释放内存)、日志机制,等等。

CoffeeScript

对于 CoffeeScript,我们遵循 GitHub 的编码规范 及以下规则:

  • 文件不要以换行符结尾,我们要遵循 Google 的编码规范。
  • 文件名使用 - 而不是 _ 来连接单词,比如 file-name.coffee 而不是 file_name.coffee,这是沿用 github/atom 模块的命名方式(module-name)。这条规则仅适用于 .coffee 文件。

API 命名

当新建一个 API 时,我们倾向于使用 getters 和 setters 而不是 jQuery 单函数的命名方式,比如 .getText()  .setText(text) 而不是 .text([text])


分类导航

关注微信下载离线手册

bootwiki移动版 bootwiki
(群号:472910771)