html_tags 0.1.183
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +456 -0
- data/USAGE.md +17 -0
- data/doc/README.gen +256 -0
- data/html_tags.gemspec +48 -0
- data/images/logo_for_the_html_tags_project.png +0 -0
- data/lib/html_tags/array_registered_html_tags.rb +126 -0
- data/lib/html_tags/autoinclude.rb +2 -0
- data/lib/html_tags/autoinclude_base_module.rb +7 -0
- data/lib/html_tags/base/README.md +3 -0
- data/lib/html_tags/base/base.rb +11 -0
- data/lib/html_tags/base/base_module.rb +271 -0
- data/lib/html_tags/base/prototype.rb +19 -0
- data/lib/html_tags/checks.rb +58 -0
- data/lib/html_tags/closing_tag/closing_tag.rb +76 -0
- data/lib/html_tags/constants/array_strip_newlines.rb +14 -0
- data/lib/html_tags/constants/misc.rb +21 -0
- data/lib/html_tags/constants.rb +26 -0
- data/lib/html_tags/html_closing_tags.rb +36 -0
- data/lib/html_tags/html_comment.rb +29 -0
- data/lib/html_tags/html_tags.rb +118 -0
- data/lib/html_tags/html_tags_constants.rb +14 -0
- data/lib/html_tags/individual_tags/a.rb +646 -0
- data/lib/html_tags/individual_tags/abbr.rb +44 -0
- data/lib/html_tags/individual_tags/address.rb +50 -0
- data/lib/html_tags/individual_tags/area.rb +60 -0
- data/lib/html_tags/individual_tags/article.rb +48 -0
- data/lib/html_tags/individual_tags/aside.rb +80 -0
- data/lib/html_tags/individual_tags/audio.rb +54 -0
- data/lib/html_tags/individual_tags/b.rb +22 -0
- data/lib/html_tags/individual_tags/bdo.rb +50 -0
- data/lib/html_tags/individual_tags/blockquote.rb +19 -0
- data/lib/html_tags/individual_tags/body.rb +19 -0
- data/lib/html_tags/individual_tags/br.rb +28 -0
- data/lib/html_tags/individual_tags/button.rb +143 -0
- data/lib/html_tags/individual_tags/canvas.rb +19 -0
- data/lib/html_tags/individual_tags/caption.rb +107 -0
- data/lib/html_tags/individual_tags/cite.rb +78 -0
- data/lib/html_tags/individual_tags/code.rb +105 -0
- data/lib/html_tags/individual_tags/del.rb +112 -0
- data/lib/html_tags/individual_tags/details.rb +79 -0
- data/lib/html_tags/individual_tags/dialog.rb +108 -0
- data/lib/html_tags/individual_tags/div.rb +99 -0
- data/lib/html_tags/individual_tags/em.rb +99 -0
- data/lib/html_tags/individual_tags/fieldset.rb +88 -0
- data/lib/html_tags/individual_tags/figure.rb +42 -0
- data/lib/html_tags/individual_tags/footer.rb +61 -0
- data/lib/html_tags/individual_tags/form.rb +93 -0
- data/lib/html_tags/individual_tags/h1.rb +48 -0
- data/lib/html_tags/individual_tags/h2.rb +46 -0
- data/lib/html_tags/individual_tags/h3.rb +78 -0
- data/lib/html_tags/individual_tags/h4.rb +36 -0
- data/lib/html_tags/individual_tags/h5.rb +36 -0
- data/lib/html_tags/individual_tags/h6.rb +40 -0
- data/lib/html_tags/individual_tags/head.rb +47 -0
- data/lib/html_tags/individual_tags/header.rb +54 -0
- data/lib/html_tags/individual_tags/hgroup.rb +78 -0
- data/lib/html_tags/individual_tags/html.rb +61 -0
- data/lib/html_tags/individual_tags/i.rb +47 -0
- data/lib/html_tags/individual_tags/iframe.rb +131 -0
- data/lib/html_tags/individual_tags/img.rb +135 -0
- data/lib/html_tags/individual_tags/input.rb +96 -0
- data/lib/html_tags/individual_tags/ins.rb +102 -0
- data/lib/html_tags/individual_tags/kbd.rb +109 -0
- data/lib/html_tags/individual_tags/keygen.rb +90 -0
- data/lib/html_tags/individual_tags/label.rb +77 -0
- data/lib/html_tags/individual_tags/legend.rb +48 -0
- data/lib/html_tags/individual_tags/li.rb +74 -0
- data/lib/html_tags/individual_tags/link.rb +58 -0
- data/lib/html_tags/individual_tags/main.rb +29 -0
- data/lib/html_tags/individual_tags/map.rb +95 -0
- data/lib/html_tags/individual_tags/mark.rb +78 -0
- data/lib/html_tags/individual_tags/menu.rb +79 -0
- data/lib/html_tags/individual_tags/nav.rb +64 -0
- data/lib/html_tags/individual_tags/object.rb +76 -0
- data/lib/html_tags/individual_tags/ol.rb +50 -0
- data/lib/html_tags/individual_tags/p.rb +92 -0
- data/lib/html_tags/individual_tags/pre.rb +16 -0
- data/lib/html_tags/individual_tags/progress.rb +114 -0
- data/lib/html_tags/individual_tags/script.rb +22 -0
- data/lib/html_tags/individual_tags/source.rb +42 -0
- data/lib/html_tags/individual_tags/span.rb +95 -0
- data/lib/html_tags/individual_tags/strong.rb +17 -0
- data/lib/html_tags/individual_tags/style.rb +29 -0
- data/lib/html_tags/individual_tags/summary.rb +77 -0
- data/lib/html_tags/individual_tags/sup.rb +57 -0
- data/lib/html_tags/individual_tags/table.rb +90 -0
- data/lib/html_tags/individual_tags/tbody.rb +19 -0
- data/lib/html_tags/individual_tags/td.rb +30 -0
- data/lib/html_tags/individual_tags/textarea.rb +72 -0
- data/lib/html_tags/individual_tags/th.rb +50 -0
- data/lib/html_tags/individual_tags/thead.rb +53 -0
- data/lib/html_tags/individual_tags/time.rb +50 -0
- data/lib/html_tags/individual_tags/title.rb +59 -0
- data/lib/html_tags/individual_tags/tr.rb +50 -0
- data/lib/html_tags/individual_tags/track.rb +59 -0
- data/lib/html_tags/individual_tags/u.rb +47 -0
- data/lib/html_tags/individual_tags/ul.rb +23 -0
- data/lib/html_tags/individual_tags/var.rb +46 -0
- data/lib/html_tags/individual_tags/video.rb +70 -0
- data/lib/html_tags/module.rb +5 -0
- data/lib/html_tags/opening_tag/opening_tag.rb +288 -0
- data/lib/html_tags/project/project_base_directory.rb +23 -0
- data/lib/html_tags/requires/require_the_html_tags_project.rb +9 -0
- data/lib/html_tags/requires/require_the_img_tag.rb +7 -0
- data/lib/html_tags/shared.rb +23 -0
- data/lib/html_tags/stag.rb +54 -0
- data/lib/html_tags/toplevel_methods/add.rb +22 -0
- data/lib/html_tags/toplevel_methods/full_output.rb +33 -0
- data/lib/html_tags/toplevel_methods/newline_or_empty.rb +21 -0
- data/lib/html_tags/toplevel_methods/strip_newlines.rb +27 -0
- data/lib/html_tags/version/version.rb +17 -0
- data/lib/html_tags/yaml/available_html_tags.yml +135 -0
- data/lib/html_tags/yaml/valid_tags_in_a_head_tag.yml +16 -0
- data/lib/html_tags.rb +5 -0
- data/test/testing_html_tags.rb +158 -0
- data/test/testing_the_a_tag.rb +162 -0
- data/test/testing_the_button_tag.rb +37 -0
- data/test/testing_the_details_tag.rb +38 -0
- metadata +171 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 2dfb6a7ceee870efe17695d864a404afa2b67adf81322554ca400b86dbf6b070
|
4
|
+
data.tar.gz: 31f182401cbdb827a4e7d09b60138d315c2c067670406b89299c6886c134f505
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 809ac6c23ebdaec820bdb7cb425f0c9c036bddecced0c1f9990e2d4b0d4490d0096c1752a3e025f9265f8d9d733bff48010122e2ecefae4595817e5479bc8b1a
|
7
|
+
data.tar.gz: 897ede2bae83ff5f3d0ecd13f2ddc2291c611c3c37b46eddcac55672beab625bbb9127e2e383887d6e634ba9c2978241b1c47d188213a562077f58f4f939a7b8
|
data/README.md
ADDED
@@ -0,0 +1,456 @@
|
|
1
|
+
[![forthebadge](https://forthebadge.com/images/badges/built-with-love.svg)](https://www.gobolinux.org/)
|
2
|
+
[![forthebadge](https://forthebadge.com/images/badges/made-with-ruby.svg)](https://www.ruby-lang.org/en/)
|
3
|
+
[![Gem Version](https://badge.fury.io/rb/html_tags.svg)](https://badge.fury.io/rb/html_tags)
|
4
|
+
|
5
|
+
This gem was <b>last updated</b> on the <span style="color: darkblue; font-weight: bold">19.02.2024</span> (dd.mm.yyyy notation), at <span style="color: steelblue; font-weight: bold">12:19:50</span> o'clock.
|
6
|
+
|
7
|
+
## Introduction to the HtmlTags gem
|
8
|
+
|
9
|
+
<img src="https://i.imgur.com/A1MaV0i.png" style="margin: 1em">
|
10
|
+
|
11
|
+
The <b>HtmlTags gem</b> is a somewhat small gem that will try to
|
12
|
+
<b>autogenerate Strings</b> put into methods resembling the
|
13
|
+
available HTML tags.
|
14
|
+
|
15
|
+
Let's next have a look at a specific example supporting this statement.
|
16
|
+
|
17
|
+
Take the following method call in Ruby:
|
18
|
+
|
19
|
+
span('foo')
|
20
|
+
|
21
|
+
So, we call the method span() and pass the String 'foo' into it. The
|
22
|
+
method .span() can be found as part of the HtmlTags gem.
|
23
|
+
|
24
|
+
This will be expanded towards the following String:
|
25
|
+
|
26
|
+
<span>foo</span>
|
27
|
+
|
28
|
+
In other words: the HtmlTags gem can be used to autogenerate
|
29
|
+
HTML code.
|
30
|
+
|
31
|
+
This functionality is then made available to other projects, which
|
32
|
+
can tap into that functionality, in particular the gem <b>cyberweb</b>.
|
33
|
+
I use the latter gem for my custom cgi/sinatra/rails projects.
|
34
|
+
|
35
|
+
The code that was part in the html_tags gem originally used to
|
36
|
+
be part of the <b>cyberweb</b> gem in the past, until <b>html_tags</b>
|
37
|
+
became a standalone gem, in the year <b>2013</b>.
|
38
|
+
|
39
|
+
## Goals and Objectives for the HtmlTags gem
|
40
|
+
|
41
|
+
The HtmlTags gem has various goals, some of which are more important
|
42
|
+
than others.
|
43
|
+
|
44
|
+
In no particular order, here are the different goals for this gem:
|
45
|
+
|
46
|
+
- Provide a way to generate all valid HTML tags, in particular for HTML5.
|
47
|
+
- Provide useful documentation as to how to use this project.
|
48
|
+
- Make the code as consistent as possible, unless the specific HTML tag at hand requires a different treatment
|
49
|
+
- Make the HtmlTags as self-contained as possible, e. g. no external dependencies.
|
50
|
+
- Make the HtmlTags as useful as possible, by also providing helper code unrelated to HTML-tags itself.
|
51
|
+
- Document the HTML that is supported by the gem.
|
52
|
+
|
53
|
+
## New ideas (playground for new ideas)
|
54
|
+
|
55
|
+
We could replace code elements such as:
|
56
|
+
|
57
|
+
<button onclick="show_source()">Click me</button>
|
58
|
+
|
59
|
+
With:
|
60
|
+
|
61
|
+
button.text('Click me').onclick('show_source')
|
62
|
+
|
63
|
+
Or perhaps simple:
|
64
|
+
|
65
|
+
button('Click me').on_clicked {
|
66
|
+
show_source
|
67
|
+
}
|
68
|
+
|
69
|
+
This is currently not implemented, though. Need to think more about
|
70
|
+
it first.
|
71
|
+
|
72
|
+
## Using HTML headers
|
73
|
+
|
74
|
+
The following example shows how to use the <b>h1 tag</b> via
|
75
|
+
HtmlTags:
|
76
|
+
|
77
|
+
HtmlTags.h1('Hello world!') # => "<h1>\nHello world!\n</h1>"
|
78
|
+
|
79
|
+
You can include the module HtmlTags. Then you can just type <b>h1()</b>
|
80
|
+
directly.
|
81
|
+
|
82
|
+
Another example, this time for the <b>div tag</b>:
|
83
|
+
|
84
|
+
name = 'Joe'
|
85
|
+
puts HtmlTags.div("Hello, #{name}!") # => <div>Hello, Joe!</div>
|
86
|
+
|
87
|
+
## HtmlTags.a
|
88
|
+
|
89
|
+
The HTML <b>a</b> tag is for hyperlinks; typically it contains a
|
90
|
+
**href** entry.
|
91
|
+
|
92
|
+
You can pass in a Hash, too, including a few supported JavaScript
|
93
|
+
functions.
|
94
|
+
|
95
|
+
Example for the latter:
|
96
|
+
|
97
|
+
onclick: 'change_the_colour_to()'
|
98
|
+
|
99
|
+
Note that you still have to write the function somewhere and pull it
|
100
|
+
into the .html file (or .cgi file or whatever else you are using).
|
101
|
+
|
102
|
+
I added support for this in <b>October 2021</b>, as I needed to have clickable
|
103
|
+
links that change colour upon being clicked. I used that to memorize
|
104
|
+
which links I clicked, without having to depend on CSS.
|
105
|
+
|
106
|
+
## Objectified HTML Tags
|
107
|
+
|
108
|
+
This is mostly for clarification. An objectified HTML tag is
|
109
|
+
a HTML tag that can be used like an object.
|
110
|
+
|
111
|
+
Example:
|
112
|
+
|
113
|
+
Span.new('Hello world!') # => <span>Hello world!</span>
|
114
|
+
|
115
|
+
The html_tags gem currently does not support this, but support for this
|
116
|
+
may be added in the future, depending on whether that use case turns
|
117
|
+
out to be sufficiently useful.
|
118
|
+
|
119
|
+
## How to use HtmlTags.span()
|
120
|
+
|
121
|
+
The span-tag in HTML creates something like this:
|
122
|
+
|
123
|
+
<span>Hello world!</span>
|
124
|
+
|
125
|
+
To attach a CSS class to this, in HTML, one can use something such
|
126
|
+
as:
|
127
|
+
|
128
|
+
<span class="padl1em">Hello world!</span>
|
129
|
+
|
130
|
+
This is simple HTML.
|
131
|
+
|
132
|
+
The html_tags gem also allows these use cases.
|
133
|
+
|
134
|
+
For instance, consider the following:
|
135
|
+
|
136
|
+
e HtmlTags.span('Hey there')
|
137
|
+
|
138
|
+
This is equivalent to the first variant shown before.
|
139
|
+
|
140
|
+
The actual output will be:
|
141
|
+
|
142
|
+
<span>
|
143
|
+
Hey there</span>
|
144
|
+
|
145
|
+
So there is a newline after the starting span-tag. The
|
146
|
+
reason as to this is that I feel that, for readability,
|
147
|
+
it is better to have a newline show up if you want to
|
148
|
+
do a view-source action on the resulting .html file.
|
149
|
+
|
150
|
+
Not everyone may want this, so we may need to have to
|
151
|
+
add a toggle to strip newlines there. But for the time
|
152
|
+
being this has to suffice.
|
153
|
+
|
154
|
+
## How to use HtmlTags.a()
|
155
|
+
|
156
|
+
Usage example for how to use <b>HtmlTags.a()</b>:
|
157
|
+
|
158
|
+
HtmlTags.a(
|
159
|
+
remote_url: remote_url,
|
160
|
+
text: title?.to_s,
|
161
|
+
css_style: 'font-weight: bold; color: darkblue'
|
162
|
+
)
|
163
|
+
|
164
|
+
## The structure of opening and closing tags
|
165
|
+
|
166
|
+
This subsection just shows a tiny bit of the structure behind
|
167
|
+
opening and closing tags.
|
168
|
+
|
169
|
+
Consider a HTML a tag such as:
|
170
|
+
|
171
|
+
<a>
|
172
|
+
|
173
|
+
This has three components: <b><</b>, <b>a</b> and <b>></b>.
|
174
|
+
|
175
|
+
These <b>three components</b> are, in order, called:
|
176
|
+
|
177
|
+
- opening bracket
|
178
|
+
- element ID
|
179
|
+
- closing bracket
|
180
|
+
|
181
|
+
The closing tag, that is:
|
182
|
+
|
183
|
+
</a>
|
184
|
+
|
185
|
+
Has one more component, the /, also called the forward slash
|
186
|
+
(unsurprisingly so).
|
187
|
+
|
188
|
+
Note that an opening tag can contain attributes.
|
189
|
+
|
190
|
+
## The bdo tag
|
191
|
+
|
192
|
+
<b>bdo</b> stands for <b>bi-directional override</b>.
|
193
|
+
|
194
|
+
The purpose of the bdo tag in HTML is to specify the text direction
|
195
|
+
or to override the current text direction. This is important
|
196
|
+
for languages such as <b>Arabic</b> or <b>Hebrew</b>.
|
197
|
+
|
198
|
+
Personally I do not really need this tag, but in the event that
|
199
|
+
other users of the <b>html_tag</b> gem need support for the bdo-tag,
|
200
|
+
support for it has been added to the html_tag gem in <b>June 2023</b>.
|
201
|
+
|
202
|
+
The <b>bdo tag</b> has a special attribute called <b>dir</b> - an
|
203
|
+
abbreviation standing for <b>direction</b>.
|
204
|
+
|
205
|
+
The dir attribute specifies the direction in which the text will
|
206
|
+
be displayed.
|
207
|
+
|
208
|
+
Only two values are permissive for the dir attribute:
|
209
|
+
|
210
|
+
(1) <b>ltr</b>: It means left to right. The text inside the bdo tag will
|
211
|
+
be rendered from left to right. This is the default value.
|
212
|
+
|
213
|
+
(2) <b>rtl</b>: It means right to left. The text inside the bdo tag
|
214
|
+
will be rendered from right to left.
|
215
|
+
|
216
|
+
Note that you can use the CSS class rtl-lang instead, so I am not
|
217
|
+
sure why that HTML tag is necessary.
|
218
|
+
|
219
|
+
At any rate, an invocation example follows:
|
220
|
+
|
221
|
+
HtmlTags.bdo()
|
222
|
+
|
223
|
+
## Working with HTML tables
|
224
|
+
|
225
|
+
You can use <b>HtmlTags.table</b> to create a String that represents
|
226
|
+
a HTML table. In January 2024 this functionality was extended a bit,
|
227
|
+
in that you can pass an Array to this method, via the block form.
|
228
|
+
That Array will be used as content for the HTML table at hand.
|
229
|
+
|
230
|
+
Usage example is this API:
|
231
|
+
|
232
|
+
puts HtmlTags.table(nil,'mars1em','test_table','border:1px solid rand') {
|
233
|
+
%w( abc def ghi jkl )
|
234
|
+
}
|
235
|
+
|
236
|
+
This would generate the following String:
|
237
|
+
|
238
|
+
<table class="mars1em" id="test_table" style="border:1px solid rand">
|
239
|
+
<tr><td>
|
240
|
+
abc</td><td>
|
241
|
+
def</td></tr><tr><td>
|
242
|
+
ghi</td><td>
|
243
|
+
jkl</td></tr>
|
244
|
+
</table>
|
245
|
+
|
246
|
+
Quite convenient, isn't it?
|
247
|
+
|
248
|
+
## Available HTML tags
|
249
|
+
|
250
|
+
The following HTML tags are valid, in <b>HTML5</b>:
|
251
|
+
|
252
|
+
|
253
|
+
<pre>
|
254
|
+
# ============================================================================ #
|
255
|
+
# Available HTML5 tags:
|
256
|
+
#
|
257
|
+
# https://dev.to/flippedcoding/the-ultimate-html5-tag-list-4i2a
|
258
|
+
# https://www.w3.org/TR/2012/WD-html-markup-20121025/elements.html
|
259
|
+
# https://www.tutorialrepublic.com/html-reference/html5-tags.php
|
260
|
+
#
|
261
|
+
# ============================================================================ #
|
262
|
+
|
263
|
+
# - !--...--
|
264
|
+
# - !doctype
|
265
|
+
- a
|
266
|
+
- abbr
|
267
|
+
# - acronym # Not available in HTML5, so the html_tag gem will not support it.
|
268
|
+
- address
|
269
|
+
# - applet # Not available in HTML5, so the html_tag gem will not support it.
|
270
|
+
- area
|
271
|
+
- article
|
272
|
+
- aside
|
273
|
+
- audio
|
274
|
+
- b
|
275
|
+
- base # Not sure if this will be implemented by the html_tag gem.
|
276
|
+
- basefont # Not available in HTML5, so the html_tag gem will not support it.
|
277
|
+
- bb # Not available in HTML5, so the html_tag gem will not support it.
|
278
|
+
- bdo # bdo stands for "bi-directional override".
|
279
|
+
- big # Not available in HTML5, so the html_tag gem will not support it.
|
280
|
+
- blockquote # Supported by the html_tags gem.
|
281
|
+
- body # Supported by the html_tags gem.
|
282
|
+
- br #
|
283
|
+
- button # Supported by the html_tags gem.
|
284
|
+
- canvas # Supported by the html_tags gem.
|
285
|
+
- caption # Supported by the html_tags gem.
|
286
|
+
- center
|
287
|
+
- cite # Supported by the html_tags gem.
|
288
|
+
- code # Supported by the html_tags gem.
|
289
|
+
- col
|
290
|
+
- colgroup
|
291
|
+
- command
|
292
|
+
- datagrid
|
293
|
+
- datalist
|
294
|
+
- dd
|
295
|
+
- del # Supported by the html_tags gem.
|
296
|
+
- details # Supported by the html_tags gem.
|
297
|
+
- dfn
|
298
|
+
- dialog # Supported by the html_tags gem.
|
299
|
+
# - dir # This feature is no longer recommended. See: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/dir
|
300
|
+
- div # Supported by the html_tags gem.
|
301
|
+
- dl
|
302
|
+
- dt
|
303
|
+
- em # Supported by the html_tags gem.
|
304
|
+
- embed # This one does not seem that useful anymore.
|
305
|
+
# - eventsource # This tag was removed from HTML5, so the HtmlTags won't support it.
|
306
|
+
- fieldset # Supported by the html_tags gem.
|
307
|
+
- figcaption
|
308
|
+
- figure # Supported by the html_tags gem.
|
309
|
+
# - font # NOT supported in HTML5.
|
310
|
+
- footer # Supported by the html_tags gem.
|
311
|
+
- form # Supported by the html_tags gem.
|
312
|
+
# - frame # NOT supported in HTML5.
|
313
|
+
# - frameset # The <frameset> tag was used in HTML4 to define a frameset. It is not part of HTML5.
|
314
|
+
- h1 # Supported by the html_tags gem.
|
315
|
+
- h2 # Supported by the html_tags gem.
|
316
|
+
- h3 # Supported by the html_tags gem.
|
317
|
+
- h4 # Supported by the html_tags gem.
|
318
|
+
- h5 # Supported by the html_tags gem.
|
319
|
+
- h6 # Supported by the html_tags gem.
|
320
|
+
- head # Supported by the html_tags gem.
|
321
|
+
- header # Supported by the html_tags gem.
|
322
|
+
- hgroup # Supported by the html_tags gem.
|
323
|
+
- hr # Supported by the html_tags gem.
|
324
|
+
- html # Supported by the html_tags gem.
|
325
|
+
- i # Supported by the html_tags gem.
|
326
|
+
- iframe # Supported by the html_tags gem.
|
327
|
+
- img # Supported by the html_tags gem.
|
328
|
+
- input # Supported by the html_tags gem.
|
329
|
+
- ins # Supported by the html_tags gem.
|
330
|
+
# - isindex # This has been removed from HTML5.
|
331
|
+
- kbd # Supported by the html_tags gem. The kbd element represents user input.
|
332
|
+
- keygen # Supported by the html_tags gem.
|
333
|
+
- label # Supported by the html_tags gem.
|
334
|
+
- legend # Supported by the html_tags gem.
|
335
|
+
- li # Supported by the html_tags gem.
|
336
|
+
- link # Supported by the html_tags gem.
|
337
|
+
- map # Supported by the html_tags gem.
|
338
|
+
- mark # Supported by the html_tags gem.
|
339
|
+
- menu # Supported by the html_tags gem.
|
340
|
+
- meta
|
341
|
+
- meter
|
342
|
+
- nav
|
343
|
+
- noframes
|
344
|
+
- noscript
|
345
|
+
- object # Supported by the html_tags gem.
|
346
|
+
- ol
|
347
|
+
- optgroup
|
348
|
+
- option
|
349
|
+
- output
|
350
|
+
- p
|
351
|
+
- param
|
352
|
+
- pre
|
353
|
+
- progress # Supported by the html_tags gem.
|
354
|
+
- q
|
355
|
+
- rp
|
356
|
+
- rt
|
357
|
+
- ruby
|
358
|
+
- s
|
359
|
+
- samp
|
360
|
+
- script
|
361
|
+
- section
|
362
|
+
- select
|
363
|
+
- small
|
364
|
+
- source # Supported by the html_tags gem.
|
365
|
+
- span
|
366
|
+
- strike
|
367
|
+
- strong
|
368
|
+
- style # Supported by the html_tags gem.
|
369
|
+
- sub
|
370
|
+
- summary # Supported by the html_tags gem.
|
371
|
+
- sup # Supported by the html_tags gem.
|
372
|
+
- table # Supported by the html_tags gem.
|
373
|
+
- tbody
|
374
|
+
- td
|
375
|
+
- textarea # Supported by the html_tags gem.
|
376
|
+
- tfoot
|
377
|
+
- th # Supported by the html_tags gem.
|
378
|
+
- thead # Supported by the html_tags gem.
|
379
|
+
- time # Supported by the html_tags gem.
|
380
|
+
- title # Supported by the html_tags gem.
|
381
|
+
- tr # Supported by the html_tags gem.
|
382
|
+
- track # Supported by the html_tags gem.
|
383
|
+
# - tt # This is no longer valid as of HTML5.
|
384
|
+
- u # Supported by the html_tags gem.
|
385
|
+
- ul # Supported by the html_tags gem.
|
386
|
+
- var # Supported by the html_tags gem.
|
387
|
+
- video # Supported by the html_tags gem.
|
388
|
+
- wbr # This is the "Word Break Opportunity" tag.
|
389
|
+
</pre>
|
390
|
+
|
391
|
+
|
392
|
+
In the long run the HtmlTags project should offer support
|
393
|
+
for <b>all</b> these HTML tags. This applies mostly to HTML5-tags
|
394
|
+
though; for instance, the <b>acronym tag</b> is no longer valid
|
395
|
+
in HTML5, and will thus not be supported by the html_tags
|
396
|
+
project.
|
397
|
+
|
398
|
+
|
399
|
+
## Contact information and mandatory 2FA (no longer) coming up in 2022 / 2023
|
400
|
+
|
401
|
+
If your creative mind has ideas and specific suggestions to make this gem
|
402
|
+
more useful in general, feel free to drop me an email at any time, via:
|
403
|
+
|
404
|
+
shevy@inbox.lt
|
405
|
+
|
406
|
+
Before that email I used an email account at Google gmail, but in **2021** I
|
407
|
+
decided to slowly abandon gmail, for various reasons. In order to limit the
|
408
|
+
explanation here, allow me to just briefly state that I do not feel as if I
|
409
|
+
want to promote any Google service anymore when the user becomes the end
|
410
|
+
product (such as via data collection by upstream services, including other
|
411
|
+
proxy-services). My feeling is that this is a hugely flawed business model
|
412
|
+
to begin with, and I no longer wish to support this in any way, even if
|
413
|
+
only indirectly so, such as by using services of companies that try to
|
414
|
+
promote this flawed model.
|
415
|
+
|
416
|
+
In regards to responding to emails: please keep in mind that responding
|
417
|
+
may take some time, depending on the amount of work I may have at that
|
418
|
+
moment. So it is not that emails are ignored; it is more that I have not
|
419
|
+
(yet) found the time to read and reply. This means there may be a delay
|
420
|
+
of days, weeks and in some instances also months. There is, unfortunately,
|
421
|
+
not much I can do when I need to prioritise my time investment, but I try
|
422
|
+
to consider <b>all</b> feedback as an opportunity to improve my projects
|
423
|
+
nonetheless.
|
424
|
+
|
425
|
+
In <b>2022</b> rubygems.org decided to make 2FA mandatory for every
|
426
|
+
gem owner eventually:
|
427
|
+
|
428
|
+
see
|
429
|
+
https://blog.rubygems.org/2022/06/13/making-packages-more-secure.html
|
430
|
+
|
431
|
+
Mandatory 2FA will eventually be extended to all rubygems.org developers and
|
432
|
+
maintainers. As I can not use 2FA, for reasons I will skip explaining here,
|
433
|
+
this means that my projects will eventually be removed, as I no longer
|
434
|
+
have any control over my projects hosted on rubygems.org (because I
|
435
|
+
can not use 2FA).
|
436
|
+
|
437
|
+
At that point, I no longer have any control what is done to my projects
|
438
|
+
since whoever is controlling the gems ecosystem took away our control
|
439
|
+
here. I am not sure at which point ruby became corporate-controlled -
|
440
|
+
that was not the case several years ago, so something has
|
441
|
+
changed.
|
442
|
+
|
443
|
+
Ruby also only allows 2FA users to participate on the issue tracker these
|
444
|
+
days:
|
445
|
+
|
446
|
+
https://bugs.ruby-lang.org/issues/18800
|
447
|
+
|
448
|
+
But this has been reverted some months ago, so it is no longer applicable.
|
449
|
+
Suffice to say that I do not think that we should only be allowed to
|
450
|
+
interact on the world wide web when some 'authority' authenticated us,
|
451
|
+
such as via mandatory 2FA, so I hope this won't come back again.
|
452
|
+
|
453
|
+
Fighting spam is a noble goal, but when it also means you lock out
|
454
|
+
real human people then this is definitely NOT a good situation
|
455
|
+
to be had.
|
456
|
+
|
data/USAGE.md
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
= Usage of this Library
|
2
|
+
|
3
|
+
== Requiring it
|
4
|
+
|
5
|
+
require 'html_tags'
|
6
|
+
|
7
|
+
== Using it in a project
|
8
|
+
|
9
|
+
puts HtmlTags.is_valid_html? '<br>'
|
10
|
+
puts HtmlTags.is_valid_html? '<div>'
|
11
|
+
puts HtmlTags.is_valid_html? '<dav>'
|
12
|
+
puts HtmlTags.string_contains_only_valid_html_tags? 'hello ruby </br>'
|
13
|
+
puts HtmlTags.string_contains_only_valid_html_tags? 'hello ruby<haha>'
|
14
|
+
|
15
|
+
include HtmlTags # Or simply include it, but be careful with this.
|
16
|
+
|
17
|
+
p 'hi there' # This now works - it has however redefined p().
|