Crates.io | title_parser |
lib.rs | title_parser |
version | 0.1.2 |
source | src |
created_at | 2021-11-10 06:57:35.756778 |
updated_at | 2021-11-12 06:36:53.644387 |
description | Library for parsing SRT and VTT title cues |
homepage | |
repository | https://github.com/internet-diglett/title_parser |
max_upload_size | |
id | 479533 |
size | 21,305 |
Rust library for extracting plain text from SRT and WebVTT Subtitle Cues.
These instructions will give you a copy of the project up and running on your local machine for development and testing purposes.
Requirements for the software and other tools to build, test and push
Add crate to your Cargo.toml
[dependencies]
title_parser = "0.1.2"
To parse a cue, such as:
1 - Cue Identifier
00:01:14.815 --> 00:01:18.114
- I'm text for a cue
- Me too!
You can import the trait to convert the cue string into a struct:
use title_parser::{CueTrait};
let text = "1 - Cue\n00:01:14.815 --> 00:01:18.114\n- I'm text for a cue\n- Me too!";
let cue = text.to_cue().unwrap();
assert_eq!(cue.text, "I'm text for a cue\nMe too!");
cargo test
Opens local docsite for library and dependencies. Displays useful usage information
cargo docs --open
Checks if the best practices and the right coding style has been used.
cargo clippy
and
cargo fmt
Add additional notes to deploy this on a live system
We use Semantic Versioning for versioning. For the versions available, see the tags on this repository.
Levon Tarver - Primary Maintainer - internet-diglett
See also the list of contributors who participated in this project.
This project is licensed under the MIT License - see the LICENSE file for details