https://github.com/sublimetext/sublime_lib
Utility library for frequently used functionality in Sublime Text and convenience functions or classes
https://github.com/sublimetext/sublime_lib
Last synced: 29 days ago
JSON representation
Utility library for frequently used functionality in Sublime Text and convenience functions or classes
- Host: GitHub
- URL: https://github.com/sublimetext/sublime_lib
- Owner: SublimeText
- License: mit
- Created: 2018-04-03T18:46:58.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2021-07-05T02:06:51.000Z (over 4 years ago)
- Last Synced: 2025-04-16T15:15:15.959Z (11 months ago)
- Language: Python
- Homepage: https://sublimetext.github.io/sublime_lib
- Size: 769 KB
- Stars: 52
- Watchers: 13
- Forks: 4
- Open Issues: 22
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# sublime_lib
A utility library for Sublime Text,
providing a variety of convenience features.
## Installation
To make use of sublime_lib in a package...
1. declare it as [dependency](https://packagecontrol.io/docs/dependencies):
Create a file named `dependencies.json`
with the following contents in package's root directory:
```json
{
"*": {
"*": [
"sublime_lib"
]
}
}
```
Open _Command Palette_ and run `Package Control: Satisfy Libraries`
to ensure sublime_lib is installed and available for use.
2. Import sublime_lib in plugins, which want to make use of it.
```python
import sublime_lib
```
## Features
For complete documentation of all features,
see the [API documentation](https://sublimetext.github.io/sublime_lib/).
Highlights include:
- [`ActivityIndicator`](https://sublimetext.github.io/sublime_lib/#activity-indicator) context manager to indicate background activity via status bar.
- [`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,
with methods to convert from and to filesystem paths.
- [`SettingsDict`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.settings_dict.html) provides a standard Python `dict` inspired interface for `sublime.Settings` objects.
- [`OutputPanel`](https://sublimetext.github.io/sublime_lib/modules/sublime_lib.output_panel.html), extending `ViewStream` to provide additional functionality for output panel views.
- [`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
### Deprecated
The [`flags` submodule](https://sublimetext.github.io/sublime_lib/#module-sublime_lib.flags) is deprecated in favour of native API, available as of ST4135.
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.
## Releasing a new version
1. Create a tag in the format `v..`
2. Push the tag to origin.
A GitHub action should be created that builds a WHEEL file,
creates a release for this tag
and attaches the WHEEL file as an artefact.