j1-template 2023.7.0 → 2023.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/_includes/themes/j1/modules/searcher/procedures/topsearch.proc +2 -1
- data/_includes/themes/j1/procedures/global/create_bs_button.proc +0 -1
- data/_includes/themes/j1/procedures/global/create_word_cloud.proc +3 -2
- data/_includes/themes/j1/procedures/global/date-german.proc +2 -7
- data/_includes/themes/j1/procedures/global/get_category.proc +13 -19
- data/_includes/themes/j1/procedures/global/get_category_item.proc +29 -33
- data/_includes/themes/j1/procedures/global/get_documents_dir.proc +8 -8
- data/_includes/themes/j1/procedures/global/get_page_url.proc +9 -14
- data/_includes/themes/j1/procedures/global/select_color.proc +12 -17
- data/_includes/themes/j1/procedures/global/select_font_size.proc +31 -35
- data/_includes/themes/j1/procedures/global/select_icon_size.proc +38 -40
- data/_includes/themes/j1/procedures/global/select_location.proc +56 -59
- data/_includes/themes/j1/procedures/global/set_base_vars_folders.proc +2 -4
- data/_includes/themes/j1/procedures/global/set_image_block.proc +4 -2
- data/_includes/themes/j1/procedures/global/setup.proc +8 -3
- data/assets/data/masonry.html +13 -13
- data/assets/themes/j1/adapter/js/masterslider.js +2 -1
- data/assets/themes/j1/adapter/js/slick.js +13 -10
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.css +70 -0
- data/assets/themes/j1/core/css/themes/unolight/bootstrap.min.css +1 -1
- data/assets/themes/j1/core/js/template.js +1339 -3
- data/assets/themes/j1/core/js/template.min.js +7 -7
- data/assets/themes/j1/core/js/template.min.js.map +1 -1
- data/assets/themes/j1/modules/carousel/css/theme/uno.css +5 -0
- data/assets/themes/j1/modules/carousel/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/masonry/css/theme/readme +1 -0
- data/assets/themes/j1/modules/masterslider/css/theme/uno.css +2 -3
- data/assets/themes/j1/modules/masterslider/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.css +13 -2
- data/assets/themes/j1/modules/slick/lightbox/css/theme/uno.min.css +1 -1
- data/assets/themes/j1/modules/slick/lightbox/js/slick-lightbox.js +373 -347
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.css +20 -51
- data/assets/themes/j1/modules/slick/slider/css/theme/uno.min.css +2 -2
- data/lib/j1/version.rb +1 -1
- data/lib/starter_web/Gemfile +2 -2
- data/lib/starter_web/README.md +5 -5
- data/lib/starter_web/_config.yml +1 -1
- data/lib/starter_web/_data/blocks/banner.yml +8 -9
- data/lib/starter_web/_data/blocks/footer.yml +3 -3
- data/lib/starter_web/_data/modules/masonry.yml +9 -1
- data/lib/starter_web/_data/modules/masterslider.yml +69 -116
- data/lib/starter_web/_data/modules/navigator_menu.yml +58 -51
- data/lib/starter_web/_data/resources.yml +3 -3
- data/lib/starter_web/_data/templates/feed.xml +1 -1
- data/lib/starter_web/_includes/attributes.asciidoc +1 -0
- data/lib/starter_web/_plugins/asciidoctor/callout.rb +2 -2
- data/lib/starter_web/_plugins/asciidoctor/masterslider-block.rb +1 -1
- data/lib/starter_web/_plugins/asciidoctor/slick-block.rb +1 -1
- data/lib/starter_web/_plugins/index/lunr.rb +1 -1
- data/lib/starter_web/assets/images/collections/books/biography/a_life_in_questions.jpg +0 -0
- data/lib/starter_web/collections/posts/public/featured/_posts/0000-00-00-welcome-to-j1.adoc.erb +5 -5
- data/lib/starter_web/index.html +6 -6
- data/lib/starter_web/package.json +1 -1
- data/lib/starter_web/pages/public/blog/navigator/archive/categoryview.html +0 -1
- data/lib/starter_web/pages/public/tools/previewer/preview_bootstrap_theme.adoc +148 -140
- data/lib/starter_web/utilsrv/_defaults/package.json +1 -1
- data/lib/starter_web/utilsrv/package.json +1 -1
- metadata +3 -75
- data/assets/themes/j1/modules/carousel/js/carousel.js +0 -1517
- data/assets/themes/j1/modules/carousel/js/carousel.min.js +0 -57
- data/assets/themes/j1/modules/masonry/css/theme/uno.css +0 -35
- data/assets/themes/j1/modules/masonry/css/theme/uno.min.css +0 -15
- data/assets/themes/j1/modules/speak2me/LICENSE +0 -21
- data/assets/themes/j1/modules/speak2me/js/speak2me.js +0 -947
- data/assets/themes/j1/modules/speak2me/js/speak2me.min.js +0 -26
- data/lib/starter_web/_data/modules/buymeacoffee.yml +0 -30
- data/lib/starter_web/_data/modules/defaults/buymeacoffee.yml +0 -30
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-restaurant-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-restaurant.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-man-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-man.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-woman-140x80.jpg +0 -0
- data/lib/starter_web/assets/images/modules/masterslider/slider_5/ms-free-food-single-woman.jpg +0 -0
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/attributes.asciidoc +0 -58
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/accordion.asciidoc +0 -34
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/alerts.asciidoc +0 -15
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/badges.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/body.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/breadcrumbs.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/buttons.asciidoc +0 -75
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/cards.asciidoc +0 -22
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/carousel.asciidoc +0 -37
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/close.asciidoc +0 -15
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/code.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/color_system.asciidoc +0 -353
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/components.asciidoc +0 -69
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/dropdowns.asciidoc +0 -53
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/figures.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/forms.asciidoc +0 -270
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/grid.asciidoc +0 -49
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/links.asciidoc +0 -21
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/list_groups.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/modals.asciidoc +0 -43
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navbar.asciidoc +0 -45
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/navs.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/offcanvas.asciidoc +0 -16
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/options.asciidoc +0 -30
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/pagination.asciidoc +0 -40
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/paragraph.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/placeholders.asciidoc +0 -5
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/popovers.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/position.asciidoc +0 -8
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/progress_bars.asciidoc +0 -12
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spacing.asciidoc +0 -14
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/spinners.asciidoc +0 -12
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tables.asciidoc +0 -55
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/thumbnails.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/toasts.asciidoc +0 -18
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/tooltips.asciidoc +0 -28
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/typography.asciidoc +0 -115
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/documents/z_index.asciidoc +0 -26
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/_table.asciidoc +0 -9
- data/lib/starter_web/pages/public/learn/bs_sass_variables/_includes/tables/accordion.asciidoc +0 -87
- data/lib/starter_web/pages/public/learn/bs_sass_variables/bs_sass_variables.adoc +0 -267
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/attributes.asciidoc +0 -59
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/100_chapter.asciidoc +0 -541
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/documents/200_chapter.asciidoc +0 -33
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/build_command_options.asciidoc +0 -72
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/files_and_folders.asciidoc +0 -66
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_configuration_options.asciidoc +0 -63
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/global_variables.asciidoc +0 -26
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/page_variables.asciidoc +0 -54
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/serve_command_options.asciidoc +0 -45
- data/lib/starter_web/pages/public/learn/core_web_vitals/_includes/tables/site_variables.asciidoc +0 -59
- data/lib/starter_web/pages/public/learn/core_web_vitals/core_web_vitals.adoc +0 -447
- data/lib/starter_web/pages/public/learn/roundtrip/lunr_search.1.asciidoc +0 -460
- data/lib/starter_web/pages/public/manuals/speak2me.adoc +0 -412
- data/lib/starter_web/pages/public/tools/cheatsheet/gem.adoc +0 -259
- data/lib/starter_web/pages/public/tools/cheatsheet/git.adoc +0 -1462
- data/lib/starter_web/pages/public/tools/cheatsheet/j1.adoc +0 -177
- data/lib/starter_web/pages/public/tools/cheatsheet/yaml.adoc +0 -522
@@ -1,412 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Speak2Me
|
3
|
-
title_extention: J1 Module for Speech Synthesise (TTS)
|
4
|
-
tagline: Screen Reader for J1 Template
|
5
|
-
|
6
|
-
date: 2023-07-26
|
7
|
-
#last_modified: 2023-01-01
|
8
|
-
|
9
|
-
description: >
|
10
|
-
Speak2Me for J1 Template is a speech synthesise module that enables a
|
11
|
-
so-called screen reader. The reader functionality allows users to sit back
|
12
|
-
and listen to the browser read aloud the important contents on a Web page.
|
13
|
-
keywords: >
|
14
|
-
open source, free, template, jekyll, jekyllone, web,
|
15
|
-
sites, static, jamstack, bootstrap,
|
16
|
-
speech, synthesise, sst, j1 module, jquery
|
17
|
-
|
18
|
-
categories: [ Module ]
|
19
|
-
tags: [ Speech Synthesise, jQuery ]
|
20
|
-
|
21
|
-
regenerate: true
|
22
|
-
permalink: /pages/public/modules/speak2me/
|
23
|
-
|
24
|
-
resources: [ animate, clipboard, lightbox, rouge ]
|
25
|
-
resource_options:
|
26
|
-
- attic:
|
27
|
-
slides:
|
28
|
-
- url: /assets/images/pages/roundtrip/images-1920x1280-bw.jpg
|
29
|
-
alt: Photo by Ricardo Gomez Angel on Unsplash
|
30
|
-
badge:
|
31
|
-
type: unsplash
|
32
|
-
author: Ricardo Gomez Angel
|
33
|
-
href: https://unsplash.com/@ripato/portfolio
|
34
|
-
---
|
35
|
-
|
36
|
-
// Page Initializer
|
37
|
-
// =============================================================================
|
38
|
-
// Enable the Liquid Preprocessor
|
39
|
-
:page-liquid:
|
40
|
-
|
41
|
-
// Set (local) page attributes here
|
42
|
-
// -----------------------------------------------------------------------------
|
43
|
-
// :page--attr: <attr-value>
|
44
|
-
|
45
|
-
// Load Liquid procedures
|
46
|
-
// -----------------------------------------------------------------------------
|
47
|
-
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
48
|
-
|
49
|
-
// Load page attributes
|
50
|
-
// -----------------------------------------------------------------------------
|
51
|
-
{% include {{load_attributes}} scope="none" %}
|
52
|
-
|
53
|
-
// Page content
|
54
|
-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
55
|
-
// https://github.com/mdn/dom-examples/tree/main/web-speech-api
|
56
|
-
// https://mdn.github.io/dom-examples/web-speech-api/speak-easy-synthesis/
|
57
|
-
// https://stackoverflow.com/questions/11279291/a-good-text-to-speech-javascript-library
|
58
|
-
// https://codepen.io/meetselva/pen/EVaLmP
|
59
|
-
// https://dev.to/jankapunkt/cross-browser-speech-synthesis-the-hard-way-and-the-easy-way-353
|
60
|
-
//
|
61
|
-
[role="dropcap"]
|
62
|
-
Speech synthesis is an application programming interface (API) in web
|
63
|
-
development that allows web browsers to generate synthesized speech,
|
64
|
-
commonly known as text-to-speech (TTS). It enables developers to incorporate
|
65
|
-
speech synthesis functionality into web pages, applications, and other
|
66
|
-
online experiences.
|
67
|
-
|
68
|
-
With the speech synthesis API, you can convert text into speech, and the
|
69
|
-
synthesized speech can then be played through the user's speakers or
|
70
|
-
headphones. Spoken content is especially useful for making web content
|
71
|
-
more accessible to individuals with visual impairments and for adding
|
72
|
-
interactive voice elements to web applications.
|
73
|
-
|
74
|
-
// Include sub-documents (if any)
|
75
|
-
// -----------------------------------------------------------------------------
|
76
|
-
[role="mt-5"]
|
77
|
-
== Installation
|
78
|
-
|
79
|
-
Speak2Me is a jQuery plugin that enables developers, with as little as
|
80
|
-
one line of code, to create links that allow users to click, sit back, and
|
81
|
-
listen to the browser read aloud the important content on a Web page.
|
82
|
-
In some ways, it can turn a thoughtful essay or article into a mini podcast.
|
83
|
-
And because it uses built-in JavaScript functionality, no browser extensions
|
84
|
-
or other system software is needed.
|
85
|
-
|
86
|
-
Simply include the `speak2me.js` or `speak2me.min.js` file in your project.
|
87
|
-
|
88
|
-
[role="mt-5"]
|
89
|
-
== API Reference
|
90
|
-
|
91
|
-
Leverage the powerful selector options of jQuery to specify which parts
|
92
|
-
of the Web page that you want spoken. For example, depending on how you
|
93
|
-
have the Web page organized, a single line of code, like the following,
|
94
|
-
can direct Speak2Me to speak the entire contents of an article or a
|
95
|
-
blog post.
|
96
|
-
|
97
|
-
[source, javascript]
|
98
|
-
----
|
99
|
-
$('article').speak2me('speak')
|
100
|
-
----
|
101
|
-
|
102
|
-
Or how about only the primary headers and paragraphs
|
103
|
-
|
104
|
-
[source, javascript]
|
105
|
-
----
|
106
|
-
$('h1,h2,p').speak2me('speak')
|
107
|
-
----
|
108
|
-
|
109
|
-
NOTE: Internally, Speak2Me clones the matched set of elements and all
|
110
|
-
their descendant elements and text nodes. It then parses this clone
|
111
|
-
using a default set of rules, deciding what should be spoken and
|
112
|
-
ignored, then adding the appropriate pauses to make everything sound
|
113
|
-
more like a narrative.
|
114
|
-
|
115
|
-
=== Examples
|
116
|
-
|
117
|
-
Do not speak the content of `<h5>`, `<h6>`, and `<em>` tags.
|
118
|
-
[source, javascript]
|
119
|
-
----
|
120
|
-
$().speak2me('ignore','h5','h6','em')
|
121
|
-
----
|
122
|
-
|
123
|
-
Speak the content of `<button>` and `<code>` tags.
|
124
|
-
[source, javascript]
|
125
|
-
----
|
126
|
-
$().speak2me('recognize','button','code')
|
127
|
-
----
|
128
|
-
|
129
|
-
When `i.e.` is encountered, say `That is`.
|
130
|
-
[source, javascript]
|
131
|
-
----
|
132
|
-
$().speak2me('replace','i.e.','That is')
|
133
|
-
----
|
134
|
-
|
135
|
-
Change default intro text spoken when an HTML tga `<img>` is
|
136
|
-
encountered.
|
137
|
-
[source, javascript]
|
138
|
-
----
|
139
|
-
$().speak2me('customize','img','Embedded')
|
140
|
-
----
|
141
|
-
|
142
|
-
Change default intro and outro text spoken when an HTML tag `<ol>`
|
143
|
-
is encountered.
|
144
|
-
[source, javascript]
|
145
|
-
----
|
146
|
-
$().speak2me('customize','ol','Start of numbered List.','End of Numbered List')
|
147
|
-
----
|
148
|
-
|
149
|
-
=== Base Functions
|
150
|
-
|
151
|
-
[cols="6a,6a", options="header", width="100%", role="rtable"]
|
152
|
-
|===
|
153
|
-
|Method |Description
|
154
|
-
|
155
|
-
|`$(selector).speak2me('speak')`
|
156
|
-
|Speaks aloud the specified DOM element(s) and their descendants.
|
157
|
-
|
158
|
-
|`$().speak2me('pause')`
|
159
|
-
|Pauses the speaking.
|
160
|
-
|
161
|
-
|`$().speak2me('resume')`
|
162
|
-
|Resumes the speaking after it has been paused.
|
163
|
-
|
164
|
-
|`$().speak2me('stop')`
|
165
|
-
|Stops the speaking permanently.
|
166
|
-
|
167
|
-
|===
|
168
|
-
|
169
|
-
=== Voice Parameters
|
170
|
-
|
171
|
-
[cols="4a,5a,3", options="header", width="100%", role="rtable"]
|
172
|
-
|===
|
173
|
-
|Method |Description |Default\|Range
|
174
|
-
|
175
|
-
|`$().speak2me('rate', number)`
|
176
|
-
|Sets the rate of the speaking voice.
|
177
|
-
|Default: 1.1 +
|
178
|
-
Range: [0.1 - 10.0]
|
179
|
-
|
180
|
-
|`$().speak2me('pitch', number)`
|
181
|
-
|Sets the pitch of the speaking voice.
|
182
|
-
|Default: 1.0 +
|
183
|
-
Range: [0.0 - 2.0]
|
184
|
-
|
185
|
-
|`$().speak2me('volume', number)`
|
186
|
-
|Sets the volume of the speaking voice.
|
187
|
-
|Default: 1.0 +
|
188
|
-
Range: [0.0 - 1.0]
|
189
|
-
|===
|
190
|
-
|
191
|
-
NOTE: Omitting number resets the parameter to its default value;
|
192
|
-
changes take effect only when next speak call is made
|
193
|
-
|
194
|
-
=== Read-Only Attributes
|
195
|
-
|
196
|
-
[cols="6a,6a", options="header", width="100%", role="rtable"]
|
197
|
-
|===
|
198
|
-
|Method |Description
|
199
|
-
|`$().speak2me('enabled')`
|
200
|
-
|Returns `true`\|`false` specifying whether the browser supports
|
201
|
-
the Web *Speech API*.
|
202
|
-
|
203
|
-
|`$().speak2me('isSpeaking')`
|
204
|
-
|Returns `true`\|`false` specifying whether speaking has not
|
205
|
-
yet been completed or stopped.
|
206
|
-
|
207
|
-
|`$().speak2me('isPaused')`
|
208
|
-
|Returns `true`\|`false` specifying whether speaking is paused.
|
209
|
-
|===
|
210
|
-
|
211
|
-
NOTE: `$().speak2me('isSpeaking')` returns the value of true even
|
212
|
-
when paused
|
213
|
-
|
214
|
-
=== Get and Set Voices
|
215
|
-
|
216
|
-
NOTE: Language codes consist of two-characters that specify the
|
217
|
-
language, followed by a hyphen, followed by additional characters that
|
218
|
-
specify the particular country or regional dialect of that language. For
|
219
|
-
example, the codes ``en-US'' and ``en-GB'' are both English language,
|
220
|
-
but each represent a different country.
|
221
|
-
|
222
|
-
[cols="6a,6a", options="header", width="100%", role="rtable"]
|
223
|
-
|===
|
224
|
-
|Method |Description
|
225
|
-
|
226
|
-
|`$().speak2me('getVoices')`
|
227
|
-
|Returns an array of voice objects; each object has two properties:
|
228
|
-
`name` and `language`
|
229
|
-
|
230
|
-
|`$().speak2me('getVoices',selector,text)`
|
231
|
-
|Populates the DOM element(s) _selector_ with a dropdown menu for
|
232
|
-
voice selection; optional _text_ overwrites default dropdown menu instruction
|
233
|
-
|
234
|
-
|`$().speak2me('setVoice','name',voice)`
|
235
|
-
|Sets the voice. Must exactly match one of the names returned
|
236
|
-
when using `getVoices`.
|
237
|
-
|
238
|
-
|`$().speak2me('setVoice','language',twoDigit)`
|
239
|
-
|Sets the voice by finding the first voice that matches the _two digit_
|
240
|
-
language code (case-insensitive).
|
241
|
-
|
242
|
-
|`$().speak2me('setVoice','language',code)`
|
243
|
-
|Sets the voice by finding the first voice that exactly matches the
|
244
|
-
complete language code
|
245
|
-
|===
|
246
|
-
|
247
|
-
.Setting a Voice
|
248
|
-
[TIP]
|
249
|
-
====
|
250
|
-
Setting a voice by specifying only a two-digit language code is
|
251
|
-
useful for when you have text on the page in another language, but don’t
|
252
|
-
want to bother checking to see if that language is available. For
|
253
|
-
example, a page otherwise in English may have a paragraph in German that
|
254
|
-
you want spoken. That paragraph can have a link like this:
|
255
|
-
|
256
|
-
`$('p').speak2me('setVoice','language','de').speak2me('speak')`
|
257
|
-
====
|
258
|
-
|
259
|
-
If the German language is available, it will be appropriately spoken. If
|
260
|
-
not, the current voice will remain.
|
261
|
-
|
262
|
-
=== Text Manipulation
|
263
|
-
|
264
|
-
[cols="6a,6a", options="header", width="100%", role="rtable"]
|
265
|
-
|===
|
266
|
-
|Method |Description
|
267
|
-
|
268
|
-
|`$().speak2me('ignore',tagName,tagName,...)`
|
269
|
-
|Adds one or more *HTML tags* to the default array of ignored HTML tags.
|
270
|
-
Omitting _tagName_ clears the array of user-specified ignored HTML tags. +
|
271
|
-
See Reference Information below
|
272
|
-
|
273
|
-
|`$().speak2me('recognize',tagName,tagName,...)`
|
274
|
-
|Removes one or more *HTML tags* from the default array of ignored
|
275
|
-
HTML tags. Omitting _tagName_ clears the array of user-specified
|
276
|
-
recognized HTML tags. +
|
277
|
-
See Reference Information below
|
278
|
-
|
279
|
-
|`$().speak2me('replace',oldText,newText,...)`
|
280
|
-
|Replaces _oldText_ with _newText_ when speaking. This is case-insensitive
|
281
|
-
Multiple pairs of text can be specified. Omitting parameters deletes previous
|
282
|
-
replace commands
|
283
|
-
|
284
|
-
|`$().speak2me('customize',tagName,prepend)`
|
285
|
-
|Replaces default text spoken prior to the description of the *HTML tags*
|
286
|
-
`<img>`, `<table>`, and `<figure>`. Omitting parameters reverts values to
|
287
|
-
its defaults. +
|
288
|
-
See Reference Information below
|
289
|
-
|
290
|
-
|`$().speak2me('customize',tagName,prepend,append)`
|
291
|
-
|Replaces default text spoken prior to and after the content of the
|
292
|
-
*HTML tags* `<q>`, `<ol>`, `<ul>`, and `<blockquote>`. +
|
293
|
-
Omitting parameters reverts values to its defaults. +
|
294
|
-
See Reference Information below
|
295
|
-
|===
|
296
|
-
|
297
|
-
=== HTML Data Attributes
|
298
|
-
|
299
|
-
[cols="6a,6a", options="header", width="100%", role="rtable"]
|
300
|
-
|===
|
301
|
-
|Data Attribute |Description
|
302
|
-
|
303
|
-
|`data-speak2me-ignore`
|
304
|
-
|Content from that DOM element and its descendents are ignored.
|
305
|
-
|
306
|
-
|`data-speak2me-recognize`
|
307
|
-
|Content from that DOM element is spoken, overriding the default.
|
308
|
-
|
309
|
-
|`data-speak2me-spell`
|
310
|
-
|Content from that DOM element is spelled out.
|
311
|
-
|
312
|
-
|`data-speak2me-prepend=text`
|
313
|
-
|Specified _text_ is spoken prior to the content of its DOM element.
|
314
|
-
|
315
|
-
|`data-speak2me-append=text`
|
316
|
-
|Specified _text_ is spoken after to the content of its DOM element.
|
317
|
-
|
318
|
-
|`data-speak2me-swap=text`
|
319
|
-
|Specified _text_ is spoken in place of the content of its DOM element.
|
320
|
-
|===
|
321
|
-
|
322
|
-
=== Reference Information
|
323
|
-
|
324
|
-
Chaining calls is acceptable. For example, the following works just
|
325
|
-
fine.
|
326
|
-
[source, javascript]
|
327
|
-
----
|
328
|
-
$('article').speak2me('rate',1.3).speak2me('speak');
|
329
|
-
----
|
330
|
-
|
331
|
-
CAUTION: *Ignored Tags:* audio, button, canvas, code, del, dialog, dl, embed,
|
332
|
-
form, head, iframe, meter, nav, noscript, object, s, script, select,
|
333
|
-
style, textarea, video
|
334
|
-
|
335
|
-
[cols=",,", options="header", width="100%", role="rtable"]
|
336
|
-
|===
|
337
|
-
|HTML Tag |Default Prepend Text |Default Append Text
|
338
|
-
|`<img>` |There’s an embedded image with the description, |n/a
|
339
|
-
|`<table>` |There’s an embedded table with the caption, |n/a
|
340
|
-
|`<figure>` |There’s an embedded figure with the caption, |n/a
|
341
|
-
|`<q>` and “ ” |Quote, |, Unquote,
|
342
|
-
|`<ol>` |Start of list. |End of list.
|
343
|
-
|`<ul>` |Start of list. |End of list.
|
344
|
-
|`<blockquote>` |Blockquote start. |Blockquote end.
|
345
|
-
|===
|
346
|
-
|
347
|
-
IMPORTANT: A comma `,` followed by a space results in a pause when
|
348
|
-
spoken. A period `.` results in a *slightly* longer *pause*.
|
349
|
-
|
350
|
-
|
351
|
-
[role="mt-5"]
|
352
|
-
== Issues
|
353
|
-
|
354
|
-
=== Issues can't be fixed with JavaScript
|
355
|
-
|
356
|
-
Some issues are platform-specific. You need to your app in a way to avoid
|
357
|
-
these issues, where possible:
|
358
|
-
|
359
|
-
* All browsers on Android actually do a cancel/stop when calling
|
360
|
-
`peechSynthesis.pause`; pause is simply not supported on Android
|
361
|
-
|
362
|
-
* There are *no* voices on *Chromium-Ubuntu* and Ubuntu-derivatives
|
363
|
-
unless the browser is started with a flag
|
364
|
-
* If on Chromium-Desktop Ubuntu and the very first page wants to load
|
365
|
-
speech synthesis, then there are no voices ever loaded until the
|
366
|
-
page is refreshed or a new page is entered. This can be fixed with
|
367
|
-
JavaScript but it can lead to very bad UX to auto-refresh the page.
|
368
|
-
* If voices are not installed on the host-OS and there are no voices
|
369
|
-
loaded from remote by the browser, then there are no voices and
|
370
|
-
thus no speech synthesis
|
371
|
-
* There is no chance to just instant-load custom voices from remote
|
372
|
-
and use them as a shim in case there are no voices
|
373
|
-
* If the installed voices are just bad users have to manually install
|
374
|
-
better voices
|
375
|
-
|
376
|
-
=== Chrome-specific fix
|
377
|
-
|
378
|
-
Longer texts on Chrome-Desktop will be cancelled automatically after
|
379
|
-
*15 seconds*. This can be fixed by either chunking the texts or by
|
380
|
-
using an interval of "zero"-latency pause/resume combination. At the
|
381
|
-
same time this fix breaks on *Android*, since Android devices don't implement
|
382
|
-
speechSynthesis.pause() as pause but as cancel:
|
383
|
-
|
384
|
-
[source, javascript]
|
385
|
-
----
|
386
|
-
let timer
|
387
|
-
|
388
|
-
utterance.onstart = () => {
|
389
|
-
// detection is up to you for this article as
|
390
|
-
// this is an own huge topic for itself
|
391
|
-
if (!isAndroid) {
|
392
|
-
resumeInfinity(utterance)
|
393
|
-
}
|
394
|
-
}
|
395
|
-
|
396
|
-
const clear = () => { clearTimeout(timer) }
|
397
|
-
|
398
|
-
utterance.onerror = clear
|
399
|
-
utterance.onend = clear
|
400
|
-
|
401
|
-
const resumeInfinity = (target) => {
|
402
|
-
// prevent memory-leak in case utterance is deleted, while this is ongoing
|
403
|
-
if (!target && timer) { return clear() }
|
404
|
-
|
405
|
-
speechSynthesis.pause()
|
406
|
-
speechSynthesis.resume()
|
407
|
-
|
408
|
-
timer = setTimeout(function () {
|
409
|
-
resumeInfinity(target)
|
410
|
-
}, 5000)
|
411
|
-
}
|
412
|
-
----
|
@@ -1,259 +0,0 @@
|
|
1
|
-
---
|
2
|
-
title: Gem
|
3
|
-
tagline: Cheatsheet for daily use
|
4
|
-
|
5
|
-
date: 2023-05-19
|
6
|
-
#last_modified: 2023-01-01
|
7
|
-
|
8
|
-
description: >
|
9
|
-
J1 Template is a Bootstrap V5 website template for the static
|
10
|
-
site generator Jekyll.
|
11
|
-
The Cheatsheet discuss RubyGems commands for daily use.
|
12
|
-
RubyGems is a package manager for the Ruby programming language. It provides
|
13
|
-
a convenient way to distribute and manage software packages, called gems,
|
14
|
-
written in Ruby. With RubyGems, developers can easily install, uninstall, and
|
15
|
-
manage Ruby libraries and applications.
|
16
|
-
keywords: >
|
17
|
-
Jekyll, Theme, JekyllOne, Info, Manual, Cheatsheet, Ruby, Gem
|
18
|
-
|
19
|
-
categories: [ Manual ]
|
20
|
-
tags: [ Cheatsheet, Gem ]
|
21
|
-
|
22
|
-
image:
|
23
|
-
path: /assets/images/modules/attics/1920x1280/recha-oktaviani.jpg
|
24
|
-
width: 1920
|
25
|
-
height: 1280
|
26
|
-
|
27
|
-
regenerate: false
|
28
|
-
permalink: /pages/public/tools/cheatsheet/gem/
|
29
|
-
|
30
|
-
resources: [ animate, clipboard, rouge ]
|
31
|
-
resource_options:
|
32
|
-
- attic:
|
33
|
-
slides:
|
34
|
-
- url: /assets/images/modules/attics/1920x1280/recha-oktaviani.jpg
|
35
|
-
alt: Photo by Recha Oktaviani on Unsplash
|
36
|
-
badge:
|
37
|
-
type: unsplash
|
38
|
-
author: Recha Oktaviani
|
39
|
-
href: https://unsplash.com/de/@rechaoktaviani
|
40
|
-
---
|
41
|
-
|
42
|
-
// Page Initializer
|
43
|
-
// =============================================================================
|
44
|
-
// Enable the Liquid Preprocessor
|
45
|
-
:page-liquid:
|
46
|
-
|
47
|
-
// Set (local) page attributes here
|
48
|
-
// -----------------------------------------------------------------------------
|
49
|
-
// :page--attr: <attr-value>
|
50
|
-
|
51
|
-
// Load Liquid procedures
|
52
|
-
// -----------------------------------------------------------------------------
|
53
|
-
{% capture load_attributes %}themes/{{site.template.name}}/procedures/global/attributes_loader.proc{%endcapture%}
|
54
|
-
|
55
|
-
// Load page attributes
|
56
|
-
// -----------------------------------------------------------------------------
|
57
|
-
{% include {{load_attributes}} scope="global" %}
|
58
|
-
|
59
|
-
|
60
|
-
// Page content
|
61
|
-
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
62
|
-
|
63
|
-
// Include sub-documents (if any)
|
64
|
-
// -----------------------------------------------------------------------------
|
65
|
-
[role="dropcap"]
|
66
|
-
The Cheatsheet discuss RubyGems commands for daily use.
|
67
|
-
RubyGems is a package manager for the Ruby programming language. It provides
|
68
|
-
a convenient way to distribute and manage software packages, called GEMs.
|
69
|
-
With RubyGems, developers can easily install, uninstall, and manage Ruby
|
70
|
-
libraries and applications. It simplifies obtaining and managing the
|
71
|
-
dependencies needed for a Ruby project by automatically resolving and
|
72
|
-
installing the GEMs required.
|
73
|
-
|
74
|
-
NOTE: The term `gem` is related to the *tool* provided by RubyGems. `GEM`
|
75
|
-
(capital letters) means the *library* to be managed by the command `gem`
|
76
|
-
at the command line.
|
77
|
-
|
78
|
-
RubyGems also provides a centralized *repository*, the RubyGems website
|
79
|
-
at https://rubygems.org/[rubygems.org, {browser-window--new}], where developers
|
80
|
-
can publish their *GEMs* for others to use. The website serves as a searchable
|
81
|
-
catalog of available GEMs, allowing developers to discover and download GEMs
|
82
|
-
for their projects.
|
83
|
-
|
84
|
-
TIP: In addition to the default RubyGems repository, developers can
|
85
|
-
configure their own GEM sources or specify alternative sources when
|
86
|
-
installing GEMs. This flexibility allows private GEM repositories or
|
87
|
-
custom sources to be used as needed.
|
88
|
-
|
89
|
-
RubyGems comes pre-installed with a Ruby installation. It provides
|
90
|
-
a command-line interface, the `gem` command, for performing various
|
91
|
-
operations, such as installing GEMS, listing installed libraries,
|
92
|
-
updating GEMs, and managing library sources.
|
93
|
-
|
94
|
-
Here are *common* commands you can use with the RubyGems `gem` command:
|
95
|
-
|
96
|
-
* *install* -- Installs a GEM from the default RubyGems repository
|
97
|
-
* *uninstall* -- Uninstalls a GEM
|
98
|
-
* *update* -- Updates installed GEMs to their latest versions
|
99
|
-
* *search* -- Searches for GEMs matching a specific term
|
100
|
-
* *list* -- Lists all installed GEMs
|
101
|
-
* *info* -- Provides information about a specific GEM
|
102
|
-
* *cleanup* -- Removes old versions of installed GEMs, keeping only the latest version
|
103
|
-
|
104
|
-
The following examples give your an overview of the most *common* used
|
105
|
-
commands managing Ruby GEMs for daily use. All examples are focussing the *J1*
|
106
|
-
template to make it easier for users using the template system. Anyway, all
|
107
|
-
commands can be used for *any* Ruby Appication by simply replacing the *name*
|
108
|
-
of the GEM as required.
|
109
|
-
|
110
|
-
// Include sub-documents (if any)
|
111
|
-
// -----------------------------------------------------------------------------
|
112
|
-
[role="mt-5"]
|
113
|
-
== Install commands
|
114
|
-
|
115
|
-
The `install` command installs software packages (libraries) in the
|
116
|
-
Ruby programming language. The command will then search for the
|
117
|
-
GEM specified on the _RubyGems_ website (or a diifrerebt GEM
|
118
|
-
repository configured), download it, and finally install it on your
|
119
|
-
system.
|
120
|
-
|
121
|
-
=== Install from a Gemfile
|
122
|
-
|
123
|
-
Add this line to your application's Gemfile:
|
124
|
-
|
125
|
-
[source, sh]
|
126
|
-
----
|
127
|
-
gem 'j1_template', '~> 2023.4.2'
|
128
|
-
----
|
129
|
-
|
130
|
-
and install the locally created RubGem as:
|
131
|
-
|
132
|
-
[source, sh]
|
133
|
-
----
|
134
|
-
gem install --local j1-template --no-document
|
135
|
-
----
|
136
|
-
|
137
|
-
=== Install globally
|
138
|
-
|
139
|
-
bla ... latest version ...
|
140
|
-
|
141
|
-
[source, sh]
|
142
|
-
----
|
143
|
-
gem install j1-template
|
144
|
-
----
|
145
|
-
|
146
|
-
=== Install with no docs
|
147
|
-
|
148
|
-
bla ... latest version ...
|
149
|
-
|
150
|
-
[source, sh]
|
151
|
-
----
|
152
|
-
gem install j1-template --no-document
|
153
|
-
----
|
154
|
-
|
155
|
-
=== Install userized
|
156
|
-
|
157
|
-
bla ... latest version ...
|
158
|
-
|
159
|
-
When you use the `--user-install` option, RubyGems will install the GEMs
|
160
|
-
to a directory inside your *home* directory under `~/.gem/ruby/3.1.0`
|
161
|
-
for Ruby version `3.1.x`. The *commands* provided by the GEMs you have
|
162
|
-
installed will end up in folder `~/.gem/ruby/3.1.0/bin`.
|
163
|
-
|
164
|
-
[source, sh]
|
165
|
-
----
|
166
|
-
gem install j1-template --user-install --no-document
|
167
|
-
----
|
168
|
-
|
169
|
-
For GEMs installed *userized* that contain *programs*, you need to add
|
170
|
-
the folder `~/.gem/ruby/3.1.0/bin` to your `PATH` environment variable
|
171
|
-
to get access.
|
172
|
-
|
173
|
-
=== Install a specific version
|
174
|
-
|
175
|
-
bla ... specific version ...
|
176
|
-
|
177
|
-
[source, sh]
|
178
|
-
----
|
179
|
-
gem install j1-template -v 2023.4.2 --user-install --no-document
|
180
|
-
----
|
181
|
-
|
182
|
-
You can also use *version* comparators like `>=` or `~>`.
|
183
|
-
|
184
|
-
[source, sh]
|
185
|
-
----
|
186
|
-
gem install j1-template -v "~> 2023.4.2" --user-install --no-document
|
187
|
-
----
|
188
|
-
|
189
|
-
=== Install from a different source
|
190
|
-
|
191
|
-
bla ... specific version ...
|
192
|
-
|
193
|
-
[source, sh]
|
194
|
-
----
|
195
|
-
gem install j1-template -v 2023.4.2 --source 'https://gem.fury.io/jekyll-one-org/' --user-install --no-document
|
196
|
-
----
|
197
|
-
|
198
|
-
[role="mt-5"]
|
199
|
-
== Uninstall commands
|
200
|
-
|
201
|
-
bla
|
202
|
-
|
203
|
-
|
204
|
-
[role="mt-5"]
|
205
|
-
== Update commands
|
206
|
-
|
207
|
-
bla
|
208
|
-
|
209
|
-
|
210
|
-
[role="mt-5"]
|
211
|
-
== Search commands
|
212
|
-
|
213
|
-
bla
|
214
|
-
|
215
|
-
|
216
|
-
[role="mt-5"]
|
217
|
-
== List commands
|
218
|
-
|
219
|
-
bla
|
220
|
-
|
221
|
-
|
222
|
-
[role="mt-5"]
|
223
|
-
== Info commands
|
224
|
-
|
225
|
-
bla
|
226
|
-
|
227
|
-
|
228
|
-
[role="mt-5"]
|
229
|
-
== Cleanup commands
|
230
|
-
|
231
|
-
bla
|
232
|
-
|
233
|
-
[role="mt-5"]
|
234
|
-
=== Clean up old GEM versions
|
235
|
-
|
236
|
-
To clean up old versions on your `GEM_PATH` of installed gems use
|
237
|
-
below command:
|
238
|
-
|
239
|
-
[source, sh]
|
240
|
-
----
|
241
|
-
gem cleanup <GEMNAME …>
|
242
|
-
----
|
243
|
-
|
244
|
-
The cleanup command removes old versions of gems from GEM_HOME that are not
|
245
|
-
required to meet a dependency. If a gem is installed elsewhere in GEM_PATH
|
246
|
-
the cleanup command won’t delete it.
|
247
|
-
|
248
|
-
If no gems are named all gems in GEM_HOME are cleaned.
|
249
|
-
|
250
|
-
|
251
|
-
[role="mt-5"]
|
252
|
-
== Update Rubygems
|
253
|
-
|
254
|
-
[source, sh]
|
255
|
-
----
|
256
|
-
gem install rubygems-update
|
257
|
-
update_rubygems
|
258
|
-
gem update --system
|
259
|
-
----
|