如何在 Atom Editor 中编辑核心文件 [英] How to edit core files in Atom Editor
问题描述
我想在 Atom 中编辑树视图包.我想在上下文菜单中添加一个新项目.但我无法归档文件在哪里.我可以打开config文件夹,我可以看到我安装的所有社区包,但是我在哪里可以找到编辑器的核心文件?
I want to edit the tree-view package in Atom. I want to add a new item to the context menu. But i can't file where are the files. I can open the config folder and I can see all the community packages I have installed, but where do I find the core files of the editor?
推荐答案
它们被打包在 app.asar
文件中.此文件位于 OS X 版本中的以下位置.
They are packed inside the app.asar
file. This file is located at the following location in the OS X version.
Atom.app/Contents/Resources/app.asar
此文件由此构建脚本生成.
当然,这个包是开源的,所以你可以在GitHub上查看树视图的代码.
Of course, this package is open-source, so you can view the code for tree-view on GitHub.
GitHub 也有一些在官方 Atom 包上进行开发的文档.
第一步是创建您自己的克隆.
The first step is creating your own clone.
例如,如果您想对 tree-view
包进行更改,在您的 github 帐户上 fork 存储库,然后克隆它:
For example, if you want to make changes to the tree-view
package,
fork the repo on your github account, then clone it:
> git clone git@github.com:your-username/tree-view.git
接下来安装所有依赖项:
Next install all the dependencies:
> cd tree-view
> apm install
Installing modules ✓
现在您可以将其链接到开发模式,以便在运行 Atom 窗口时使用 atom --dev
,你将使用你的 fork 而不是内置的包:
Now you can link it to development mode so when you run an Atom window
with atom --dev
, you will use your fork instead of the built in
package:
> apm link -d
此外,如果您只想添加另一个菜单项,如果有来自另一个插件的 API,我也不会感到惊讶.
Also, if all you want to do is add another menu item, I wouldn't be surprised if there is an API for doing so from another plugin.
这篇关于如何在 Atom Editor 中编辑核心文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!