support boolean values for boolean attributes
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 42/100
Research direction
The issue names no source file or test; start by locating how Hyperscript.jl serializes HTML attributes and reviewing existing attribute-related tests. Define done as supporting boolean values so false omits the attribute and true emits an HTML5-conforming boolean attribute, with tests covering both cases.
Written by the indexing model from the issue text.
Description
Even though the correct HTML5 thing to do is to use valueless boolean attributes or to not add them at all (i.e. <input type=checkbox checked /> versus <input type=checkbox />), this becomes a bit awkward when generating them programmatically. In particular, if one wants to add observables to Hyperscript to add interactivity (see https://github.com/SimonDanisch/JSServe.jl/pull/35 for instance), things become a bit awkward.
From what I understand, HTML5 actually disallows using "true" or "false" as values for boolean attributes (see here). Could it be possible to support passing checked = false to mean that the attribute is actually not set, and checked = true to set it?
I confess I'm not sure what the attribute should be set to with checked = true, but I imagine anything that conforms to HTML5 would be fine (empty string, or name of the attribute, or maybe even valueless).
- Dominant language
- Julia
- Stars
- 105
- Forks
- 12
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaWeb/Hyperscript.jl
-
Difficulty 3/5 1-2 days Newbie friendliness 30/100
JuliaWeb/Hyperscript.jl#46 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
JuliaWeb/Hyperscript.jl#44 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
JuliaWeb/Hyperscript.jl#42 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
JuliaWeb/Hyperscript.jl#40 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
JuliaWeb/Hyperscript.jl#37 ·
All issues in JuliaWeb/Hyperscript.jl
Similar issues
-
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
JuliaDiff/ChainRules.jl#871 · 1 comment ·
Maintainers usually reply within 1 day
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 62/100
JuliaStats/LogExpFunctions.jl#134 · 2 comments ·
-
code bug PowerSystems 6.0
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Sienna-Platform/PowerSystems.jl#1849 ·
Maintainers usually reply within 7 days