|
1 | 1 | # sublime_lib |
2 | 2 |
|
3 | | -A utility library for Sublime Text providing a variety of convenience features for other packages to use. |
| 3 | +A utility library for Sublime Text, |
| 4 | +providing a variety of convenience features. |
4 | 5 |
|
5 | 6 | ## Installation |
6 | 7 |
|
7 | | -To make use of sublime_lib in your own package, first declare it as a [dependency](https://packagecontrol.io/docs/dependencies) of your package. Create a file named `dependencies.json` in the root of your package with the following contents: |
| 8 | +To make use of sublime_lib in a package... |
8 | 9 |
|
9 | | -```json |
10 | | -{ |
11 | | - "*": { |
12 | | - "*": [ |
13 | | - "sublime_lib" |
14 | | - ] |
15 | | - } |
16 | | -} |
17 | | -``` |
| 10 | +1. declare it as [dependency](https://packagecontrol.io/docs/dependencies): |
18 | 11 |
|
19 | | -Once you have declared the dependency, open the command palette and run `Package Control: Satisfy Dependencies` to ensure that sublime_lib is installed and available for use. |
| 12 | + Create a file named `dependencies.json` |
| 13 | + with the following contents in package's root directory: |
20 | 14 |
|
21 | | -Then, anywhere in your package, you can import sublime_lib by name: |
| 15 | + ```json |
| 16 | + { |
| 17 | + "*": { |
| 18 | + "*": [ |
| 19 | + "sublime_lib" |
| 20 | + ] |
| 21 | + } |
| 22 | + } |
| 23 | + ``` |
22 | 24 |
|
23 | | -```python |
24 | | -import sublime_lib |
25 | | -``` |
| 25 | + Open _Command Palette_ and run `Package Control: Satisfy Libraries` |
| 26 | + to ensure sublime_lib is installed and available for use. |
| 27 | + |
| 28 | +2. Import sublime_lib in plugins, which want to make use of it. |
| 29 | + |
| 30 | + ```python |
| 31 | + import sublime_lib |
| 32 | + ``` |
26 | 33 |
|
27 | 34 | ## Features |
28 | 35 |
|
29 | | -For complete documentation of all features, see the [API documentation](https://sublimetext.github.io/sublime_lib/). |
| 36 | +For complete documentation of all features, |
| 37 | +see the [API documentation](https://sublimetext.github.io/sublime_lib/). |
30 | 38 |
|
31 | 39 | Highlights include: |
32 | 40 |
|
33 | | -- [`SettingsDict`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.settings_dict.html), which wraps a `sublime.Settings` object with an interface modeled after a standard Python `dict`. |
34 | | -- [`ViewStream`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.view_stream.html), a standard [Python IO stream](https://docs.python.org/3/library/io.html#io.TextIOBase) wrapping a `sublime.View` object; and [OutputPanel](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.output_panel.html), which extends `ViewStream` to provide additional functionality for output panel views. |
| 41 | +- [`ActivityIndicator`](https://sublimetext.github.io/sublime_lib/#activity-indicator) context manager to indicate background activity via status bar. |
| 42 | +- [`ResourcePath`](https://sublimetext.github.io/sublime_lib/#sublime_lib.ResourcePath), a [pathlib.Path](https://docs.python.org/3/library/pathlib.html) inspired representation of ST's resource paths, |
| 43 | + with methods to convert from and to filesystem paths. |
| 44 | +- [`SettingsDict`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.settings_dict.html) provides a standard Python `dict` inspired interface for `sublime.Settings` objects. |
| 45 | +- [`OutputPanel`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.output_panel.html), extending `ViewStream` to provide additional functionality for output panel views. |
| 46 | +- [`ViewStream`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.view_stream.html), a standard [Python IO stream](https://docs.python.org/3/library/io.html#io.TextIOBase) wrapping a `sublime.View` object |
35 | 47 |
|
36 | 48 | ### Deprecated |
37 | 49 |
|
38 | | -The [`syntax` submodule](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.syntax.html), providing methods to list all loaded syntax definitions and to find a syntax matching a given scope is marked deprecated in favor of native API functions, available as of ST4. |
| 50 | +The [`flags` submodule](https://sublimetext.github.io/sublime_lib/#module-sublime_lib.flags) is deprecated in favour of native API, available as of ST4135. |
| 51 | + |
| 52 | +The [`syntax` submodule](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.syntax.html), is marked deprecated in favour of native API functions, available as of ST4. |
39 | 53 |
|
40 | 54 | ## Releasing a new version |
41 | 55 |
|
42 | 56 | 1. Create a tag in the format `v<major>.<minor>.<patch>` |
43 | 57 | 2. Push the tag to origin. |
44 | 58 |
|
45 | | -A github action should be created that builds a WHEEL file, |
| 59 | +A GitHub action should be created that builds a WHEEL file, |
46 | 60 | creates a release for this tag |
47 | | -and attaches the WHEEL file as an artifact. |
| 61 | +and attaches the WHEEL file as an artefact. |
0 commit comments