Skip to content

Commit

Permalink
Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TDHM committed May 13, 2023
1 parent 303542d commit 376d3f7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 7 deletions.
1 change: 1 addition & 0 deletions docs/cli_reference.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
::: subtitles_translator.cli
27 changes: 22 additions & 5 deletions docs/how_to.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
### Usage
!!! note
Please note that the current version only supports MP4 video files (MKV support coming soon).
Your MP4 must contain only one subtitles track, which will be translated and replaced in a new MP4 file.

Please note that the current version only supports MP4 video files (MKV support coming soon).
Your MP4 must contain only one subtitles track, which will be translated and replaced in a new MP4 file.
You can also translates SRT subtitles files, or extract and translate SRT files from a MP4 (look at the doc!).
## MP4 to MP4

With the following command, subtitles from 'video.mp4' will be extracted and translated from 'french' to 'english'. The video containing translated subtitles will be saved as 'translated_video.mp4':

```shell
subtitles_translator -i video.mp4 -o translated_video.mp4 -s fr -t en
subtitles_translator -i video.mp4 -o translated_video.mp4 -s fr -t en
```

## MP4 to SRT

With the following command, subtitles from 'video.mp4' will be extracted and translated from 'french' to 'english'. Translated subtitles will be saved as 'translated.srt'

```shell
subtitles_translator -i video.mp4 -o translated.srt -s fr -t en
```

## SRT to SRT

With the following command, subtitles contained in the SRT file "source.srt" will be translated from 'french' to 'english'. Translated subtitles will be saved as 'translated.srt'

```shell
subtitles_translator -i "source.srt" -o translated.srt -s fr -t en
```
4 changes: 2 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ repo_name: tdhm/subtitles-translator

nav:
- Subtitles Translator Doc: index.md
- Google Docstring test: google_docstring.md
- Getting started:
- Installation: installation.md
- How-to guide: how_to.md
Expand Down Expand Up @@ -57,4 +56,5 @@ markdown_extensions:
- toc:
permalink: true
- pymdownx.arithmatex:
generic: true
generic: true
- admonition

0 comments on commit 376d3f7

Please sign in to comment.