https://github.com/atelierarith/plutomonacoeditor.jl
Monaco Editor on Pluto Notebooks
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (9.6%) to scientific vocabulary
Keywords
Repository
Monaco Editor on Pluto Notebooks
Basic Info
Statistics
- Stars: 6
- Watchers: 2
- Forks: 1
- Open Issues: 1
- Releases: 0
Topics
Metadata Files
README.md
PlutoMonacoEditor.jl
Description
This repository provides an editor for writing non-Julia source code that can be used with @bind in Pluto.jl. This editor is the Monaco Editor itself.
If you want to write code on top of Pluto Notebook for non-Julia source code, try this repository.
Python editor
julia-repl
julia> # TL;DR
julia> using Pluto; Pluto.run(notebook="examples/python.jl")
Prepare the following code to set up an instance of Monaco Editor.
julia
begin
using PlutoMonacoEditor: MonacoEditor
using CondaPkg
CondaPkg.add_pip("numpy")
using PythonCall
end
```julia begin initCode = """ import numpy as np def myapi(): return np.random.random((2, 3))
"""
@bind pythoncode MonacoEditor("python", initCode)
end ```
The @bind macro connects the value of MonacoEditor("pythno", initCode) and Julia variable pythoncode.
As an application, to compile the source code pythoncode, Add the following code to your Pluto Notebook:
```julia begin function loadpythonmodule(pythoncode) write("mylib.py", pythoncode) importlib = pyimport("importlib") pyimport("sys")."path".append(@DIR) mylib = pyimport("mylib") importlib.reload(mylib) mylib end
mylib = loadpythonmodule(pythoncode)
end ```
This defines a Python module as mylib. We can call an function in this module with:
julia
println(mylib.myapi())
Rust editor
julia-repl
julia> # TL;DR
julia> using Pluto; Pluto.run(notebook="examples/rust.jl")
Prepare the following code to set up an instance of Monaco Editor.
julia
begin
using PlutoMonacoEditor: MonacoEditor
initCode = """
fn main(){
println!("Hello");
}
"""
@bind rustcode MonacoEditor("rust", initCode)
end
The @bind macro connects the value of MonacoEditor("rust", initCode) and Julia variable rustcode.
As an application, to compile the source code rustcode, Add the following code to your Pluto Notebook:
julia
mktempdir() do d
sourcepath = joinpath(d, "main.rs")
write(sourcepath, rustcode)
executablepath = joinpath(d, "main")
try
run(`rustc $(sourcepath) -o $(executablepath)`)
println(readchomp(`$(executablepath)`))
catch
end
end
Appendix
❓ What is the relationship between VS Code and the Monaco Editor?
The 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.
https://github.com/microsoft/monaco-editor?tab=readme-ov-file#faq
Owner
- Name: AtelierArith
- Login: AtelierArith
- Kind: organization
- Email: contact@atelier-arith.jp
- Location: Japan
- Twitter: AtelierArith
- Repositories: 8
- Profile: https://github.com/AtelierArith
Enhance "Math meets Art"
GitHub Events
Total
- Create event: 24
- Issues event: 4
- Release event: 6
- Watch event: 6
- Delete event: 18
- Issue comment event: 24
- Push event: 30
- Pull request event: 34
- Fork event: 1
Last Year
- Create event: 24
- Issues event: 4
- Release event: 6
- Watch event: 6
- Delete event: 18
- Issue comment event: 24
- Push event: 30
- Pull request event: 34
- Fork event: 1
Committers
Last synced: 7 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| SatoshiTerasaki | t****h@g****m | 75 |
| Fons van der Plas | f****s@g****m | 1 |
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 2
- Total pull requests: 22
- Average time to close issues: 14 days
- Average time to close pull requests: about 4 hours
- Total issue authors: 2
- Total pull request authors: 2
- Average comments per issue: 9.0
- Average comments per pull request: 0.09
- Merged pull requests: 22
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 2
- Pull requests: 22
- Average time to close issues: 14 days
- Average time to close pull requests: about 4 hours
- Issue authors: 2
- Pull request authors: 2
- Average comments per issue: 9.0
- Average comments per pull request: 0.09
- Merged pull requests: 22
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- terasakisatoshi (1)
- JuliaTagBot (1)
Pull Request Authors
- terasakisatoshi (25)
- fonsp (2)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- julia 1 total
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 4
juliahub.com: PlutoMonacoEditor
Monaco Editor on Pluto Notebooks
- Documentation: https://docs.juliahub.com/General/PlutoMonacoEditor/stable/
- License: MIT
-
Latest release: 0.1.6
published 12 months ago
Rankings
Dependencies
- actions/checkout v4 composite
- julia-actions/cache v2 composite
- julia-actions/julia-buildpkg v1 composite
- julia-actions/julia-runtest v1 composite
- julia-actions/setup-julia v2 composite
- JuliaRegistries/TagBot v1 composite