{"id":19588894,"url":"https://github.com/atelierarith/plutomonacoeditor.jl","last_synced_at":"2026-04-02T11:47:04.015Z","repository":{"id":262207503,"uuid":"865349102","full_name":"AtelierArith/PlutoMonacoEditor.jl","owner":"AtelierArith","description":"Monaco Editor on Pluto Notebooks","archived":false,"fork":false,"pushed_at":"2025-04-14T13:26:49.000Z","size":85,"stargazers_count":6,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-26T22:06:24.106Z","etag":null,"topics":["julia","julialang","pluto-notebooks"],"latest_commit_sha":null,"homepage":"","language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AtelierArith.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"terasakisatoshi"}},"created_at":"2024-09-30T11:42:35.000Z","updated_at":"2025-04-14T13:26:52.000Z","dependencies_parsed_at":"2025-03-29T06:21:00.962Z","dependency_job_id":"390cf622-6ea8-4c18-9e25-8fd54e993e56","html_url":"https://github.com/AtelierArith/PlutoMonacoEditor.jl","commit_stats":null,"previous_names":["atelierarith/plutomonacoeditor.jl"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/AtelierArith/PlutoMonacoEditor.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FPlutoMonacoEditor.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FPlutoMonacoEditor.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FPlutoMonacoEditor.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FPlutoMonacoEditor.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AtelierArith","download_url":"https://codeload.github.com/AtelierArith/PlutoMonacoEditor.jl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AtelierArith%2FPlutoMonacoEditor.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266978008,"owners_count":24015487,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["julia","julialang","pluto-notebooks"],"created_at":"2024-11-11T08:16:28.408Z","updated_at":"2026-04-02T11:47:03.973Z","avatar_url":"https://github.com/AtelierArith.png","language":"Julia","funding_links":["https://github.com/sponsors/terasakisatoshi"],"categories":[],"sub_categories":[],"readme":"# [PlutoMonacoEditor.jl](https://github.com/AtelierArith/PlutoMonacoEditor.jl)\n\n[![CI](https://github.com/AtelierArith/PlutoMonacoEditor.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/AtelierArith/PlutoMonacoEditor.jl/actions/workflows/CI.yml)\n\n## Description\n\n[This repository](https://github.com/AtelierArith/PlutoMonacoEditor.jl) provides an editor for writing non-Julia source code that can be used with `@bind` in [Pluto.jl](https://plutojl.org/). This editor is the [Monaco Editor](https://github.com/microsoft/monaco-editor) itself.\nIf you want to write code on top of Pluto Notebook for non-Julia source code, try this repository.\n\n\u003cimg width=\"800\" alt=\"image\" src=\"https://github.com/user-attachments/assets/531961f8-228a-4fbb-9ea7-2c82c94810ac\"\u003e\n\n## Python editor\n\n```julia-repl\njulia\u003e # TL;DR\njulia\u003e using Pluto; Pluto.run(notebook=\"examples/python.jl\")\n```\n\nPrepare the following code to set up an instance of Monaco Editor.\n\n```julia\nbegin\n\tusing PlutoMonacoEditor: MonacoEditor\n\tusing CondaPkg\n\tCondaPkg.add_pip(\"numpy\")\n\tusing PythonCall\nend\n```\n\n```julia\nbegin\n\tinitCode = \"\"\"\n\timport numpy as np\n\tdef myapi():\n\t\treturn np.random.random((2, 3))\n\n\t\"\"\"\n\t@bind pythoncode MonacoEditor(\"python\", initCode)\nend\n```\n\nThe `@bind` macro connects the value of `MonacoEditor(\"pythno\", initCode)` and Julia variable `pythoncode`.\nAs an application, to compile the source code `pythoncode`, Add the following code to your Pluto Notebook:\n\n```julia\nbegin\n\tfunction loadpythonmodule(pythoncode)\n\t\twrite(\"mylib.py\", pythoncode)\n\t\timportlib = pyimport(\"importlib\")\n\t\tpyimport(\"sys\").\"path\".append(@__DIR__)\n\t\tmylib = pyimport(\"mylib\")\n\t\timportlib.reload(mylib)\n\t\tmylib\n\tend\n\n\tmylib = loadpythonmodule(pythoncode)\nend\n```\n\nThis defines a Python module as `mylib`. We can call an function in this module with:\n\n```julia\nprintln(mylib.myapi())\n```\n\n### Rust editor\n\n```julia-repl\njulia\u003e # TL;DR\njulia\u003e using Pluto; Pluto.run(notebook=\"examples/rust.jl\")\n```\n\nPrepare the following code to set up an instance of Monaco Editor.\n\n```julia\nbegin\n\tusing PlutoMonacoEditor: MonacoEditor\n\tinitCode = \"\"\"\n\tfn main(){\n\t\tprintln!(\"Hello\");\n\t}\n\t\"\"\"\n\t@bind rustcode MonacoEditor(\"rust\", initCode)\nend\n```\n\nThe `@bind` macro connects the value of `MonacoEditor(\"rust\", initCode)` and Julia variable `rustcode`.\nAs an application, to compile the source code `rustcode`, Add the following code to your Pluto Notebook:\n\n```julia\nmktempdir() do d\n\tsourcepath = joinpath(d, \"main.rs\")\n\twrite(sourcepath, rustcode)\n\texecutablepath = joinpath(d, \"main\")\n\ttry\n\t\trun(`rustc $(sourcepath) -o $(executablepath)`)\n\t\tprintln(readchomp(`$(executablepath)`))\n\tcatch\n\tend\nend\n```\n\n## Appendix\n\n- [Why I created this package](https://htmlview.glitch.me/?https://gist.github.com/terasakisatoshi/d2e7397a1e88a4f0cb6dad41b20a7d09)\n\n\u003e ❓ What is the relationship between VS Code and the Monaco Editor?\n\u003e\n\u003eThe Monaco Editor is generated straight from VS Code's sources with some shims around services the code needs to make it run in a web browser outside of its home.\n\nhttps://github.com/microsoft/monaco-editor?tab=readme-ov-file#faq\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fplutomonacoeditor.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatelierarith%2Fplutomonacoeditor.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatelierarith%2Fplutomonacoeditor.jl/lists"}