Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

define a js_str macro for creating JSONText

Open
#433 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
38/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
julia
Domain
data

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!')
"""
Image

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from JuliaIO/JSON.jl

All issues in JuliaIO/JSON.jl

Similar issues

More Julia issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.