Electron 文档
This week we've given Electron's documentation a home on electronjs.org. You can visit /docs/latest for the latest set of docs. We'll keep versions of older docs, too, so you're able to visit /docs/vX.XX.X for the docs that correlate to the version you're using.
You can visit /docs to see what versions are available or /docs/all to see the latest version of docs all on one page (nice for cmd
+ f
searches).
如果您想要为文档内容做出贡献, 您可以在 Electron 仓库中获取文档。 We fetch them for each minor release and add them to the Electron site repository, which is made with Jekyll.
If you're interested in learning more about how we pull the docs from one repository to another continue reading below. Otherwise, enjoy the docs!
The Technical Bits
We're preserving the documentation within the Electron core repository as is. This means that electron/electron will always have the latest version of the docs. When new versions of Electron are released, we duplicate them over on the Electron website repository, electron/electronjs.org.
script/docs
To fetch the docs we run a script with a command line interface of script/docs vX.XX.X
with or without the --latest
option (depending on if the version you're importing is the latest version). Our script for fetching docs uses a few interesting Node modules:
nugget
用于 获取正式版本的压缩包 并将其保存到临时目录。gunzip-maybe
to unzip the tarball.tar-fs
for streaming just the/docs
directory from the tarball and filtering and processing the files (with the help ofthrough2
) so that they work nicely with our Jekyll site (more on that below).
Tests help us know that all the bits and pieces landed as expected.
Jekyll
The Electron website is a Jekyll site and we make use of the Collections feature for the docs with a structure like this:
electron.atom.io
└── _docs
├── latest
├── v0.27.0
├── v0.26.0
├── so on
└── so forth