MarLant
Sublime Text plugin for working with SubRip/SRT subtitles
Details
Installs
- Total 24
- Win 15
- Mac 6
- Linux 3
Mar 22 | Mar 21 | Mar 20 | Mar 19 | Mar 18 | Mar 17 | Mar 16 | Mar 15 | Mar 14 | Mar 13 | Mar 12 | Mar 11 | Mar 10 | Mar 9 | Mar 8 | Mar 7 | Mar 6 | Mar 5 | Mar 4 | Mar 3 | Mar 2 | Mar 1 | Feb 28 | Feb 27 | Feb 26 | Feb 25 | Feb 24 | Feb 23 | Feb 22 | Feb 21 | Feb 20 | Feb 19 | Feb 18 | Feb 17 | Feb 16 | Feb 15 | Feb 14 | Feb 13 | Feb 12 | Feb 11 | Feb 10 | Feb 9 | Feb 8 | Feb 7 | Feb 6 | |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Windows | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Mac | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Linux | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
Readme
- Source
- raw.githubusercontent.com
MarLant
About
Sublime Text plugin for working with SubRip/SRT subtitles.
UI theme and color scheme used on the screenshot and demonstration videos below: One Dark.
Features
- SubRip / SRT syntax highlighting
- various functions for working with subtitles:
- SubRip format validation
- additional checks (text lines length, titles duration, etc)
- renumbering titles ordinals
- inserting new titles
- splitting a title in two
- joining two titles into one
- shifting all the timings
- opening a translation file in a split view
- generation of an empty translation file
- SubRip format validation
Commands can be called from:
- Command Palette (
CTRL/COMMAND + SHIFT + P
) (all the commands) - tab context menu (translation file creation/opening)
- text area context menu (inserting, splitting and joining titles)
Demonstration
Validating the file:
https://user-images.githubusercontent.com/6904927/168665456-589fd743-86a5-4c4d-97b2-56a6ca40435a.mp4
Joining and splitting titles:
https://user-images.githubusercontent.com/6904927/168662707-c775db65-b73e-4347-b8fa-209741ea85b9.mp4
Creating and openning a translation file:
https://user-images.githubusercontent.com/6904927/168663924-b1236762-3207-480e-895e-aa7754f62cf5.mp4
Installing
- via Package Control:
CTRL/COMMAND + SHIFT + P
→Package Control: Install Package
→MarLant
- manually:
- clone the repository and copy its folder (
marlant
) to/path/to/Sublime Text/Packages/
- the exact path to packages can be opened with
CTRL/COMMAND + SHIFT + P
→Preferences: Browse Packages
- you might want to skip copying resources listed in
.gitattributes
file- or just download an archive attached to the latest tag
- the exact path to packages can be opened with
- clone the repository and copy its folder (
Requirements
- Sublime Text v4099 or newer
- Python plugin host v3.8 or newer
FAQ
No plugin commands available anywhere
Check that the active file/view has the SubRip/SRT syntax/scope, as the plugin functionality is only enabled there.
Are there keybindings
Not out of the box, but you can certainly create your own keybinding for any plugin command. To get a command name and its arguments, enable commands logging (sublime.log_commands(True)
) in Console.
For example, the following adds two keybindings: for inserting a new title before and after the current one:
{
"keys": ["super+alt+i", "super+alt+b"],
"command": "marlant_insert_new_title",
"args": {"after_current_title": false }
},
{
"keys": ["super+alt+i", "super+alt+a"],
"command": "marlant_insert_new_title",
"args": {"after_current_title": true }
}
Why the Sublime Text 4 requirement and v4099 as the lowest
The version 4 in general is because that's where Python plugin host v3.8 was added. And the v4099 specifically as the minimal one is because it's the one with the latest plugin host v3.8.8. But of course most likely the plugin will also work fine with the very first v4050.
Why the Python 3.8 plugin host requirement
Mostly because of f-strings that were added only in Python 3.6 and thus are not available with plugin host v3.3.
The plugin is licensed under GPLv3, will it infect everything else with GPLv3
The intention is that if you'd use this plugin sources to create something else, and/or redistribute it (as is or modified), then that would indeed be infected with GPLv3. But for the purpose of simply using the plugin in Sublime Text the GPLv3 terms shouldn't apply any restrictions/requirements.
Who killed Laura Palmer
One day, my log will have something to say about this.
Credits
- SubRip / SRT syntax definition is based on this implementation, converted to
.sublime-syntax
format with SublimeSyntaxConvertor tool - timecode parsing and composing is based on the code from srt-shift
- thanks to:
- OdatNurd for his Plugin 101 - How to write Packages for Sublime video-course
- friendly and helpful Sublime Text community for answering my (sometimes stupid) questions