define a js_str macro for creating JSONText
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 38/100
Research direction
Start by reading the existing JSONText representation and the issue's proposed js"""...""" and interpolation examples. Determine how both non-interpolated and i-flag forms should construct JSONText, then verify that the demonstrated alert examples produce the stated results.
Written by the indexing model from the issue text.
Description
I propose to define a js_str macro to generate JSONText with and without interpolation as below.
Besides a handy short form a big advantage is that in VSCode JS-Syntax-Highlighting can be achieved by triple-quoting, e.g.
js"""
console.log('This looks pretty!')
"""
Many packages that handle js expressions, e.g. GenieFramework or Electron, would benefit (https://github.com/davidanthoff/Electron.jl/issues/154) (GenieFramework currently exports its own version)
js"""alert("Hello World")"""
# JSONText("alert(\"Hello World\")")
Interpolation could be supported via the i flag, such as
js"""alert("1 + 2 == $(1 + 2)")"""i
# JSONText("alert(\"1 + 2 == 3\")")
I'll happily file a PR.
- Dominant language
- Julia
- Stars
- 359
- Forks
- 116
- Avg merge
- 1d 8h
- Merged PRs (30d)
- 11
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 JuliaIO/JSON.jl
-
JSON.json writes an empty `Vector{Union{}}` as `{}` instead of `[]`Possibly taken @krynju claimed this 3 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
JuliaIO/JSON.jl#492 · 1 comment ·
Maintainers usually reply within 1 day
-
Method ambiguity for custom types with generically defined `StructUtils.StructStyle` methodsPossibly taken @quinnj claimed this 128 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
JuliaIO/JSON.jl#464 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
JuliaIO/JSON.jl#415 · 2 comments ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
JuliaIO/JSON.jl#377 · 14 comments · 2 reactions ·
Maintainers usually reply within 1 day
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
SciML/ModelingToolkitStandardLibrary.jl#529 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 60/100
EnzymeAD/ReactantServer.jl#103 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
ClapeyronThermo/Clapeyron.jl#649 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
ohno/Antique.jl#165 ·
-
`UnitLowerTriangular(transpose(M')) \ b` returns a wrong solutionPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaLang/LinearAlgebra.jl#1749 ·
Maintainers usually reply within 2 days