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

Add template parameters to JsCode objects

Open
#2,121 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
javascript, python

Research direction

Start by reading the JsCode init entry point and current uses of string interpolation in JsCode bodies. Compare the requested %(name)s parameter behavior with the existing JavaScript generation approach. Done should mean JsCode accepts parameters and renders them using the proposed basic templating format, with coverage for the new behavior.

Written by the indexing model from the issue text.

Description

Is your feature request related to a problem? Please describe.
I'd like to be able to refer to other folium /leaflet objects inside a JsCode object. So far I have been using string interpolation inside the body of the JsCode object.

Describe the solution you'd like
I'd like to add parameters to the JsCode __init__ method, together with a basic string templating solution. For the string templating I'd prefer to use the good-old %(name)s format.

Describe alternatives you've considered
I considered using the newer formatting templates such as used in python format, or Jinja templates. However, due to brace heavy nature of javascript, I think a completely new variable marker will lead to more readable code.

Implementation
folium is maintained by volunteers. Can you help make a PR if we want to implement this feature?

Dominant language
Python
Stars
7.4k
Forks
2.3k
Avg merge
17h 22m
Merged PRs (30d)
11

Contributor guide

Open the contributing guide

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 python-visualization/folium

All issues in python-visualization/folium

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.