WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

Commit c5e4434

Browse files
committed
Merge branch 'package-control'
2 parents 7c1a877 + 81650e4 commit c5e4434

File tree

13 files changed

+1941
-5
lines changed

13 files changed

+1941
-5
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,10 +182,10 @@ I am text with a footnote[^1].
182182

183183
### Headings
184184

185-
The page's title is specified in YAML front matter
186-
and is inserted into the rendered as a heading of level one.
185+
The page's title is specified in YAML front matter.
186+
You MUST start your document with a heading of level one.
187187
Any subsequent headings of the file
188-
MUST NOT be of heading level two or lower
188+
MUST be of heading level two or lower
189189
(where lower refers to the significance,
190190
not the numeric value).
191191

docs/.vitepress/config.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,16 @@ export default defineConfig({
135135
{ text: 'Syntax Definitions', link: '/guide/extensibility/syntaxdefs.md' },
136136
],
137137
},
138+
{
139+
text: 'Package Control',
140+
items: [
141+
{ text: 'Usage', link: '/guide/package-control/usage.md' },
142+
{ text: 'Troubleshooting', link: '/guide/package-control/troubleshooting.md' },
143+
{ text: 'Submitting a Package', link: '/guide/package-control/submitting.md' },
144+
{ text: 'Renaming a Package', link: '/guide/package-control/renaming.md' },
145+
{ text: 'Utilities for Packages', link: '/guide/package-control/utilities.md' },
146+
],
147+
},
138148
{
139149
text: 'Example Setups',
140150
link: '/guide/example-setups/',
@@ -162,6 +172,15 @@ export default defineConfig({
162172
{ text: 'Mouse Bindings', link: '/reference/mouse_bindings.md' },
163173
{ text: 'Menus', link: '/reference/menus.md' },
164174
{ text: 'Metadata', link: '/reference/metadata.md' },
175+
{
176+
text: 'Package Control',
177+
items: [
178+
{ text: 'Channels and Repositories', link: '/reference/package-control/channels-repositories.md' },
179+
{ text: 'Channel.json', link: '/reference/package-control/channel.md' },
180+
{ text: 'Repository.json', link: '/reference/package-control/repository.md' },
181+
{ text: 'Reviewing', link: '/reference/package-control/reviewing.md' },
182+
],
183+
},
165184
{ text: 'Plugins', link: '/reference/plugins.md' },
166185
{ text: 'Projects', link: '/reference/projects.md' },
167186
{ text: 'Python API', link: '/reference/python_api.md' },

docs/guide/example-setups/typescript.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ over the other options for ST3 listed [below](#options-for-sublime-text-3).
88

99
This built-in TypeScript package primarily provides syntax highlighting
1010
and is accompanied by the Sublime Text core features,
11-
such as [completions](../extensibility/completions.html)
11+
such as [completions](/guide/extensibility/completions.md)
1212
and [“Go to Definition”](https://www.sublimetext.com/docs/indexing.html).
1313

1414
### LSP

docs/guide/extensibility/plugins/input_handlers/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ You may find that another works better for you.
418418
## Code Archive
419419

420420
The final code examples presented on this page
421-
[are included in the source git repository][code].
421+
[are included in the source Git repository][code].
422422
You can download a [zipball][] of it (via [DownGit][])
423423
and extract it into your Packages folder
424424
to experiment with them.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
---
2+
title: "Package Control: Renaming a package"
3+
---
4+
5+
<!-- Originals: -->
6+
<!-- https://packagecontrol.io/docs/renaming_a_package -->
7+
<!-- https://github.com/wbond/packagecontrol.io/blob/master/app/html/docs/renaming_a_package.html -->
8+
9+
# Renaming a package
10+
11+
Let's guide you through the process of renaming a package in the [default Package Control channel][pcc].
12+
13+
The goal is to update the main channel so that your entry:
14+
15+
- gets its new `name`
16+
- is sorted alphabetically
17+
- has its previous name in the array of `previous_names`
18+
19+
The `previous_names` will ensure Package Control
20+
is able to move existing installations over to the new name smoothly.
21+
Don't forget to update your documentation, menu, and command palette entries
22+
to also have the same new name.
23+
24+
25+
## Review the new name
26+
27+
Read the [naming guidelines][naming] to make sure your new name will work.
28+
29+
[naming]: ./submitting.md#pick-a-name
30+
31+
32+
## Fork the channel
33+
34+
1. Fork the [Package Control channel][pcc].
35+
2. Clone your fork to your machine.
36+
3. Open it with Sublime Text.
37+
38+
39+
## Update the repository
40+
41+
1. Remove your package entry from its old location.
42+
It will be in one of the JSON files
43+
in the `repository` sub-folder.
44+
2. Paste the package entry into the correct JSON file
45+
based on the new name.
46+
We keep package entries alphabetized
47+
to reduce conflicts when merging pull requests.
48+
3. Update the `name` key with the new name.
49+
4. Add a `previous_names` key to the top-level JSON structure for your package.
50+
`previous_names` needs to be an array of strings.
51+
52+
53+
### Example
54+
55+
```json
56+
{
57+
"name": "AlignmentPlus",
58+
"previous_names": ["Alignment"],
59+
"details": "https://bitbucket.org/wbond/sublime_alignment",
60+
"releases": [
61+
{
62+
"sublime_text": "*",
63+
"tags": true
64+
}
65+
]
66+
}
67+
```
68+
69+
70+
## Submit a Pull Request
71+
72+
Now you're ready to commit and push your changes
73+
and make a PR on the [Package Control Channel][pcc] repository.
74+
Follow any guidelines there and make sure the tests pass!
75+
76+
Note that this is a community project
77+
and people review PRs in their spare time; it might take a while.
78+
79+
[pcc]: https://github.com/wbond/package_control_channel
Lines changed: 223 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,223 @@
1+
---
2+
title: "Package Control: Submitting a package"
3+
---
4+
5+
<!-- Originals: -->
6+
<!-- https://packagecontrol.io/docs/submitting_a_package -->
7+
<!-- https://github.com/wbond/packagecontrol.io/blob/master/app/html/docs/submitting_a_package.html -->
8+
9+
# Submitting a package
10+
11+
One of the reasons developers love Sublime Text
12+
is because of the unmatched breadth and quality of the package ecosystem
13+
and community.
14+
Package Control is the community project that helps users find,
15+
install, and update packages.
16+
17+
If you've taken the time to develop a package,
18+
please consider adding it to the default Package Control channel
19+
so users can easily install and keep your package up-to-date.
20+
21+
22+
## Review existing packages
23+
24+
Start by looking for similar packages you might be able to contribute to.
25+
26+
We strongly encourage improving or adding to existing packages.
27+
This means that packages are of higher quality,
28+
and users don't have to choose from several similar options.
29+
We regularly replace packages that have become outdated
30+
with newer implementations.
31+
32+
33+
## Pick a name
34+
35+
Beyond taste there are some technical aspects to keep in mind
36+
when naming your package.
37+
A package is a directory, so the name must be safe for use in that context.
38+
And a package is (often) a Python module,
39+
meaning Python needs to be able to load it properly.
40+
Also think about how users will be able to search for your package:
41+
you don't want users to have to type in special characters or diacritics,
42+
to be able to find it.
43+
44+
Some rules to follow:
45+
46+
- Try not to use the word "Sublime" in your package name.
47+
Every package available via Package Control is for Sublime Text.
48+
Using the word Sublime just adds noise to the list
49+
when trying to find packages.
50+
You can use the word Sublime in your marketing material
51+
(README etc.) though of course.
52+
- Don't use a name too similar to another: we don't want Todo and T0d0.
53+
- Don't use snake_case.
54+
There are minor technical reasons to avoid that,
55+
but mostly it's just very uncommon (in other words, it looks weird).
56+
- Don't use a `.` in the package name.
57+
If your package includes any Python code, it will not load in Sublime Text.
58+
This is because Python uses . as a folder separator when importing code.
59+
- Don't use a `/` or other restricted characters in the package name.
60+
Invalid characters include:
61+
`<`, `\>`, `:`, `"`, `/`, `\`, `|`, `?` and `*`.
62+
- Use ASCII only.
63+
- Language support (aka "syntax" or "grammar") packages
64+
are named after the language it supports,
65+
without suffixes like "syntax" or "highlighting".
66+
67+
Note that the package name is used in references to resources,
68+
for instance settings files.
69+
If your package name is different from its Git repository name,
70+
make sure you rename the local clone to match.
71+
72+
73+
## Decide how to host
74+
75+
Pick one of the following two hosting options:
76+
77+
- A public GitHub, Bitbucket or GitLab repository.
78+
Only include one package per Git repository
79+
and be sure the root of the package is the root of the repository.
80+
Do not include a packages.json file in your repository.
81+
- Host `.sublime-package` files and a `packages.json` on a web server with SSL.
82+
For each release you'll need to create and upload a new package file
83+
and update the `packages.json` information.
84+
Also see the [repository.json documentation][repo].
85+
86+
When using a public Git repository,
87+
you will need to create a tag each time
88+
you want to make a new version available to users.
89+
The tag names must be a [semantic version number][semver].
90+
91+
If you chose self-hosting,
92+
you will need to use semantic versioning in your `packages.json` file.
93+
94+
95+
## Prepare your Git repository
96+
97+
- Create a [semver-numbered][semver] tag.
98+
- Ensure there are no `.pyc` files in your repository.
99+
- Remove `package-metadata.json`.
100+
This is automatically generated by Package Control
101+
when a package is installed
102+
and should not be in your repository.
103+
- Check file names for cross-platform compatibility,
104+
the same restricted characters apply as in your package name.
105+
- Under very specific circumstances,
106+
like including executables or shared libraries,
107+
add a `.no-sublime-package` file to the root of your repository.
108+
This file will prevent Package Control from shipping your package
109+
as a zipped `.sublime-package` file.
110+
It is not needed for bundling Python modules.
111+
If a module uses numerous absolute imports
112+
to import parts of itself
113+
and an addition to `sys.path` is necessary,
114+
this also works if the package is archived
115+
because of Python's internal ziploader.
116+
117+
118+
## Add your Git repository to the default channel
119+
120+
Fork the [Package Control Channel][pcc]. Then:
121+
122+
- For packages hosted on a public GitHub, Bitbucket or GitLab URL,
123+
add your package information to the correct file in the repository directory.
124+
For full details of the possibilities,
125+
please refer to the [repository.json documentation][repo].
126+
- For self-hosted packages
127+
add the URL of your repository JSON file to the `channel.json`
128+
in the root directory.
129+
130+
131+
## Submit a pull request
132+
133+
Now you're ready to push your changes and make a PR
134+
on the [Package Control Channel][pcc] repository.
135+
Follow any guidelines there and make sure the tests pass!
136+
137+
For a cleaner process,
138+
you should only submit one package per PR.
139+
This allows package submissions to be reviewed and merged independenly.
140+
141+
Note that this is a community project
142+
and people review PRs in their spare time;
143+
it might take a while.
144+
145+
[repo]: /reference/package-control/repository.md
146+
[pcc]: https://github.com/wbond/package_control_channel
147+
148+
149+
### LSP and SublimeLinter
150+
151+
Plugins for the LSP or SublimeLinter frameworks should be submitted to the repositories where those teams manage related packages:
152+
153+
- Linter packages should be submitted over at [SublimeLinter][sl].
154+
- Similarly, any language server protocol packages
155+
are managed via [SublimeLSP][lsp].
156+
157+
[sl]: https://github.com/SublimeLinter/package_control_channel
158+
[lsp]: https://github.com/SublimeLinter/package_control_channel
159+
160+
161+
162+
### Things that help your submission get approved more quickly
163+
164+
- We only accept submissions from maintainers of the package being submitted.
165+
- A valid [semver][] numbered tag must exist on the repository.
166+
- Ensure the README clearly describes the purpose of the package
167+
and how to use it.
168+
- We strongly advise against adding features to the context menu in most cases,
169+
because space in this menu is very limited.
170+
In any case,
171+
features should apply to the specific context,
172+
their visibility should be conditional,
173+
and preferably configurable.
174+
- We strongly advice against adding keybindings by default.
175+
There aren't enough keys for all packages,
176+
so you risk overriding those of other packages.
177+
Instead, provide commented out suggestions in a keymap file,
178+
and/or explain how to create bindings in your README.
179+
- Ensure preferences and keybindings (if any)
180+
are listed in the menu and the command palette,
181+
and open in split view (i.e. using `edit_settings`, not `open_file`).
182+
- Language support packages should not ship with color schemes
183+
to specifically support the language.
184+
Please review common [scope names][scopes]
185+
that will allow any color scheme to support your language.
186+
- Note that the [`git-archive`][arch] feature is used to create the package file,
187+
meaning you can use [`.gitattributes`][attr] to exclude images and other files
188+
that have no functionality in the package
189+
(typically drastically reducing file size of your package
190+
when images are included in the repository).
191+
192+
[scopes]: https://www.sublimetext.com/docs/scope_naming.html
193+
[attr]: https://www.git-scm.com/docs/gitattributes#_export_ignore
194+
[arch]: https://git-scm.com/docs/git-archive
195+
196+
197+
### What labels to use
198+
199+
For labels, please follow these recommendations:
200+
201+
- Labels are always in lowercase.
202+
- Packages that provide ...
203+
- a [language syntax][syntax] have the "language syntax" label.
204+
- (the colors for) [syntax highlighting][colors]
205+
have the "color scheme" label,
206+
whereas packages that provide [theming for the UI][theme]
207+
have the "theme" label.
208+
- a [build system][build] have the "build system" label.
209+
- [snippets][snip] have the "snippets" label.
210+
- [completion metadata][complete] have the "completions" label.
211+
- any other kind of auto-complete have the "auto-complete" label.
212+
- formatters have the "formatting" label,
213+
and optionally "prettify" or "minify", if appropriate.
214+
- utilities have the "utilities" label.
215+
216+
[syntax]: https://www.sublimetext.com/docs/syntax.html
217+
[colors]:https://www.sublimetext.com/docs/color_schemes.html
218+
[theme]: https://www.sublimetext.com/docs/themes.html
219+
[build]: https://www.sublimetext.com/docs/build_systems.html
220+
[snip]: https://www.sublimetext.com/docs/completions.html#snippets
221+
[complete]: https://www.sublimetext.com/docs/completions.html#completion-metadata
222+
223+
[semver]: http://semver.org

0 commit comments

Comments
 (0)