screenkit 0.0.4 → 0.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d1010cc6a63c96fc1409b7e33b173771f50646520afea83e9a9c11b7f42f43df
4
- data.tar.gz: 9af10edc121c4300acf534f59eddc51a7839e279edde1645baec400c6d174267
3
+ metadata.gz: 97a973d1c6ae7d7c373be709a2233a0b935fae81c706f312c03664e730088780
4
+ data.tar.gz: 2bf3c1093ee252e020635ef4f98632975eab1c77436e0769d9b2a3c107cd228c
5
5
  SHA512:
6
- metadata.gz: e1563930fb9c655d0eaf0773eecf483d569bd7309c60dff6eaee93f5e3de37dcffb560eca87460eb42e6313360ef790130869349da6681fe049b0fa8a3afb4e5
7
- data.tar.gz: 17e96162245fb27560a12698aa4e2ce1f0d52534e548205d95fd4fb2813fb61100141373114cf8b485beb1c9b4fa7f117a283a6b4a289a03463189dfdc2088ec
6
+ metadata.gz: 78c95717248ebfa4fab374c612656813bdf6cd0add77dd1c4dfdc65505033c793b73c1645daeb5742670dfc0e6e5aef84100fabd5ec8cc15a011e95d88fa62e0
7
+ data.tar.gz: 1cca22fd0d8f922fc245be632fcbf587968dc99c402615fe8691eb1e1c45415583f8c1fd2f00c9898c3855a14fd6efe3803c3601102fe8965d563288b5acb4c8
@@ -27,13 +27,19 @@ jobs:
27
27
  with:
28
28
  ref: ${{ github.event.inputs.ref }}
29
29
 
30
- - run: >
31
- echo "IMAGE_TAG=${{ (inputs.ref || github.ref_name) == 'main' &&
32
- 'latest' || (inputs.ref || github.ref_name) }}" >> $GITHUB_ENV
30
+ - name: Set image tags
31
+ run: |
32
+ REF="${{ inputs.ref || github.ref_name }}"
33
+
34
+ if [[ "$REF" == "main" ]] || [[ "$REF" == v* ]]; then
35
+ echo "TAGS=-t fnando/screenkit:$REF -t fnando/screenkit:latest" >> $GITHUB_ENV
36
+ else
37
+ echo "TAGS=-t fnando/screenkit:$REF" >> $GITHUB_ENV
38
+ fi
33
39
 
34
40
  - name: Build Docker Image
35
41
  run: |
36
- docker build -t fnando/screenkit:${{ env.IMAGE_TAG }} .
42
+ docker build ${{ env.TAGS }} .
37
43
 
38
44
  - name: Login to Docker Hub
39
45
  uses: docker/login-action@v3
@@ -43,4 +49,4 @@ jobs:
43
49
 
44
50
  - name: Push Docker Image
45
51
  run: |
46
- docker push fnando/screenkit:${{ env.IMAGE_TAG }}
52
+ docker push --all-tags fnando/screenkit
data/CHANGELOG.md CHANGED
@@ -11,13 +11,22 @@ Prefix your message with one of the following:
11
11
  - [Security] in case of vulnerabilities.
12
12
  -->
13
13
 
14
+ ## v0.0.6
15
+
16
+ - [Added] Add `--tts-preset` option to select TTS preset when exporting
17
+ episodes.
18
+
19
+ ## v0.0.5
20
+
21
+ - [Added] Add `--skip-bundler` option to skip bundler when generating projects.
22
+
14
23
  ## v0.0.4
15
24
 
16
- - [Fixed] Fixed Gemfile template that was pointing to a local path.
25
+ - [Fixed] Fix Gemfile template that was pointing to a local path.
17
26
 
18
27
  ## v0.0.3
19
28
 
20
- - [Changed] Do not expand path when creating project/episode.
29
+ - [Changed] Keep path as it is when creating project/episode.
21
30
 
22
31
  ## v0.0.2
23
32
 
data/DOCUMENTATION.md CHANGED
@@ -39,7 +39,74 @@ gem "screenkit"
39
39
  ### Docker
40
40
 
41
41
  ```bash
42
- docker run --shm-size=2g -v $PWD:/source --rm -it docker.io/fnando/screenkit
42
+ $ docker run \
43
+ --platform=linux/amd64 \
44
+ --shm-size=2g \
45
+ -v $PWD:/source \
46
+ --rm -it \
47
+ docker.io/fnando/screenkit new --skip-bundler example
48
+ create Gemfile
49
+ create screenkit.yml
50
+ create resources
51
+ create resources/backtracks/default.aac
52
+ create resources/fonts/open-sans/OFL.txt
53
+ create resources/fonts/open-sans/OpenSans-ExtraBold.ttf
54
+ create resources/fonts/open-sans/OpenSans-SemiBold.ttf
55
+ create resources/fonts/open-sans/README.txt
56
+ create resources/images/logo.png
57
+ create resources/images/watermark.png
58
+ create resources/sounds/chime.mp3
59
+ create resources/sounds/pop.mp3
60
+ create resources/sounds/whoosh.mp3
61
+
62
+ $ cd example
63
+
64
+ $ docker run \
65
+ --platform=linux/amd64 \
66
+ --shm-size=2g \
67
+ -v $PWD:/source \
68
+ --rm -it \
69
+ docker.io/fnando/screenkit episode new --title 'Hello, world!'
70
+ create episodes/001-hello-world/config.yml
71
+ create episodes/001-hello-world/scripts
72
+ create episodes/001-hello-world/scripts/001.txt
73
+ create episodes/001-hello-world/content
74
+ create episodes/001-hello-world/content/001.tape
75
+ create episodes/001-hello-world/resources
76
+ create episodes/001-hello-world/voiceovers
77
+ create episodes/001-hello-world/resources/.keep
78
+ create episodes/001-hello-world/voiceovers/.keep
79
+
80
+ $ docker run \
81
+ --platform=linux/amd64 \
82
+ --shm-size=2g \
83
+ -v $PWD:/source \
84
+ --rm -it \
85
+ docker.io/fnando/screenkit episode export --dir episodes/001-hello-world
86
+ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
87
+ ┃ Terminal to screencast, simplified ┃═╗
88
+ ┃ ███████╗ ██████╗██████╗ ███████╗███████╗███╗ ██╗██╗ ██╗██╗████████╗ ┃ ║
89
+ ┃ ██╔════╝██╔════╝██╔══██╗██╔════╝██╔════╝████╗ ██║██║ ██╔╝██║╚══██╔══╝ ┃ ║
90
+ ┃ ███████╗██║ ██████╔╝█████╗ █████╗ ██╔██╗ ██║█████╔╝ ██║ ██║ ┃ ║
91
+ ┃ ╚════██║██║ ██╔══██╗██╔══╝ ██╔══╝ ██║╚██╗██║██╔═██╗ ██║ ██║ ┃ ║
92
+ ┃ ███████║╚██████╗██║ ██║███████╗███████╗██║ ╚████║██║ ██╗██║ ██║ ┃ ║
93
+ ┃ ╚══════╝ ╚═════╝╚═╝ ╚═╝╚══════╝╚══════╝╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝ ┃ ║
94
+ ┃ v0.0.5 ┃ ║
95
+ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ║
96
+ ╚══════════════════════════════════════════════════════════════════════════╝
97
+
98
+ info Project root dir: .
99
+ info Episode root dir: episodes/001-hello-world
100
+ info Matching all 1 segments
101
+ info Exported intro in 2.39s
102
+ info Exported outro in 2.11s
103
+ info Generated voiceover in 0.89s
104
+ info Exported videos in 0.00s
105
+ info Created callouts in 0.00s
106
+ info Created segments in 2.55s
107
+ info Merged videos in 8.31s
108
+ info Exported video to output/001-hello-world/001-hello-world.mp4
109
+ info Exported episode in 16.29s
43
110
  ```
44
111
 
45
112
  Notice that Chrome requires a lot of memory, so you need `--shm-size=2g` (or
@@ -138,7 +205,8 @@ Export an episode to video.
138
205
  **Options:**
139
206
 
140
207
  - `--dir` (required) - Episode directory path
141
- - `--voice-api-key` - API key for TTS service (e.g., ElevenLabs)
208
+ - `--tts-api-key` - API key for TTS service (e.g., ElevenLabs)
209
+ - `--tts-preset` - TTS preset name that will be used
142
210
  - `--overwrite` - Overwrite existing exported files (default: `false`)
143
211
  - `--match-segment` - Only export segments matching this string
144
212
  - `--output-dir` - Custom output directory path
@@ -220,12 +288,12 @@ watermark:
220
288
  watermark: false
221
289
  ```
222
290
 
223
- ### Callout Definitions
291
+ ### Callout Styles
224
292
 
225
293
  Define reusable callout styles:
226
294
 
227
295
  ```yaml
228
- callouts:
296
+ callout_styles:
229
297
  shadow_block:
230
298
  background_color: "#ffff00"
231
299
  shadow: "#2242d3" # Color string or false
@@ -290,8 +358,9 @@ backtrack: false # Disable for this episode
290
358
 
291
359
  # Override TTS settings
292
360
  tts:
293
- engine: elevenlabs
294
- voice_id: custom_voice_id
361
+ - id: eleven_labs
362
+ engine: eleven_labs
363
+ voice_id: custom_voice_id
295
364
 
296
365
  # Override watermark
297
366
  watermark: false
@@ -642,9 +711,10 @@ Uses the built-in macOS `say` command.
642
711
 
643
712
  ```yaml
644
713
  tts:
645
- engine: say
646
- voice: Alex # Optional: Voice name
647
- rate: 150 # Words per minute (optional)
714
+ - id: say
715
+ engine: say
716
+ voice: Alex # Optional: Voice name
717
+ rate: 150 # Words per minute (optional)
648
718
  ```
649
719
 
650
720
  ### ElevenLabs Engine
@@ -653,22 +723,23 @@ Professional AI voice synthesis.
653
723
 
654
724
  ```yaml
655
725
  tts:
656
- engine: elevenlabs
657
- voice_id: "56AoDkrOh6qfVPDXZ7Pt" # Required: ElevenLabs voice ID
658
- language_code: en # 2-letter language code
659
-
660
- # Optional: Voice settings
661
- voice_settings:
662
- speed: 0.9 # Speech speed (default: 1.0)
663
- stability: 0.5 # Voice stability (0.0 - 1.0)
664
- similarity: 0.75 # Voice similarity (0.0 - 1.0)
665
- style: 0.0 # Speaking style (0.0+)
666
-
667
- # Optional: Output format
668
- output_format: mp3_44100_128
669
-
670
- # Optional: Model ID
671
- model_id: eleven_monolingual_v1
726
+ - id: eleven_labs
727
+ engine: eleven_labs
728
+ voice_id: "56AoDkrOh6qfVPDXZ7Pt" # Required: ElevenLabs voice ID
729
+ language_code: en # 2-letter language code
730
+
731
+ # Optional: Voice settings
732
+ voice_settings:
733
+ speed: 0.9 # Speech speed (default: 1.0)
734
+ stability: 0.5 # Voice stability (0.0 - 1.0)
735
+ similarity: 0.75 # Voice similarity (0.0 - 1.0)
736
+ style: 0.0 # Speaking style (0.0+)
737
+
738
+ # Optional: Output format
739
+ output_format: mp3_44100_128
740
+
741
+ # Optional: Model ID
742
+ model_id: eleven_monolingual_v1
672
743
  ```
673
744
 
674
745
  #### ElevenLabs Output Formats
@@ -729,10 +800,11 @@ end
729
800
 
730
801
  ```yaml
731
802
  tts:
732
- engine: custom_engine # Camelized to CustomEngine
733
- # Add your custom options here
734
- api_key: your_api_key
735
- custom_option: value
803
+ - id: custom_engine
804
+ engine: custom_engine # Camelized to CustomEngine
805
+ # Add your custom options here
806
+ api_key: your_api_key
807
+ custom_option: value
736
808
  ```
737
809
 
738
810
  The engine name is camelized (e.g., `custom_engine` → `CustomEngine`,
@@ -839,7 +911,7 @@ Today we'll learn how to create amazing screencasts.
839
911
 
840
912
  Files are matched by number:
841
913
 
842
- - `content/001.tape` → `scripts/001.txt` → `voiceovers/001.aiff`
914
+ - `content/001.tape` → `scripts/001.txt` → `voiceovers/001.:ext`
843
915
  - Segments are processed in numerical order
844
916
  - Missing scripts create silent segments
845
917
 
@@ -962,7 +1034,7 @@ ScreenKit validates configurations against JSON schemas:
962
1034
  Use the `yaml-language-server` comment for IDE support:
963
1035
 
964
1036
  ```yaml
965
- # yaml-language-server: $schema=../../schemas/project.json
1037
+ # yaml-language-server: $schema=https://screenkit.dev/schemas/project.json
966
1038
  ```
967
1039
 
968
1040
  ---
@@ -1048,8 +1120,9 @@ bundle exec screenkit ...
1048
1120
 
1049
1121
  **TTS not working:**
1050
1122
 
1051
- - For ElevenLabs: Set `--voice-api-key`
1123
+ - For ElevenLabs: Set `--tts-api-key`
1052
1124
  - For macOS `say`: Verify voice name with `say -v ?`
1125
+ - For `espeak`: Ensure `espeak` is installed and in PATH
1053
1126
 
1054
1127
  ---
1055
1128
 
data/Dockerfile CHANGED
@@ -34,6 +34,7 @@ RUN apk add --no-cache \
34
34
  chromium \
35
35
  chromium-chromedriver \
36
36
  curl \
37
+ espeak \
37
38
  fish \
38
39
  ffmpeg \
39
40
  font-liberation \
@@ -55,6 +55,9 @@ module ScreenKit
55
55
  type: :array,
56
56
  default: [],
57
57
  desc: "Additional Ruby files to require"
58
+ option :tts_preset,
59
+ type: :string,
60
+ desc: "Preset voice configuration for TTS"
58
61
  def export
59
62
  puts Banner.banner if options.banner
60
63
 
@@ -7,6 +7,10 @@ module ScreenKit
7
7
  subcommand "episode", CLI::Episode
8
8
 
9
9
  desc "new PATH", "Create a new project"
10
+ option :bundler,
11
+ type: :boolean,
12
+ desc: "Run bundle install after generating the project",
13
+ default: true
10
14
  def new(path)
11
15
  generator = Generators::Project.new
12
16
  generator.destination_root = path
@@ -38,7 +38,7 @@ module ScreenKit
38
38
  end
39
39
 
40
40
  def tts_available?
41
- tts_engines.any?(&:available?)
41
+ tts_engine
42
42
  end
43
43
 
44
44
  def demotape_options
@@ -46,7 +46,14 @@ module ScreenKit
46
46
  end
47
47
 
48
48
  def tts_engine
49
- tts_engines.find(&:available?)
49
+ @tts_engine ||=
50
+ if options.tts_preset
51
+ tts_engines.find do |engine|
52
+ engine.id == options.tts_preset && engine.available?
53
+ end
54
+ else
55
+ tts_engines.find(&:available?)
56
+ end
50
57
  end
51
58
 
52
59
  def tts_engines
@@ -294,9 +294,9 @@ module ScreenKit
294
294
  "#{prefix}-#{index}.{png,#{ContentType.video.join(',')}}"
295
295
  ).first
296
296
 
297
- raise "Callout file not found for #{prefix}-#{index}" unless callout_path
297
+ return callout_path if callout_path
298
298
 
299
- callout_path
299
+ raise "Callout file not found for #{prefix}-#{index}"
300
300
  end
301
301
 
302
302
  def video_callout?(callout_path)
@@ -84,23 +84,51 @@ watermark:
84
84
  # Each TTS engine has its own detection mechanism. For instance, say and espeak
85
85
  # checks for a binary with the same name. ElevenLabs checks for the presence of
86
86
  # `--tts-api-key`.
87
+ #
88
+ # You can have multiple presets for the same engine. Just set a different
89
+ # configuration block using a different `id`. Then, when you're exporting the
90
+ # video, you can use `--tts-preset <id>`. If you don't provide a preset, the
91
+ # first available engine will be used.
87
92
  tts:
88
93
  # Apple Say TTS engine configuration.
89
- - engine: say
94
+ - id: say
95
+ engine: say
96
+ rate: 150
97
+ enabled: true
98
+
99
+ # Apple Say TTS engine configuration.
100
+ - id: say_pt_br
101
+ engine: say
102
+ voice: "Luciana"
90
103
  rate: 150
91
104
  enabled: true
92
105
 
93
106
  # eSpeak TTS engine configuration.
94
- - engine: espeak
107
+ - id: espeak
108
+ engine: espeak
95
109
  rate: 150
96
110
  voice: en-us
97
111
  enabled: true
98
112
 
99
113
  # Eleven Labs TTS engine configuration.
100
- - engine: eleven_labs
114
+ - id: eleven_labs
115
+ engine: eleven_labs
116
+ enabled: true
117
+ voice_id: 56AoDkrOh6qfVPDXZ7Pt
118
+ language_code: en
119
+ voice_settings:
120
+ speed: 0.9
121
+ stability: 0.5
122
+ similarity: 0.75
123
+ style: 0.0
124
+
125
+ # Eleven Labs TTS engine configuration.
126
+ - id: eleven_labs_mp3_192k
127
+ engine: eleven_labs
101
128
  enabled: true
102
129
  voice_id: 56AoDkrOh6qfVPDXZ7Pt
103
130
  language_code: en
131
+ output_format: mp3_44100_192
104
132
  voice_settings:
105
133
  speed: 0.9
106
134
  stability: 0.5
@@ -25,6 +25,8 @@ module ScreenKit
25
25
  end
26
26
 
27
27
  def bundle_install
28
+ return unless options.bundler
29
+
28
30
  in_root do
29
31
  run "bundle install"
30
32
  end
@@ -7,9 +7,13 @@
7
7
  { "$ref": "../tts/elevenlabs.json" },
8
8
  {
9
9
  "type": "object",
10
- "required": ["engine"],
10
+ "required": ["engine", "id"],
11
11
  "additionalProperties": true,
12
12
  "properties": {
13
+ "id": {
14
+ "type": "string",
15
+ "description": "A unique identifier for the tts configuration"
16
+ },
13
17
  "engine": {
14
18
  "type": "string",
15
19
  "description": "The TTS engine to use",
@@ -3,9 +3,12 @@
3
3
  "$id": "https://screenkit.dev/schemas/tts/elevenlabs.json",
4
4
  "title": "The ElevenLabs voice engine options",
5
5
  "type": "object",
6
- "required": ["voice_id", "engine"],
7
- "additionalProperties": false,
6
+ "required": ["voice_id"],
8
7
  "properties": {
8
+ "id": {
9
+ "type": "string",
10
+ "description": "A unique identifier for the tts configuration"
11
+ },
9
12
  "enabled": {
10
13
  "type": "boolean"
11
14
  },
@@ -3,9 +3,11 @@
3
3
  "$id": "https://screenkit.dev/schemas/tts/espeak.json",
4
4
  "title": "espeak synthesizer for English and other languages",
5
5
  "type": "object",
6
- "required": ["engine"],
7
- "additionalProperties": false,
8
6
  "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "description": "A unique identifier for the tts configuration"
10
+ },
9
11
  "enabled": {
10
12
  "type": "boolean"
11
13
  },
@@ -3,9 +3,11 @@
3
3
  "$id": "https://screenkit.dev/schemas/tts/say.json",
4
4
  "title": "The Apple `say` voice engine options",
5
5
  "type": "object",
6
- "additionalProperties": false,
7
- "required": ["engine"],
8
6
  "properties": {
7
+ "id": {
8
+ "type": "string",
9
+ "description": "A unique identifier for the tts configuration"
10
+ },
9
11
  "enabled": {
10
12
  "type": "boolean"
11
13
  },
@@ -8,9 +8,13 @@ module ScreenKit
8
8
  # Additional options for the tts engine.
9
9
  attr_reader :options
10
10
 
11
- def initialize(enabled: true, **options)
11
+ # The preset name for the tts engine.
12
+ attr_reader :id
13
+
14
+ def initialize(id: nil, enabled: true, **options)
12
15
  @enabled = enabled
13
16
  @options = options
17
+ @id = id
14
18
  end
15
19
 
16
20
  def enabled?
@@ -2,7 +2,7 @@
2
2
 
3
3
  module ScreenKit
4
4
  module Utils
5
- def has_audio?(path)
5
+ def has_audio?(path) # rubocop:disable Naming/PredicatePrefix
6
6
  cmd = "ffprobe -v error -select_streams a:0 -show_entries " \
7
7
  "stream=codec_type -of default=noprint_wrappers=1:nokey=1"
8
8
  `#{cmd} #{path}`.strip == "audio"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ScreenKit
4
- VERSION = "0.0.4"
4
+ VERSION = "0.0.6"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: screenkit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nando Vieira
@@ -385,10 +385,10 @@ metadata:
385
385
  rubygems_mfa_required: 'true'
386
386
  homepage_uri: https://github.com/fnando/screenkit
387
387
  bug_tracker_uri: https://github.com/fnando/screenkit/issues
388
- source_code_uri: https://github.com/fnando/screenkit/tree/v0.0.4
389
- changelog_uri: https://github.com/fnando/screenkit/tree/v0.0.4/CHANGELOG.md
390
- documentation_uri: https://github.com/fnando/screenkit/tree/v0.0.4/README.md
391
- license_uri: https://github.com/fnando/screenkit/tree/v0.0.4/LICENSE.md
388
+ source_code_uri: https://github.com/fnando/screenkit/tree/v0.0.6
389
+ changelog_uri: https://github.com/fnando/screenkit/tree/v0.0.6/CHANGELOG.md
390
+ documentation_uri: https://github.com/fnando/screenkit/tree/v0.0.6/README.md
391
+ license_uri: https://github.com/fnando/screenkit/tree/v0.0.6/LICENSE.md
392
392
  rdoc_options: []
393
393
  require_paths:
394
394
  - lib