i can’t add any new leaflet plugins to my folium map

can anyone show me how to add this plugin correctly:

def initialize_map(self):
    # Create a base map
    m = folium.Map(location=[30.0444, 31.2357], zoom_start=8)
    folium.TileLayer(
        tiles='https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}',
        attr='Esri',
        name='Esri Satellite',
        overlay=False,
        control=True
    ).add_to(m)

    # Add Leaflet-Ruler plugin
    folium.JavascriptLink("https://cdn.jsdelivr.net/gh/gokertanrisever/leaflet-ruler@master/src/leaflet-ruler.js",).add_to(m)
    folium.CssLink("https://cdn.jsdelivr.net/gh/gokertanrisever/leaflet-ruler@master/src/leaflet-ruler.css").add_to(m)
    # Initialize the ruler
    ruler_init = """
    function addRuler(map) {
        L.control.ruler().addTo(map);
    }
    """
    m.get_root().html.add_child(folium.Element("<script>"+ruler_init+"</script>"))

i tried to add ruler plugin but it doesn’t appear