如何在Atom编辑器中编辑核心文件 [英] 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上查看 tree-view的代码.
Of course, this package is open-source, so you can view the code for tree-view on GitHub.
GitHub还具有一些有关在官方Atom软件包上进行开发的文档
GitHub also has some documentation for developing on official Atom packages.
第一步是创建自己的克隆.
The first step is creating your own clone.
例如,如果要更改tree-view
程序包,
将回购分叉到您的github帐户上,然后将其克隆:
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编辑器中编辑核心文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!